AnsweredAssumed Answered

LocalMapService load .mpk map fail

Question asked by wangkun3877 on Jul 5, 2015
Latest reply on Sep 15, 2015 by FGibson-esristaff

map don't load mpk map. debug it only execute  await localMapService.StartAsync();  why?

 

code:

public async void CreateLocalServiceAndDynamicLayer()

        {

            try

            {

                LocalMapService localMapService = new LocalMapService(@"maps\water-distribution-network.mpk");

 

 

                await localMapService.StartAsync();

 

 

                ArcGISDynamicMapServiceLayer arcGISDynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer()

                {

                    ID = "arcGISDynamicMapServiceLayer",

                    ServiceUri = localMapService.UrlMapService,

                };

 

                MyMapView.Map.Layers.Add(arcGISDynamicMapServiceLayer);

            }

            catch (Exception ex)

            {

                MessageBox.Show(ex.Message);

            }

        }

Outcomes