Retrieving of coordinates from google maps and search [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this questionI know there is a way to retrieve the coordinates by clicking on the map, using specifically document.getElementById("lonTb").value=point.x; document.getElementById("latTb").value=point.y;
Firstly, i have a html file namely MapToolKit.html, a mapGPS.js and a mapSearch.js.
how do i input the coordinates returns into the js? I just need to be able to click the map for coordinates, not neccessary the search returns. Here's the file which i uploaded. http://www.mediafire.com/?0minqx开发者_如何学编程gwzmx
Use GEvent.addListener
var long;
var lat;
GEvent.addListener(map,"click", function(overlay,latlng) {
long = latlng.lng();
lat = latlng.lat();
});
this will put the longitude in the long
variable and the latitude in lat
variable
精彩评论