How to set the telerik:MapLayer.Location property for a FrameworkElement in code-behind?

2 posts, 1 answers
  1. Mrn
    Mrn avatar
    29 posts
    Member since:
    Apr 2011

    Posted 29 Aug 2011 Link to this post


    I'd like to add a set of images I create dynamically in code behind to an InformationLayer that is already defined in XAML, but I don't know how can I set its properties related to MapLayer when I create them in code behind (MapLayer.Location, ZoomRange and BaseZoomLevel)... how could I do so?

  2. Answer
    Andrey avatar
    1681 posts

    Posted 01 Sep 2011 Link to this post

    Hello Mrn,

    You can use the appropriate static methods of the MapLayer class. The sample code is below.
    MapLayer.SetLocation(frameworkElement, new Location(40, -100));
    MapLayer.SetBaseZoomLevel(frameworkElement, 8);
    MapLayer.SetZoomRange(frameworkElement, new ZoomRange(8, 11));

    Andrey Murzov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top