您的位置:首页 > 其它

ArcGIS Viewer for Flex加载地图服务

2013-05-07 15:45 447 查看
1 建立flex项目将ArcGIS Viewer for Flex API加载到libs文件夹下(agslib-3.2-2013-03-19.swc),并在项目-属性-flex构建路径-库路径中将其添加进去



2 定义坐标系

<fx:Declarations>
<!-- 4326为经纬度坐标系,12100为投影坐标系 -->
<esri:SpatialReference id="sr" wkid="4326" />
</fx:Declarations>


3 绘制地图

<esri:Map crosshairVisible="true" width="100%" height="100%" id="EsriMap">

<!-- 加载已有的地图服务 -->
<esri:ArcGISTiledMapServiceLayer
url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>

<!-- 定义图层 -->
<esri:GraphicsLayer id="EsriGraphicsLayer" spatialReference="{sr}" />

<!-- 锁定初始的地图位置,当前为武汉,坐标系为4326(经纬度坐标系) -->
<esri:extent>
<esri:Extent id="mapExtent" xmin="112.00" ymin="29.50" xmax="116.50" ymax="31.65" />
</esri:extent>

</esri:Map>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐