Dynamic maps in Google Maps

Asked

Viewed 853 times

0

I have a system where people put their addresses. I would like to know how to pick up an address and make it appear on the maps. Do you understand? Each person in the system will have a page where a map will appear with a mark on the place where the person lives.

Thanks for the help.

1 answer

1


Yes, and are basically two steps, the first is to get the geographical coordinates of the address, for this you can use a geolocation service of the google itself, you can know more at this address: https://developers.google.com/maps/documentation/geocoding/? hl=en

With the address coordinates on hand, simply add a new marker to the map.

If the map has many markers, I recommend you use the geolocation service to take the data and save it in bank, because using the service every time you display an address is costly.

  • I will not put more than one tag on one map. Each user profile will have a single map with a tag

  • i understood pretty much everything, just did not understand how to display the data in json format on google maps, understood?

  • You will use the latitude and longitude values returned in the localiton key in Geometry, something more or less Results[0].geometry.Location.lat and Results[0].geometry.Location.lng. You use these values to create markers.

  • This I understood, but in what format should I use these values? In json format and placed directly inside the script or step the values by parameter? I didn’t get how to syntax.

  • Here is a link with an example of how to use the API and how to use the query result. https://developers.google.com/maps/documentation/javascript/examples/geocoding-simple?hl=pt-br

  • to facilitate my work of picking an address, sending to the site that converts into coordinates and make the coordinates return to the codes that generate the map, I decided to copy the entire site that generates the coordinates. However, I want the site to generate the coordinates without having to click the Serach button on the page, how could I do that? Phallus of that website http://universimmedia.pagesperso-orange.fr/geo/loc.htm

  • Guys, I’m trying to put this div, but it doesn’t show up on my page. Do you have a problem if the page is in php? <div id="Googlemap" style="width:500px; height:380px;"></div>

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.