I'm using Google Maps API 3 for returning directions from user's input address (destination node) to a Store (predefined start node).
I ask for user's address (not geolocation but through a simple input field) but I wouldn't like the user to narrow their input by entering extra info like postcode, state, city. I just want to make the input of the user as little as possible, e.g. 123 Road street.
However, when I type an address with a common name (like 25 Main street), the route I get is possibly the first result that Google has available, even if it is 3000 miles away when the user's address could be 2 miles away.
I have read all Google's documentation in regards to Directions service but I couldn't find anything that relates to street suggestions. Do you know how I can serve suggestions to the user so that the start address would be the exact match of user's preference?
I'm afraid this is impossible to achieve without any detail for the real location of the user.
Of course you would be able to filter results(regardless of the used service) by the distance, but how could you know if the user is located at the nearest address...you can't.
A possible solution may be to use a places-autocomplete (i guess that's what you mean by "serve suggestions"), the user would be able to choose his location from the predictions.
Another approach:
Instead of a input-field you may let the user click on the map to mark his location
Related
I am creating links to Google Maps for a large number of locations using this URL pattern:
https://www.google.com/maps?q=[query]
In many cases, Google knows that the particular business exists at that location. In those cases, I want to include the place/business name in the query so the resulting map shows additional information about the business (e.g. name, phone numbers, site URL, office hours, etc.). For example:
https://maps.google.com/?q=Child+Guidance+Center,+Inc.+525+Cabrillo+Park+Dr+#300+Santa+Ana,+CA+92701
But, if the place isn't known, including the business name in the query prevents the map from adding a marker to the correct address. For example:
https://maps.google.com/?q=Awesome+Paint+527+Cabrillo+Park+Dr+Santa+Ana,+CA+92701
It can cause the map to be totally zoomed out, or focus on a competing business with a somewhat similar name in the same general area.
How can I make this work better? I would like the map pin to always go in the correct location for the address I specify. If the business name I provide is known to Google at that address, then I'd like the nice panel of extra information. If it is not known, I just want the pin.
Thank you.
This similar question is asking about creating embedded maps, which is a slightly different case Google map to show name of location if found, otherwise just the address. I'd prefer to avoid extensive use of the APIs because I'm worried about exceeding the free limit, but more generally geocoding the address that worked above (Child+Guidance+Center,+Inc.+525+Cabrillo+Park+Dr+#300+Santa+Ana,+CA+92701) returns zero results like so:
http://maps.googleapis.com/maps/api/geocode/json?address=Child+Guidance+Center,+Inc.+525+Cabrillo+Park+Dr+#300+Santa+Ana,+CA+92701
I have created one small application, where user can store his/her contacts with full address including map. Therefore I am using the Google Maps API, where user can point out his/her address.
For this I have given address fields with Country, State and City. When user entered this information, I am showing the default address on Google Maps, then the user has to drag the marker/pointer onto his/her exact location.
Now, in this case I want the zoom level of googles map to be set as per location's population.
This means if the user entered city with no mans land (less population or any desert place or any jungle place or very small area on city then zoom level should be more, so user can see proper area on map) otherwise zoom level should be less.
Can some one guide me how to do this?
This won't be possible using the Google API's alone, (I'm unsure if demographics info has been released for the US, I know it was in the works, but it certainly won't work elsewhere). You will have to find an external source to provide your demographics information for you.
The Google API's do not keep a public record of population density.
You could however be a but more tricksy and use an approximation. You could for example do a places search in the area (using an arbitrary radius), count the number of results and use this to set your zoom level (again using an arbitrary value to determine high/medium/low etc). It's a fair assumption (though still an assumption) that any area with a large number of 'places' returned will be densely populated.
You don't need to base this on the population of the location. Please check the follwing link. I think it should give you an idea of the options you have.
Google Maps API v3 - Geocoder results issue with bounds
Check both my question and my answer. You will probably want to use the viewport object.
Google Terms says I can only use reverse geocoding in conjunction with a google map.
Is it ok if you first see the address in a uitableviewcell and then on a click see the location in a map (is this "in conjunction") ?
Tried two other free services but they don't find all locations as it seems.
Edit
I see in an answer that I need to clarify
The app should get the current gps location first using CLLocationManager and this location (latt,long) should be translated into a street/city name and displayed on the cell.
Then, after getting a green/yellow light and a location description that fits the accuracy needs of the user, the user should normally click on the cell causing a map to load with stores of a certain company that are nearby. ("normally" because he could also hit another cell "Enter different location").
Caveat emptor I am not a lawyer and this advice is not a substitute for actual legal advice.
Assuming that when you click on the address, only then the address is reverse-geocoded, and the marker is displayed on the map, then yes, that would certainly count as "in conjunction" in my book.
I would like to store a user enter location and could do with some pointers on how to go about it.
Input - I wish to allow the user to enter a location using either a map (eg Google maps) or text input.
Storage - I believe it would make sense to store the location as the longitude and latitude.
Manipulation and Display - I'd like to display a name for a given longitude and latitude. I'd also like to search for all inputs from an arbitrary region eg London.
What libraries or packages (preferably Java, preferably free) can be used to help with this process?
The process of converting an address to a latitude/longitude pair is called geocoding. Doing the reverse process (lat/long to address) is called reverse geocoding.
The Google Maps API is capable of performing both these functions. However, note that there are service limits in place on the number and frequency of requests made to perform these functions. This means you'll want to implement some kind of caching mechanism for the results.
Doing a name search for a region I don't know about. The maps API may do this, but I haven't gone in enough depth with it to find out.
We're using the Google Maps API for an application to determine distance and driving directions for a set of addresses in a database. Overall, we're dealing with around a 1000 addresses and some have typos, abbreviations,... that are causing some problems with returning the proper address hit (lat/long).
For addresses that don't return a proper result, we are trying to drop parts of the address (i.e. just use Address and Zip, and not City, State). But we're finding that some of the results are waaaaay off (i.e. somewhere in Poland).
So, we're wondering if it's possible to qualify the address parts (i.e. address=1600 Pennsylvania Avenue&zipcode=49455) to avoid misinterpretation by Google maps. Anyone know if it's possible to do this?
I think you're stuck with just sending the string to google and dealing with what you get back. One thing you can do is use GClientGeocoder.setViewport() to specify a bounding box where your results should show up and/or use GClientGeocoder.setBaseCountryCode() to specify that your results should be in a specific country.
http://en.wikipedia.org/wiki/Garbage_In,_Garbage_Out "GIGO" is the rule when it comes to addresses.
Rather than trying to clean the list yourself, there are plenty of mailing list companies that will cleanup your address list for a fee.
They will correct addresses, and identify bogus addresses. They will also run your list through the post office's Forwarding database. That will give you the current addresses for your older data.
People and businesses move constantly.
Added--
If you have good zip codes, you can use them instead of the city, state. Just use "10 main st, 10045" as your input to Google. But you need to know that your zip codes are correct. (A mailing list company will handle that for you.)