arcgis for javascript显示鼠标经过的经纬度
varuEzMap;dojo.require("esri.map");functioninit(){varmyMap=newesri.Map("mapDiv");varm...
var uEzMap ;
dojo.require("esri.map");
function init() {
var myMap = new esri.Map("mapDiv");
var myTiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("自己发布的地图rest接口");
myMap.addLayer(myTiledMapServiceLayer);
uEzMap.addMapEventListener(EzEvent.MAP_MOUSEMOVE, function (e)
{
document.getElementById("coordiate").innerHTML = "X:" + e.mapPoint.x + " Y:" + e.mapPoint.y;
});
}
dojo.addOnLoad(init);
</script>
</head>
<body class="tundra">
<table style="width:100%; ">
<tr>
<td><div id="mapDiv" style="width:1880px; height:940px; border:1px solid #000;"></div>
</td>
</tr>
<tr>
<td><label id="coordiate"> sdfsfssfs </label> <td>
</tr>
</table>
</body>
</html>
如何在lable中显示鼠标经过的经纬度,新手求解答! 展开
dojo.require("esri.map");
function init() {
var myMap = new esri.Map("mapDiv");
var myTiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("自己发布的地图rest接口");
myMap.addLayer(myTiledMapServiceLayer);
uEzMap.addMapEventListener(EzEvent.MAP_MOUSEMOVE, function (e)
{
document.getElementById("coordiate").innerHTML = "X:" + e.mapPoint.x + " Y:" + e.mapPoint.y;
});
}
dojo.addOnLoad(init);
</script>
</head>
<body class="tundra">
<table style="width:100%; ">
<tr>
<td><div id="mapDiv" style="width:1880px; height:940px; border:1px solid #000;"></div>
</td>
</tr>
<tr>
<td><label id="coordiate"> sdfsfssfs </label> <td>
</tr>
</table>
</body>
</html>
如何在lable中显示鼠标经过的经纬度,新手求解答! 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏50(财富值+成长值)
展开全部
map.on("mouse-move", function(e){
console.log(e.mapPoint.x);
});
console.log(e.mapPoint.x);
});
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询