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.
我有一张使用 api v3 的地图...当有人点击地图时,我需要将点击地点的位置保存在数据库中,并在地图上添加标记。
您可以在此处阅读 Google 地图文档。
您正在寻找的是绑定到地图的click事件。这是一个例子:
click
google.maps.event.addListener(map, 'click', function(event) { placeMarker(event.latLng); });