开发者

Retrieving of coordinates from google maps and search [closed]

开发者 https://www.devze.com 2022-12-31 18:42 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this
Closed. This question needs to be more focused. It is not currently accepting answers.

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 question

I 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

0

精彩评论

暂无评论...
验证码 换一张
取 消