Microsoft.Maps.Events.addHandler(map, "mousemove", function (e) {
// get the HTML DOM Element that represents the Map
var mapElem = map.getRootElement();
if (e.targetType === "map") {
// Mouse is over Map
mapElem.style.cursor = "crosshair";
} else {
// Mouse is over Pushpin, Polyline, Polygon
mapElem.style.cursor = "pointer";
}
});

本文介绍了一种使用Microsoft Maps API来改变鼠标悬停在地图元素上时的光标样式的实现方法。当鼠标悬停在地图上时,光标会变成十字准星样式;而当鼠标悬停在地图上的标记、折线或多边形上时,光标则会变成手型指针样式。

被折叠的 条评论
为什么被折叠?



