我要在点击地图时做标记

时间:2019-06-14 04:30:26

标签: jquery jquery-gmap3

我想在地图上的点击位置上有一个标记。 我应该写什么

当我制作地图时,点击警报“嗨”,但我无法做出标记。

$$(document).on('deviceready', function() {
    $('.map-object').gmap3({
        map:{
            options:{
                center:[37.292591, 127.055334],
                zoom:15,
                mapTypeId: google.maps.MapTypeId.ROADMAP,
                mapTypeControl: true,
                navigationControl: true,
                scrollwheel: true,
                streetViewControl: true
            },
            events:{
                click: function(event){
                    alert("hi");
                }
            }
        },
        marker:{
            values: [
                [37.549674, 126.983466],
            ],
            options:{
                draggable: true
            },
            events:{
                click: function(){
                    alert("Here is the default click event");
                }
            },
        }
    });
});

0 个答案:

没有答案
相关问题