Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试构建一个非常有用的网络服务,并希望简化使用谷歌地图的地点选择。是否有可能通过单击地图获得经度和纬度并将其写下来以输入标签?
这是我将如何做到这一点:
var map = ...; google.maps.event.addListener(map, 'click', function (event) { $('input.latitude').val(event.latLng.lat()); $('input.longitude').val(event.latLng.lng()); });