加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

flex4.7 在IE界面显示鼠标位置的经纬度坐标值

发布时间:2020-12-15 03:36:33 所属栏目:百科 来源:网络整理
导读:?xml version="1.0" encoding="utf-8"? !-- ?监听地图的鼠标移动事件,显示鼠标位置的坐标值 ?-- !-- Copyright (c) 2010-2011 《ArcGIS Server开发指南——基于Flex和.NET》练习代码 完整的代码工程可以从 http://www.geocommon.net 下载 ?-- s:Application
<?xml version="1.0" encoding="utf-8"?> <!-- ?监听地图的鼠标移动事件,显示鼠标位置的坐标值 ?--> <!-- Copyright (c) 2010-2011 《ArcGIS Server开发指南——基于Flex和.NET》练习代码 完整的代码工程可以从 http://www.geocommon.net 下载 ?--> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"? ? xmlns:s="library://ns.adobe.com/flex/spark"? ? xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="455" minHeight="300" xmlns:esri="http://www.esri.com/2008/ags"> <fx:Script> <![CDATA[ protected function mouseMoveHandler(event:MouseEvent):void { var lon:Number = map.toMapFromStage(event.stageX,event.stageY).x;? var lat:Number = map.toMapFromStage(event.stageX,event.stageY).y; labelX.text = "X: " + numFormater.format(lon); labelY.text = "Y: " + numFormater.format(lat); } ]]> </fx:Script> <fx:Declarations> <mx:NumberFormatter id="numFormater" precision="2" /> </fx:Declarations> <esri:Map id="map" mouseMove="mouseMoveHandler(event)"? ?scaleBarVisible="false" width="100%" height="100%"> <esri:ArcGISDynamicMapServiceLayer? url="http://localhost/ArcGIS/rest/services/Florida/MapServer" /> </esri:Map> <s:Label id="labelX" text="0" left="20" bottom="15" fontSize="15"/> <s:Label id="labelY" text="0" left="110" bottom="15" fontSize="15"/> </s:Application>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读