Problem with mapZoomBar

2 posts, 0 answers
  1. Adrien
    Adrien avatar
    3 posts
    Member since:
    May 2011

    Posted 07 Jun 2011 Link to this post


    I try to do this :

    <telerik:RadMap x:Name="radMap"
           <telerik:MapZoomBarPresetsSettings WorldLevel="Level 1"
                                               StateLevel="Level 2"
                                               RegionLevel="Level 3"
                                               CityLevel="Level 4"
                                               NeighborhoodLevel="Level 5" />

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

    So how can I customize this control? 

  2. Andrey
    Andrey avatar
    1681 posts

    Posted 09 Jun 2011 Link to this post

    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()

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

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

    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.

    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
  3. DevCraft R3 2016 release webinar banner
Back to Top