ArcGIS Runtime添加地图

在用xamarin开发的时候,用到了ArcGISRuntime类。
xml文件的引用:xmlns:esri="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms"
资源:(官网链接)

 <esri:MapView x:Name="MainMapView"  >
                        </esri:MapView>

在加载地图的时候有很多种选择。除了加载地图,还可以加载很多东西。像shapefile文件,kml文件,在地图上可以加载很多种数据。当然地图可以加载离线的还可以加载在线的地图。
比如在xaml文件中添加动态地图服务图层

<esri:ArcGISDynamicMapServiceLayer ID="Hurricanes" 
    ServiceUri="http://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer"/>

还可以添加要素图层

<esri:FeatureLayer ID="PoolPermits">
   <esri:FeatureLayer.FeatureTable>
     <esri:ServiceFeatureTable Where="has_pool = 1 AND pool_permit = 0" 
      ServiceUri="http://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer/0" />
   </esri:FeatureLayer.FeatureTable>
 </esri:FeatureLayer>

在ArcGISRuntime100.4中,图层分为两种角色。
1.底图。2.操作的图层
里面可以加的图层,在官网上有充分的描述(链接)。

在实际开发中,我们经常用到,加载标绘,自己在上面画地物,用到GraphicsOverLayer.这种图层里面可以放置各种地物。

_PloteOverlay = new GraphicsOverlay();
MainMapView.GraphicsOverlays.Add(_ploteOverlay);

猜你喜欢

转载自blog.csdn.net/qq_36196748/article/details/88639119