In Google Maps, I can type in 'Eiffel Tower' and it will present the correct location/Place. But using the Places Library with Maps API, it seems that you must always provide a nearby location when searching. You can't search for 'Eiffel Tower', it has to be 'Eiffel Tower' and you have to provide coordinates for 'Paris, France' as well. Is there any way to achieve an API experience closer to the regular Google Maps experience?
UPDATE:
If I search with the regular Maps API Geocoder, 'Eiffel Tower' does in fact return the correct address. But if I search Geocoder with 'Madison Square Garden', I receive completely unrelated locations. This is despite the fact that the Google Maps website does immediately identify 'Madison Square Garden' correctly.
Summary: It seems that the Places Library cannot search Places without a nearby Location provided. Additionally, Geocoder can sometimes search for famous places but not other times. Results do not seem to correspond to the Google Maps website results.
When you search in Google Maps, you ARE providing a "nearby" location. It uses the center/bounds of the current map view. Searching for a place without context wouldn't be very helpful.
Related
Trying to mimic the 'what's here' feature of Google Maps in my own website but it seems that items of type 'natural_feature' are excluded from Google Maps 3 API geocoding and places searches, both nearby and radar, and also on text searches unless the EXACT name of the place is provided. This must have been an informed choice by Google to do this - anyone know the rationale, and better, offer a workaround? Seems crazy that I can't get the names of woods, nature reserves etc. any more...
Found out how to do it! If you get a geocoding API key from Google you can get all the data for natural features included in the JSON/XML response from a server request like the following (I was trying to get the data for "Gamsey Wood"):
https://maps.googleapis.com/maps/api/geocode/json?latlng=52.4180698,-0.2029999&result_type=natural_feature&key=YOUR_GOOGLE_GEO_KEY
Happy days!
I am new to Google Maps API and I have a requirement to integrate Google Maps API with an ASP.Net application. Is there a Google service where in I can input a UK postcode and radius as input parameters and get results only, without the map.
For example if I search for solicitors in a particular area like Z1 1XY (not real post code) with a radius of 5 mi, can I get the results of all solicitors with the postcodes 5 mile radius? Is there any service that would return the result set only? I know GeoCoding does something similar but can I provide radius as one of the input parameter and get results.
Any help would be appreciated. Thanks in advance.
Seaton
The Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map is prohibited. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions.
Source: https://developers.google.com/maps/documentation/geocoding/#Limits
yes, you can use the Google Geocoding API to do address lookups (in this case postcodes). The response contains lat/lon co-ordinates which you can then subsequently use as the epicenter of your search to find items within a radius. Have a look at this blog post on how to use the DbGeography in .NET to perform radius queries based on lat/lon co-ordinates.
I have successfully used Google Places Api and was able to retrieve business establishments (shops) given a latlongbound and a keyword. But I cant stop wondering why it returns lesser shops than when you go to maps.google.com and type the keyword. Google Places does not even return those with a name and icon drawn on the map itself.
I want to retrieve a json with a similar result when typing a keyword on maps.google.com and I don't really mind if Google Places is not used.
Sounds like you may have additional filtering preventing you from querying all the results. Make sure you aren't restricting the 'bounds' or 'region' around your lat/long.
https://developers.google.com/maps/documentation/geocoding/
Good luck!
I have the same question posted here: How do I search using the Google Maps API?. They mentioned the answer helped, but I still couldn't figure it out. Does anyone have an example of it working or can post the code?
I can get it to work seperately, find your geolocation and also search for restaurants (by typing in coordinates); but I can't seem to combine it into one map that finds your geolocation and then searches for nearest items based on your geolocation. Any ideas on how to make that happen on one map? Or I'd settle for 2 pages, if someone knows how to pass the variables of your geolocation to another page/map to search for restaurants.
i want to get ONLY the road name in google maps not exact address, using either the geocoder or the directions service.i tried this results[0].address_components[1].long_name but it returns several different names (not necesserily wrong) on the same road.
You need to do a reverse geocode lookup on the location. Google provide this: http://code.google.com/apis/maps/documentation/geocoding/
Read more here: http://en.wikipedia.org/wiki/Reverse_geocoding