4 ms·
Help Needed : Let visitors plot location on Google Map
I am developing a web application where I need to provide a feature that allows users to plot their own location on Google Map and then the location coordinates is saved in a database.
I am new to Google Map API and tried to go through official documentation but was unable to find the required information. Can anyone here help me with this thing?
- cd34 16y agoThe important piece in the html: GDownloadUrl("http://site.com/earth/data.xml", function(data) { var xml = GXml.parse(data); var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); map.addOverlay(createMarker(point,markers[i].getAttribute("nickname"))); } }); the xml: <markers> <marker lat="42.732812" lng="-78.74724" nickname="user"/> <marker lat="42.764659" lng="-078.84687" nickname="user"/> <marker lat="26.153" lng="-80.1115" nickname="user"/> <marker lat="55" lng="-55" nickname="user"/> <marker lat="49" lng="-45" nickname="user"/> <marker lat="42.0769" lng="-70.8534" nickname="user"/> <marker lat="32.363" lng="-90.726" nickname="user"/> </markers>