arcgis JavaScript API 点击地图,获取点击的Point(x,y)
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏25(财富值+成长值)
1个回答
展开全部
<esri:Tool
ClientAction="setupCustomTool('%toolbarItem%');"
JavaScriptFile="" Name="ClientTest" />
<script type="text/javascript">
var map;
var mapID = 'Map1';
function clickHandler(inputGeometry) {
alert ('You clicked ' +
inputGeometry.get_x() + ', ' +
inputGeometry.get_y());
}
function setupCustomTool(name) {
map = $find(mapID);
map.set_mouseMode(ESRI.ADF.UI.MouseMode.Custom);
if (name == 'ClientTest') {
map.getGeometry(
ESRI.ADF.Graphics.ShapeType.Point,
clickHandler,
null,
null,
null,
'pointer',
true);
}
}
</script>
ClientAction="setupCustomTool('%toolbarItem%');"
JavaScriptFile="" Name="ClientTest" />
<script type="text/javascript">
var map;
var mapID = 'Map1';
function clickHandler(inputGeometry) {
alert ('You clicked ' +
inputGeometry.get_x() + ', ' +
inputGeometry.get_y());
}
function setupCustomTool(name) {
map = $find(mapID);
map.set_mouseMode(ESRI.ADF.UI.MouseMode.Custom);
if (name == 'ClientTest') {
map.getGeometry(
ESRI.ADF.Graphics.ShapeType.Point,
clickHandler,
null,
null,
null,
'pointer',
true);
}
}
</script>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询