when the form loads user needs to enter street and city. After that I need to show him that location on the map and also to save longitude and latitude of that address.
I've done only this, which finds the location of the street and I can display it on the form(but it's ugly,if you have better solution please share). But I don't know how to get coordinates of that location.
StringBuilder queryAddress = new StringBuilder();
queryAddress.Append("http://maps.google.com/maps?q=");
queryAddress.Append(street + "," + "+");
queryAddress.Append(city);
webBrowser1.Navigate(queryAddress.ToString());
What you're looking for is known as Geocoding, getting coordinates based on address.
Google has a Geocoding API, which has a really nice documentation here.
I recommend you to read it thoroughly, and I will summarize the crux of the approach:
You can use Google's Geocoding API over HTTP(S) like this:
http://maps.googleapis.com/maps/api/geocode/outputFormat?parameters
where output is json/xml and paramaters can vary, but the simples form is address like in your example above and a mandatory Google's API key.
Example:
https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=YOUR_API_KEY
Related
I would like to be able to differentiate an address given by a user, by a point of interest.
For example, if I make an address reasearch with "Assemblée nationale" (which is a part of the parliament), I get a street called "assemblée nationale" in Versailles, instead of the parliament in Paris.
Of course, it works with the Point Of Interest research.
Is it possible with Azure Maps, to 'detect' that what the user inputs is an address or a point of interest ?
You can use Azure Maps fuzzy search API. You can check the "type" field for results in API response to see whether a search result is a POI or a street.
Here are the supported result type:
POI,
Street,
Geography,
Point Address,
Address Range,
Cross Street
I am working on a project where the users have to put in the physical address of their organization, in many cases users will put in a PO Box rather than their physical address. I need a way in C# to determine whether or not a user put in a P.O. Box or PO Box (or any other variation of this) rather 29 Maple Street style address. I have had a few thoughts, but I thought I would get some really great feedback here.
Thanks
I would try to parse the address as a string. Then find a 'P.O. Box' or 'PO Box' in the array: if it finds it, the PO BOX should be the next element(s).
You will also need a way to detect the city so you know when to stop. You could use google's geonames (http://www.geonames.org/) as a data base.
Does anybody know google provide the gmail mail Map this feature API. I researched a lot but didn't find desired result. I want the google API on which i give the string message like
BREA PROBLEM F:830 N MAIN ST 46, MT ANGEL:R454,
MED23:MAP-2530C:57YOF/ C/DIFFB BEE STING:BAVARIAN VILLAGE 503 845-2586::
and goole return me the result same as it user for Map this
830 N MAIN ST
MT ANGEL, OR
(http://maps.google.com/maps?q=830+N+MAIN+ST+MT+ANGEL,+OR&oi=gmail)
here is the image to understand my question
You should be able to use the Geocoding API to do this lookup. For example, performing the following query returns a json object with a "formatted_address" field containing the re-written address you're looking for. Of course you need to replace API_KEY with an API key from your Developer Console project.
https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=API_KEY
I have a database and every person has a location.
In this point, l need some sugesstions to show all the person's location in a single map.
To give an example,
X man = at y, X1 man = at z,X2 man = at q
y,z,q will be shown in a singe map?
start by reading this article:
Show Your Data on Google Map using C# and JavaScript
if you have more specific questions ask more details
i think it will helps you
The Google Maps API is accessed via JavaScript (any server controls are just abstracting this away from you). In the case you described, you would need to dynamically output the required JavaScript to tell the maps API what to display.
See http://dotnet.sys-con.com/node/171162
I am trying to make an automation application that basically send some keys to a textbox in a java application and, if possible, based on the text that is in the textbox. Also I would like to select a certain option for a combobox. Can someone direct me to the right path? some code, an example, anything...
thank you,
denis
hello i think you're looking something like this
"winApiHelper" is a class made by me that help me to implement Win Api's methods, take a look here http://msdn.microsoft.com/en-us/library/ms633539(v=vs.85).aspx
private void SendKeys()
//String sText , String sWindow
//alternate you can have a parameters
{
string stab = "{TAB}";
string skey = rtFilename.Text.Trim();
int iHandle = winApiHelper.FindWindow(null, cboWindows.Text.Trim());
winApiHelper.SetForegroundWindow(iHandle);
System.Windows.Forms.SendKeys.Send(skey.Trim() + stab.ToString().Trim());
}
First, java.awt.Robot allows you to emulate keyboard and mouse events. Unfortunately it works in absolute screen coordinates. Right now java does not have API that allows to access windows beyond current application.
But if you can find the absolute location of text box where you wish to write "hello, world" you can do it using Robot.
If you cannot get absolute coordinates you have to use other tools like JNI or JNA. Please see the following post for details: Windows: how to get a list of all visible windows?
Good luck1