We have observed the issue that a Google Place ID changes the location it is pointing to. Is this the expected behavior that a PlaceID my point to a different location after a certain time period?
On 14th March, using Google Maps API, we fetched the PlaceID for a UK Postcode SW46LP. This PlaceID used to access the place details associated withe it. However, now this is returning a different address.
For additional context, we use the https://maps.googleapis.com/maps/api/place/findplacefromtext
to get the placeId for a postcode.
The documentations says that PlaceIDs may change over time. developers.google.com/maps/documentation/javascript/place-id
Is there any way to identify if a certain PlaceID is expiring?
You should expect to refresh stored Place IDs at least every 12 months. https://developers.google.com/maps/documentation/javascript/place-id#refresh-id
Related
If a placeId for a particular place gets removed, does Google ever allow that placeId to be re-used for different place? Does that placeId ever go into the list of available placeIds that Google can use to assign to other places in the future or it's just used once and that's it?
I've read this: Does Google ever remove a place from it's API or re-use the placeId? and all it's told me is that if a place is using a particular placeId, no other place could use that same placeId. My question relates to if that placeId gets deleted, does Google allow that placeId to be used for other locations.
No. Once a Place ID is deleted, it cannot be reused.
We're using the Google Places autocomplete API feature and finding that our use case isn't working as expected.
In Australia, it is common for a postcode to have many suburbs attached to it.
When searching by postcode 2300:
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=2300&types=(regions)&components=country:au&key=blah
We only get back one result, Bar Beach. But instead, there are many suburbs that belong to postcode 2300, as can be seen here:
http://auspost.com.au/postcode/2300
Ideally we'd like the user experience to be that typing 2300 returns all the suburbs associated so that the user can pick the exact one, especially as they all have different bounding boxes.
Is this possible with the Googe Places Autocomplete API?
So, I've got a fully working address locator that can be seen here:
http://www.hwca.com/offices/?location=Wigan&lat=53.5450645&long=-2.6325074
I've tried several town / postcodes and they work fine however if you enter 'Launceston' it suddenly doesn't recognize that specific place.
Checking the network tab on devtools shows that only non-uk addresses are returned on this search but I am certain there is a valid UK location with that name..I've put a filter so that only UK locations are shown hence no results are displayed if only non-UK locations are returned
but on http://maps.google.com the place Launceston returns a valid UK location so it's definitely a valid location.
any ideas what can be done?
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
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.