Topic: Google api autocomplete, how to limit the search range to a country
I have a script that I complete with places entered in a text field, but I need the results you give me to be limited to a country or a city, I hope you can help me.
You are not logged in. Please login or register.
Infinity Code Forum → Online Maps Help → Google api autocomplete, how to limit the search range to a country
I have a script that I complete with places entered in a text field, but I need the results you give me to be limited to a country or a city, I hope you can help me.
Hello.
The "component" parameter can restrict the request to a country.
Unfortunately, I don't know how to directly restrict the request to a city, but you can specify the coordinates and radius of the search.
http://infinity-code.com/doxygen/online … d4952c3836
Hello, thank you very much, that helped me a lot, I have another question, I have a script that traces a route to a specific point, now I need to delete that route to draw another, How could I delete that route to draw a new one? thank you very much
Hello, I was able to delete the drawn path, but what was not possible was to delete the marker, I need to delete the last of the marker array, but I do not know how to access that array
Hello.
You have direct access to the marker array (OnlineMaps.markers).
http://infinity-code.com/doxygen/online … d037143575
Or you can delete the marker using OnlineMaps.RemoveMarkerAt.
http://infinity-code.com/doxygen/online … 8a86acd860
But it is much more correct is store a reference to the marker in your script.
In this case, you will always have quick access to the marker, you can change the location and other properties, or remove the marker.
The problem is that in my script I add a marker every time I draw a route, but I need to delete the route and the previous marker, the route can already be deleted, but the marker does not, with the instruction ".RemoveMarkerAt" I delete the marker according to its position in the array General of makers, but at the beginning there is only one marker, which is my position, so I need a way to know first if there is more than one marker, or know how many markers there are in total, and with that, The first with index 0
int totalMarkers = OnlineMaps.instance.markers.Length;Thank you very much, that's what i was looking for.
Infinity Code Forum → Online Maps Help → Google api autocomplete, how to limit the search range to a country
Powered by PunBB, supported by Informer Technologies, Inc.