将事件添加到地图时将其添加到图钉

时间:2019-06-24 03:54:21

标签: javascript bing-maps

我正在尝试通过Pushpin模块将事件添加到DrawingTools中。

未调用Pushpin事件。

这是我到目前为止尝试过的:

Microsoft.Maps.loadModule("Microsoft.Maps.DrawingTools", function () {

    var tools = new Microsoft.Maps.DrawingTools(map);

    tools.showDrawingManager(function (manager) {
        drawingManager = manager;

        Microsoft.Maps.Events.addHandler(manager, "drawingEnded", function (e) {
            if (e instanceof Microsoft.Maps.Pushpin) {

                // THIS IS CALLED....
                console.log(e);

                Microsoft.Maps.Events.addHandler(e, "mouseover", function () {

                    // THIS IS NOT CALLED...
                    console.log("hi");
                });
            }
        });
    });
});

0 个答案:

没有答案