Getting coordinates from Google maps and search

I know that there is a way to get the coordinates by clicking on the map using specially. Document.getElementById ("lonTb") value = point.x; . Document.getElementById ("latTb") value = point.y;

Firstly, I have an html file, namely MapToolKit.html, mapGPS.js and mapSearch.js.

how can i enter the coordinates in js? I just need to be able to click on the map for coordinates, it is not necessary that the search return. Here is the file that I downloaded. http://www.mediafire.com/?0minqxgwzmx

+3
source share
1 answer

Use GEvent.addListener


var long;
var lat;
GEvent.addListener(map,"click", function(overlay,latlng) {
  long = latlng.lng();
  lat = latlng.lat();
});

long lat

0

Source: https://habr.com/ru/post/1746109/


All Articles