-1

我是谷歌地图编程的新手,我想:

  • 添加图钉 onclick

  • 获取点击的点位置

另外,我想用 javascript(&jquery) 编写代码

事实上,这是我的意思的一个例子

http://www.gorissen.info/Pierre/maps/googleMapLocation.php

那么,任何人都可以向我提供有关如何编码的信息吗?亲切的问候!

4

1 回答 1

3

GEvent is Maps API 2 which is deprecated. You should be using Maps API 3 instead (especially if you're starting out 'new' and not having to maintain an old API 2 site). And when you do, something like this should work:

google.maps.event.addListener(map, 'click', function(event) {
    var marker = new google.maps.Marker({
        position: event.latLng,
        map: map
    });
});
于 2012-05-04T12:42:58.183 回答