Mark map according to a search [closed]

-1

I have a json file with an array of various city points and I want to place the points on a map using a simple search engine.

With a text input that serves as a search engine so that when looking for the attribute "name" of the node "destination", and I want to place that element on a map. How could I do it?

I have made a map of images and to access each zone I want to access using the name attribute. I use getElementsByName("nombre") but I do not know in which way I could highlight the chosen area.

    
asked by gabriel gomez 24.05.2016 в 22:39
source

1 answer

0

You have to use the Geocoding resource of the Google Maps Api

https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=YOUR_API_KEY

With this you can get the positions in latitude and longitude of an address on the map in several levels of precision and some additional data, with that information you have to add a marker on the map, for each location and in case you want the map is centered in a specific place you should call the center method of the object that contains the map.

link

    
answered by 24.05.2016 / 22:59
source