Beispiel #1
0
        /// <summary>
        /// Loads the mobile map package and the map
        /// </summary>
        /// <returns>Async task</returns>
        internal async Task InitializeAsync()
        {
            // Get Mobile Map Package from the location on device
            var mmpk = await this.LoadMMPKAsync().ConfigureAwait(false);

            // Display map from the mmpk. Assumption is made that the first map of the mmpk is the one used
            this.Map = mmpk.Maps.FirstOrDefault();

            // Sets a basemap from ArcGIS Online if specified
            // Replace basemap with any online basemap
            if (AppSettings.CurrentSettings.UseOnlineBasemap)
            {
                var basemap = Basemap.CreateLightGrayCanvasVector();
                this.Map.Basemap = basemap;
            }

            // Load map
            await Map.LoadAsync().ConfigureAwait(false);

            // Get the locator to be used in the app
            var locator = mmpk.LocatorTask;
            await locator.LoadAsync().ConfigureAwait(false);

            // Create instance of the Location View Model
            if (LocationViewModel.Instance == null)
            {
                LocationViewModel.Instance = LocationViewModel.Create(Map, locator);
            }

            // Set viewpoint of the map depending on user's setting
            await this.SetInitialViewPointAsync().ConfigureAwait(false);
        }
Beispiel #2
0
        /// <summary>
        /// Loads the mobile map package and the map
        /// </summary>
        /// <returns>Async task</returns>
        internal async Task InitializeAsync()
        {
            // Get Mobile Map Package from the location on device
            var mmpk = await this.LoadMMPKAsync().ConfigureAwait(false);

            // Display map from the mmpk. Assumption is made that the first map of the mmpk is the one used
            this.Map = mmpk.Maps.FirstOrDefault();
            await Map.LoadAsync().ConfigureAwait(false);

            // Get the locator to be used in the app
            var locator = mmpk.LocatorTask;
            await locator.LoadAsync().ConfigureAwait(false);

            // Create instance of the Location View Model
            if (LocationViewModel.Instance == null)
            {
                LocationViewModel.Instance = LocationViewModel.Create(Map, locator);
            }

            // Set viewpoint of the map depending on user's setting
            await this.SetInitialViewPointAsync().ConfigureAwait(false);
        }