ArcGISRuntime.UWP.Samples.AuthorMap.AuthorMap.ApplyBasemap C# (CSharp) Method

ApplyBasemap() private method

private ApplyBasemap ( string basemapName ) : void
basemapName string
return void
        private void ApplyBasemap(string basemapName)
        {
            // Get the current map
            Map myMap = MyMapView.Map;

            // Set the basemap for the map according to the user's choice in the list box
            switch (basemapName)
            {
                case "Light Gray":
                    // Set the basemap to Light Gray Canvas
                    myMap.Basemap = Basemap.CreateLightGrayCanvas();
                    break;
                case "Topographic":
                    // Set the basemap to Topographic
                    myMap.Basemap = Basemap.CreateTopographic();
                    break;
                case "Streets":
                    // Set the basemap to Streets
                    myMap.Basemap = Basemap.CreateStreets();
                    break;
                case "Imagery":
                    // Set the basemap to Imagery
                    myMap.Basemap = Basemap.CreateImagery();
                    break;
                case "Ocean":
                    // Set the basemap to Oceans
                    myMap.Basemap = Basemap.CreateOceans();
                    break;
                default:
                    break;
            }
        }