This is a migrated thread and some comments may be shown as answers.

RadMap Switching MapMode from CommandBar

1 Answer 60 Views
Map
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 17 Jan 2020, 12:42 PM

My provider is set to BingRestMapProvider and set in the initialization with a MapMode.RoadOnDemand. Map shows the correctly. However when I use the MapCommand Bar to switch to Aerial it goes to MapMode.Aerial and when I go back to Road it goes to MapRoad.Road. I need to use both RoadOnDemand and AerialOnDemand all of the time. 

I've tried setting the Mode property of my provider on the OnLayOutUpdated event but it only works 80% of the time.

 

1 Answer, 1 is accepted

Sort by
0
James
Top achievements
Rank 1
answered on 17 Jan 2020, 03:33 PM

I've solved my problem. 

The CanvasLight, CanvasDark, CanvasGray, AerialOnDemand, RoadOnDemand are not added to the toolbar of the control by default. To add them to the map view mode commands bar, you can use the RegisterSetSourceCommand() method of BingRestMapProvider.

Example 2: Adding CanvasGray mode to the view mode commands bar
C#
public MainWindow(){InitializeComponent();this.bingRestMapProvider.RegisterSetSourceCommand(MapMode.CanvasGray, LocalizationManager.GetString("MapCanvasGrayCommand"));}

Tags
Map
Asked by
James
Top achievements
Rank 1
Answers by
James
Top achievements
Rank 1
Share this question
or