1 定义以4326坐标系定位的地图
1 <esri:SpatialReference id="lo" wkid="4326" /> 2 3 <esri:Map crosshairVisible="true" width="100%" height="100%" id="myMap" logoVisible="false"> 4 <esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/> 5 6 <esri:GraphicsLayer id="EsriGraphicsLayer" spatialReference="{lo}" /> 7 8 <!-- 武汉视图 --> 9 <esri:extent> 10 <esri:Extent id="mapExtent" xmin="112.00" ymin="29.50" xmax="116.50" ymax="31.65" /> 11 </esri:extent> 12 </esri:Map>
2 转换方法
1 public function init():void{ 2 //4326坐标转换为12100 3 var geoExtent:Extent = WebMercatorUtil.geographicToWebMercator(myMap.extent) as Extent; 4 myMap.extent = geoExtent; 5 }