Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
I solved the problem by limiting the search radius. Here is the documentation for the getQueryPredictions Places API method, which mentions the request parameter, which passes the request object. This object can contain the location and radius parameters, with which we set the coordinates of the center of the circle and the radius of the circle inside which we will search. location - object of type LatLng, radius - numeric value in meters (maximum 50,000)
Below is my example, the center of Moscow is hardcoded. All similar search methods work similarly and accept these parameters.
service.getQueryPredictions({
input: text,
location: new google.maps.LatLng(55.751482, 37.619126),
radius: 50000
}, displaySuggestions);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question