private string GetMapStyleSheetName(MapStyleSheet styleSheet) { if (styleSheet == MapStyleSheet.Aerial()) { return("Aerial"); } else if (styleSheet == MapStyleSheet.AerialWithOverlay()) { return("AerialWithOverlay"); } else if (styleSheet == MapStyleSheet.RoadDark()) { return("RoadDark"); } else if (styleSheet == MapStyleSheet.RoadLight()) { return("RoadLight"); } else if (styleSheet == MapStyleSheet.RoadHighContrastDark()) { return("RoadHighContrastDark"); } else if (styleSheet == MapStyleSheet.RoadHighContrastLight()) { return("RoadHighContrastLight"); } else { return("Custom"); } }
private void AreaMapControl_OnLoaded(object sender, RoutedEventArgs e) { AreaMapControl.ZoomLevel = 14; AreaMapControl.Style = MapStyle.Road; AreaMapControl.MapProjection = MapProjection.WebMercator; AreaMapControl.StyleSheet = MapStyleSheet.RoadLight(); }
private void SetMapStyleSheet() { switch (setDefaultStyleCombobox.SelectedIndex) { case 0: myMap.StyleSheet = MapStyleSheet.Aerial(); break; case 1: myMap.StyleSheet = MapStyleSheet.AerialWithOverlay(); break; case 2: myMap.StyleSheet = MapStyleSheet.RoadDark(); break; case 3: myMap.StyleSheet = MapStyleSheet.RoadLight(); break; case 4: myMap.StyleSheet = MapStyleSheet.RoadHighContrastDark(); break; case 5: myMap.StyleSheet = MapStyleSheet.RoadHighContrastLight(); break; case 6: myMap.StyleSheet = MapStyleSheet.ParseFromJson(@" { ""version"": ""1.0"", ""settings"": { ""landColor"": ""#FFFFFF"", ""spaceColor"": ""#000000"" }, ""elements"": { ""mapElement"": { ""labelColor"": ""#000000"", ""labelOutlineColor"": ""#FFFFFF"" }, ""water"": { ""fillColor"": ""#DDDDDD"" }, ""area"": { ""fillColor"": ""#EEEEEE"" }, ""political"": { ""borderStrokeColor"": ""#CCCCCC"", ""borderOutlineColor"": ""#00000000"" } } } "); break; } }
private void SetMapMode(MapStyle mode) { if (this.mapStyle != mode) { this.mapStyle = mode; var stylesheet = (mode == MapStyle.Road) ? MapStyleSheet.RoadLight() : MapStyleSheet.AerialWithOverlay(); this.map.StyleSheet = stylesheet; this.NotifyPropertyChanged(nameof(IsSymbolicMap)); } }
//Función que establece el mapa con mapas 2D según el valor de su combo private void click_MapaNormal(object sender, RoutedEventArgs e) { switch (combo2d.SelectedIndex) { case 0: MapControl.StyleSheet = MapStyleSheet.Aerial(); break; case 1: MapControl.StyleSheet = MapStyleSheet.RoadDark(); break; case 2: MapControl.StyleSheet = MapStyleSheet.RoadLight(); break; } }
private async void MyMap_Loaded(object sender, RoutedEventArgs e) { myMap.Center = MainPage.SeattleGeopoint; myMap.ZoomLevel = 16; // Specify a style sheet. It is not strictly necessary to Combine since RoadLight is the default. var myStyleSheetFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///StyleSheets/MyCustomStates.json")); string myStyleSheetJson = await FileIO.ReadTextAsync(myStyleSheetFile); myMap.StyleSheet = MapStyleSheet.Combine(new MapStyleSheet[] { MapStyleSheet.RoadLight(), MapStyleSheet.ParseFromJson(myStyleSheetJson) }); // Populate various layers containing points and connect up states to events. AddLayer1(); AddLayer2(); // Connect the layers to the map. myMap.Layers = this.myLayers; }