Latitude, Longitude Grabber

前端 未结 4 2099
没有蜡笔的小新
没有蜡笔的小新 2020-12-10 17:04

What I would like to do is create app where when anyone clicks on the map object and two fields get filled with latitude and longitude at every click. Is there sample code o

4条回答
  •  天命终不由人
    2020-12-10 17:44

    var map = [google map];
    
    google.maps.event.addListener(map, 'click', function (mouseEvent) {
        alert(mouseEvent.latLng.toUrlValue());
    });
    

提交回复
热议问题