But I think it's useful to read out the information
Is this a bug of a missed property or an undocumented change in the 3.0 api.
<?xml version="1.0" encoding="utf-8"?> <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" xmlns:esri="http://www.esri.com/2008/ags"> <s:layout> <s:VerticalLayout /> </s:layout> <fx:Script> <![CDATA[ import com.esri.ags.layers.ArcGISDynamicMapServiceLayer; import com.esri.ags.layers.Layer; import mx.collections.ArrayCollection; import mx.controls.Alert; protected function button1_clickHandler(event:MouseEvent):void { var layer:Layer = getMapFirstLayer(); if (layer != null) { var message:String = ""; if (layer is ArcGISTiledMapServiceLayer) { message = "Map units are: '" + ArcGISTiledMapServiceLayer(layer).units + "' - the first loaded layer units"; } else if (layer is ArcGISDynamicMapServiceLayer) { message = "Map units are: '" + ArcGISDynamicMapServiceLayer(layer).units + "' - the first loaded layer units"; } Alert.show(message, "Map units"); } } private function getMapFirstLayer():Layer { if (map != null) { var mapLayers:ArrayCollection = map.layers as ArrayCollection; if (mapLayers != null && mapLayers.length > 0) { return mapLayers.getItemAt(0) as Layer; } } return null; } ]]> </fx:Script> <s:Button label="Show map units" click="button1_clickHandler(event)" /> <esri:Map id="map"> <esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/> </esri:Map> </s:Application>
Your version is on: beta1 2011-12-16
it's also missed in the library itself
protected function onWidgetOpen(event:Event):void { Alert.show("Map units are: '" + map.units + "'", "onWidgetOpen"); }
map.units
units property units:StringThe units of the Map. These units are used for calculating the map scale. The default value is the units of the first layer added to the map.This property can be used as the source for data binding.
map.units = Units.METERS;
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.