panning range and zoom range

7 posts, 0 answers
  1. Christopher
    Christopher avatar
    12 posts
    Member since:
    Jul 2008

    Posted 26 Aug 2010 Link to this post

    Is there a way to set a panning range for left, right, bottom and top.  I want to restrict a user to only pan to the edge of the map and not off the map.  Also, is there a way to restrict on how far a user can zoom down or up.  I instantiated the event handlers for zooming and panning  but wondering if there is an easier way to set a range.

    void

     

     

    RadMap1PanningFinished(object sender, RoutedEventArgs e)

     

    {
        // TODO: Check if center is within panning range?

     

    }

     

     

    void RadMap1ZoomChanged(object sender, EventArgs e)

     

    {

     

     

        if (this.RadMap1.ZoomLevel > 6)

     

     

     

            this.RadMap1.ZoomLevel = 6;

     

     

     

        if (this.RadMap1.ZoomLevel < 3)

     

     

     

            this.RadMap1.ZoomLevel = 3;

     

    }



    Please let me know. Thanks
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 27 Aug 2010 Link to this post

    Hi Christopher,

    Unfortunately, there is no other way to limit zooming and panning in the current version of the RadMap control. This feature is planned for the future releases.

    Best wishes,
    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. UI for WPF is Visual Studio 2017 Ready
  4. hayula
    hayula avatar
    8 posts
    Member since:
    Apr 2009

    Posted 11 Oct 2010 Link to this post

    I'm interested to know when it will be fixed. Because I want to limited the ZoomLevel.
     thanks,
  5. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 13 Oct 2010 Link to this post

    Hello Hayula,

    Unfortunately these features aren't highly demanded and will not be included to the 2010.Q3 release. You can check its availability using our PITS:

    http://www.telerik.com/support/pits.aspx#/public/silverlight/3713

    Kind 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
  6. hayula
    hayula avatar
    8 posts
    Member since:
    Apr 2009

    Posted 13 Oct 2010 Link to this post

    Hi,
    I succeeded to do this partially with RadMap.Provider.MinZoomLevel and RadMap.Provider.MaxZoomLevel .
    but now my problem is only with the zoom slider that it is longer than my range.
    will it be fixed in the next releases ?
  7. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 15 Oct 2010 Link to this post

    Hi hayula,

    Yes, it will be fixed, but I am afraid, not in the 2010.Q3 release. You can check its availability using our PITS:

    http://www.telerik.com/support/pits.aspx#/public/silverlight/3713

    Best wishes,
    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
  8. Christopher
    Christopher avatar
    12 posts
    Member since:
    Jul 2008

    Posted 09 Nov 2010 Link to this post

    If you want to limit the zoom levels on your zoom slider, you can create a custom control class that inherits the MapZoomBar like below--

    public

     

     

    class CustomMapZoomBar : MapZoomBar

     

    {

     

     

    public bool isTemplateUpdated;

     

     

     

    public override void OnApplyTemplate()

     

    {

     

     

    if (!this.isTemplateUpdated)

     

    {

     

     

    this.isTemplateUpdated = true;

     

     

     

    var slider = this.GetTemplateChild("PART_ZoomSlider") as RadSlider;

     

     

     

    if (slider != null)

     

    {

     

     

    //slider.TickFrequency = 0.5;

     

    slider.Minimum = 2;

    slider.Maximum = 4;

    }

     

     

    var btnZoom = this.GetTemplateChild("PART_MapNavigationDropDown") as RadDropDownButton;

     

     

     

    if(btnZoom != null)

     

    {

    btnZoom.ClickMode =

     

    ClickMode.Press;

     

    }

    }

     

     

    base.OnApplyTemplate();

     

    }

    }

Back to Top
UI for WPF is Visual Studio 2017 Ready