在用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);