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(); }
The scale will be whatever the map's spatial reference is set to
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); }
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); }
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); }
map.addEventListener(MouseEvent.MOUSE_WHEEL, map_mouseMoveHandler);
map.addEventListener(MouseEvent.MOUSE_MOVE, map_mouseMoveHandler);