map_pkg = new ArcGISLocalDynamicMapServiceLayer("C:\Users\Me\foo.mpk"); map_pkg.EnableDynamicLayers = true; map.Layers.Add(map_pkg);
public MainWindow() { InitializeComponent(); LocalMapService localMapService = new LocalMapService(@..\Maps_and_Data\Map.mpk) { MaxRecords=1000000 }; localMapService.StartAsync(localServiceCallback => { if (localServiceCallback.Error != null) { // Do something with Error return; } ArcGISDynamicMapServiceLayer localDynamicLayer = new ArcGISLocalDynamicMapServiceLayer(localMapService); localDynamicLayer.Initialized += localDynamicLayer_Initialized; localDynamicLayer.InitializationFailed += localDynamicLayer_InitializationFailed; MyMap.Layers.Add(localDynamicLayer); }); } void localDynamicLayer_InitializationFailed(object sender, System.EventArgs e) { } void localDynamicLayer_Initialized(object sender, System.EventArgs e) { }
map_pkg.Initialized += (s, e) => { CheckLayers(); };
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.