Set UIElement at GPS area

2 posts, 0 answers
  1. JR
    JR avatar
    6 posts
    Member since:
    May 2008

    Posted 15 May 2010 Link to this post


    I would like to add a UIElement at a certain GPS area. For example add an the coat of arms image of Moscow over the city itself. Thus when i zoom in the map the image will become bigger and when i zoom out it will downsize. As far as i know it's possible to add a UIElement at a sertain aria. Here is the example code:

    InformationLayer layer = new InformationLayer();
    Rectangle rect = new Rectangle() { Width = 100, Height = 80, Fill = new SolidColorBrush(Colors.Black) };
    InformationLayer.SetGeographicalSize(rect, new Location(55, 37));

    Thus the rectangle is positioned with it's top left corner being exactly at (55,37). When i drag the map the rectangle remains where it should be. But when i zoom in it's size doesn't grow and when i zoom out it doesn't shrink. Is there a way to set that rectangle over a whole area? For example Microsoft's MapControl  a MapLayer.SetPositionRectangle(rect, boundingRectangle);

    Thanks alot.
  2. Ves
    Ves avatar
    2870 posts

    Posted 19 May 2010 Link to this post

    Hello JR,

    You can add map shapes to the InformationLayer in RadMap, here is an example:

    <telerik:RadMap x:Name="radMap1"  ZoomLevel="12" Center="37.684297,-122.06924">
                <telerik:InformationLayer Name="informationLayer1">
                    <telerik:MapRectangle Location="37.684297,-122.06924"
                                           StrokeThickness="2" />

    private string VEKey = "<your_key_goes_here>";
            public Example()
                this.Loaded += new RoutedEventHandler(MainPage_Loaded);
            private void MainPage_Loaded(object sender, RoutedEventArgs e)
                BingMapProvider provider = new BingMapProvider(MapMode.Aerial, true, this.VEKey);
                this.radMap1.Provider = provider;
                MapRectangle rectangle = new MapRectangle()
                    Location = new Location(37.684297, -122.06924),
                    Width = 1,
                    Height = 1,
                    RadiusX = 0.1,
                    RadiusY = 0.1,
                    Fill = new SolidColorBrush(Color.FromArgb(127, 255, 255, 0)),
                    Stroke = new SolidColorBrush(Colors.Red),
                    StrokeThickness = 2

    You can find more details about map shapes in this help topic.

    Best regards,
    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
Back to Top