ArcGIS Runtime不同於之前的AE、AO開發,大部分時候不用安裝任何程序,nuget包可以搞定
在未來可能數年里,會更新一系列ArcGIS Runtime WPF(.net C#)開發簡明教程,這是第一篇
首先創建一個wpf 項目,.net framework或core項目都是可以的
然后管理nuget包
其中
Esri.ArcGISRuntime.runtimes.win是一切的基礎,不需要手動安裝,裝其他的時候自動就安裝了
Esri.ArcGISRuntime 是 Esri.ArcGISRuntime.WPF的基礎,也不需要手動安裝
Esri.ArcGISRuntime.WPF 一般安裝這個就好了
Esri.ArcGISRuntime.LocalServices 需要本地地圖包處理時安裝
Esri.ArcGISRuntime.Toolkit 多了些小工具,有點用但非必要
xaml加入代碼(樣式自定義,這里不涉及)
命名空間
xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
一般拖進來個MapView就自動引用了
<Grid x:Name="MapView" > <esri:MapView x:Name="MyMapView" > <esri:Map> <esri:Map.Basemap> <esri:Basemap Name="Basemap"> <esri:ArcGISTiledLayer Name="WorldTopographic" Source="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/> </esri:Basemap> </esri:Map.Basemap> </esri:Map> </esri:MapView> </Grid>
后台初始化代碼
Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.Initialize();
運行就看得到地圖了