Focus map center on zoom

7 posts, 0 answers
  1. figueiredorj
    figueiredorj avatar
    68 posts
    Member since:
    Mar 2011

    Posted 27 May 2011 Link to this post

    Hi all.

    I have a very begging question that somehow I am not able to solve/understand.
    When we zoom (in or out) on map (provider bing) although we have set a center location, this location is changed on zoom.

    An example:
    I have set a MapPinPoint on map; now no matter zoom I do, the center of map is always this pin.

    Does anyone knows how to achieve this?

    Thanks in advance



  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 01 Jun 2011 Link to this post

    Hi figueiredorj,

    It is the default behavior for the map control. When you change a zoom level using the mouse wheel, then the zooming is performed according to the current position of the mouse pointer (zoom to point).

    You can disable this functionality to keep the center of map on your MapPinPoint. Also you can specify the MouseClickMode, MouseDoubleClickMode, MouseDragMode and NavigationVisibility properties to avoid changing the center of map.

    <telerik:RadMap x:Name="radMap"
                    Center="40,-100"
                    IsMouseWheelZoomEnabled="False"
                    MouseClickMode="None"
                    MouseDoubleClickMode="None"
                    MouseDragMode="None"
                    NavigationVisibility="Collapsed"
                    ZoomLevel="3">
    </telerik:RadMap>

    All the best,
    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 banner
  4. figueiredorj
    figueiredorj avatar
    68 posts
    Member since:
    Mar 2011

    Posted 01 Jun 2011 Link to this post

    First of all thanks for answering me

    It is not quite what I would like to do.
    I understand that  on mouse wheel action it zooms in or out on the pointer pixel; what I would like to achieve is on mouse wheel to zoom in or out based on center pixel of drawing.

    Can you help me on this?

    Thanks again
  5. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 03 Jun 2011 Link to this post

    Hi figueiredorj,

    Unfortunately this mode is not supported in the current version of the RadMap control. We are planning to add it in the future releases. You can check its availability using our PITS:

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

    All the best,
    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. Was
    Was avatar
    16 posts
    Member since:
    Dec 2012

    Posted 03 Jun 2013 Link to this post

    Hi Andrey, is the problem described in this subject solved? Can i disable centering without disabling mouse zooming?
  7. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 04 Jun 2013 Link to this post

    Hello Was,

    Yes, this feature is available. You can use the following settings for disabling the centering without disabling of zooming using the mouse:
    <telerik:RadMap x:Name="radMap"
                    Center="40,-100"
                    MouseWheelMode="ZoomToCenter"
                    MouseClickMode="None"
                    MouseDoubleClickMode="ZoomToCenter"
                    MouseDragMode="None"
                    NavigationVisibility="Collapsed"
                    MiniMapExpanderVisibility="Collapsed"
                    ZoomLevel="3">
    </telerik:RadMap>

    Regards,
    Andrey Murzov
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  8. Was
    Was avatar
    16 posts
    Member since:
    Dec 2012

    Posted 04 Jun 2013 Link to this post

    Thanks a lot! This works great!
Back to Top
DevCraft banner