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

panning range and zoom range

6 Answers 97 Views
Map
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 1
Christopher asked on 26 Aug 2010, 06:18 AM
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

6 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 27 Aug 2010, 09:19 AM
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
0
hayula
Top achievements
Rank 1
answered on 11 Oct 2010, 09:58 AM
I'm interested to know when it will be fixed. Because I want to limited the ZoomLevel.
 thanks,
0
Andrey
Telerik team
answered on 13 Oct 2010, 01:01 PM
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
0
hayula
Top achievements
Rank 1
answered on 13 Oct 2010, 02:00 PM
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 ?
0
Andrey
Telerik team
answered on 15 Oct 2010, 07:25 AM
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
0
Christopher
Top achievements
Rank 1
answered on 09 Nov 2010, 07:47 PM
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();

 

}

}

Tags
Map
Asked by
Christopher
Top achievements
Rank 1
Answers by
Andrey
Telerik team
hayula
Top achievements
Rank 1
Christopher
Top achievements
Rank 1
Share this question
or