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.

Re: Google api autocomplete, how to limit the search range to a country

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

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Google api autocomplete, how to limit the search range to a country

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

Re: Google api autocomplete, how to limit the search range to a country

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

Re: Google api autocomplete, how to limit the search range to a country

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.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Google api autocomplete, how to limit the search range to a country

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

Re: Google api autocomplete, how to limit the search range to a country

int totalMarkers = OnlineMaps.instance.markers.Length;
Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Google api autocomplete, how to limit the search range to a country

Thank you very much, that's what i was looking for.