Use Google Places autocomplete vs nearbysearch with rankby=distannce
Asked Answered
D

0

6

I am looking to use Google Places autocomplete to help user search for places near him/her. When using autocomplete in the example below, I get establishment that are very far from the location.

https://maps.googleapis.com/maps/api/place/autocomplete/json?input=pizza&types=establishment&location=37.340871,%20-122.029642&rankby=distance&key=mykey

I assume Google considers the popularity of the establishment in the result set. My question: is there a way to get back the list sorted by proximity to the location, i.e. "turn off" the popularity index? (and to get similar functionality to the nearbysearch with autocomplete) ?

Why not just using nearbysearch? because nearbysearch does not perform well when only part of the name is entered as keyword ( I assume nearbysearch assume the 'keyword' parameter is the complete word).

Thanks for your help!

Dianoia answered 4/12, 2014 at 8:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.