Jamal, You can not use this code change if you are only using the ArcGIS Viewer Application Builder. When you use the App Builder or the compiled Flex Viewer you are ONLY configuring the application though XML changes. When people in these forums talk about code changes they are speaking of using the AGS Viewer for Flex source code and some Flex IDE, like Flash Builder.Robert
Daniel, Try this in the CoordinateWidget.mxml private function map_mouseMoveHandler(event:MouseEvent):void { const mapPoint:MapPoint = map.toMapFromStage(event.stageX, event.stageY); coords.text = m_func(mapPoint) + " Scale 1:" + map.scale.toString(); }
private function map_mouseMoveHandler(event:MouseEvent):void { const mapPoint:MapPoint = map.toMapFromStage(event.stageX, event.stageY); coords.text = m_func(mapPoint) + " Scale 1:" + map.scale.toString(); }
Daniel, Sure something like this: private function map_mouseMoveHandler(event:MouseEvent):void { const mapPoint:MapPoint = map.toMapFromStage(event.stageX, event.stageY); coords.text = m_func(mapPoint) + " Scale 1:" + String(map.scale * 3.2808398950131235); }I can never remember if the right calculation is multiple or divide though.:o
private function map_mouseMoveHandler(event:MouseEvent):void { const mapPoint:MapPoint = map.toMapFromStage(event.stageX, event.stageY); coords.text = m_func(mapPoint) + " Scale 1:" + String(map.scale * 3.2808398950131235); }
Is it possible to force the scale on the Coordinates widget to the same scale on the LODs on the Navigation widget?Thanks
include this code:map.addEventListener(MouseEvent.MOUSE_WHEEL, map_mouseMoveHandler);directly under this line:map.addEventListener(MouseEvent.MOUSE_MOVE, map_mouseMoveHandler);and the scale will refresh when you zoom in and out. Otherwise it is possible to zoom in and out and not have the scale refresh until you actually move the mouse pointer....
map.addEventListener(MouseEvent.MOUSE_WHEEL, map_mouseMoveHandler);
map.addEventListener(MouseEvent.MOUSE_MOVE, map_mouseMoveHandler);
map.addEventListener(MouseEvent.DOUBLE_CLICK, map_mouseMoveHandler);
Is there anyway to display MGRS (Military Grid Reference System) at the bottom instead of DMS/mercator?
private function substitute(mapPoint:MapPoint):String [LEFT]{ var nf2:NumberFormatter = new NumberFormatter(); nf2.precision = 2; return StringUtil.substitute(m_template, nf2.format(mapPoint.x), nf2.format(mapPoint.y)); } [/LEFT]
Steve, Just add a numberformatter. private function map_mouseMoveHandler(event:MouseEvent):void { var nf:NumberFormatter = new NumberFormatter(); nf.precision = 2; const mapPoint:MapPoint = map.toMapFromStage(event.stageX, event.stageY); coords.text = m_func(mapPoint) + " Scale 1:" + nf.format(map.scale * 3.2808398950131235); }
private function map_mouseMoveHandler(event:MouseEvent):void { var nf:NumberFormatter = new NumberFormatter(); nf.precision = 2; const mapPoint:MapPoint = map.toMapFromStage(event.stageX, event.stageY); coords.text = m_func(mapPoint) + " Scale 1:" + nf.format(map.scale * 3.2808398950131235); }
The scale will be whatever the map's spatial reference is set to
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.