Integrate My Maps with Google Map on your site and make places searchable

I was wondering how to integrate one of the "My Maps" into the site. I know that there is an embed option, but the idea was not only to use all the places that I added there, but also to make them searchable (using the search box, I think).

Thank you in advance


Update: this is found, but I want it to work with My Maps. Ideas?

+4
source share
2 answers

I would suggest using the Google Maps API. It offers much more flexibility than MyMaps.

Google Maps API Family: http://code.google.com/apis/maps/index.html

In particular, you may be interested in: http://code.google.com/apis/maps/documentation/javascript/

Using this requires a bit of JavaScript knowledge, but it is not too complicated.

Developer Guide: http://code.google.com/apis/maps/documentation/javascript/basics.html Tutorial: http://code.google.com/apis/maps/documentation/javascript/tutorial.html

Hope this helps.

+3
source

You need to execute a bit of scripts on the server side to make them searchable

First, you need to determine your center of the map. Then add markers / location to the map and save their server lat / lng values. When someone enters a zip code / zip code, you need to use the Google Maps geocoding API service to get the lat / lng value of the entered value, use it as the center and then calculate the distance using the haversin formula to show the nearest locations.

Geocoding API Link

Haversine Link Formula

thanks

+1
source

All Articles