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

Problem with mapZoomBar

1 Answer 47 Views
Map
This is a migrated thread and some comments may be shown as answers.
Adrien
Top achievements
Rank 1
Adrien asked on 07 Jun 2011, 08:58 AM
Hello,

I try to do this :

<telerik:RadMap x:Name="radMap"
               Width="600"
               Height="480">
   <telerik:RadMap.ZoomBarPresetsSettings>
       <telerik:MapZoomBarPresetsSettings WorldLevel="Level 1"
                                           StateLevel="Level 2"
                                           RegionLevel="Level 3"
                                           CityLevel="Level 4"
                                           NeighborhoodLevel="Level 5" />
   </telerik:RadMap.ZoomBarPresetsSettings>
</telerik:RadMap>

but when I'm building my project zoom levels are: -world
                                                                    -state
                                                                        -.....

So how can I customize this control? 

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 09 Jun 2011, 09:41 AM
Hi Adrien,

The ZoomBarPresetsSettings property is obsolete since Q1 2011. You should use the Command.Text property for the corresponding zoom level command in the RadMap.MapZoomBar.Commands collection.
The sample code is below.

public MainPage()
{
    InitializeComponent();

    
this.radMap.InitializeCompleted += new EventHandler(radMap_InitializeCompleted);
}

private
const int WorldLevel = 0;
private const int StateLevel = 1;
private const int RegionLevel = 2;
private const int CityLevel = 3;
private const int NeighborhoodLevel = 4;

private
void radMap_InitializeCompleted(object sender, EventArgs e)
{
    MapZoomBar zoomBar = this.radMap.MapZoomBar;

    
(zoomBar.Commands[WorldLevel].Command as RoutedUICommand).Text = "Level 1";
    (zoomBar.Commands[StateLevel].Command as RoutedUICommand).Text = "Level 2";
    (zoomBar.Commands[RegionLevel].Command as RoutedUICommand).Text = "Level 3";
    (zoomBar.Commands[CityLevel].Command as RoutedUICommand).Text = "Level 4";
    (zoomBar.Commands[NeighborhoodLevel].Command as RoutedUICommand).Text = "Level 5";
}

Hope this helps.


Regards,
Andrey Murzov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Map
Asked by
Adrien
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or