How to control MapPinPoint's text display or not

2 posts, 0 answers
  1. Jimmy
    Jimmy avatar
    24 posts
    Member since:
    Nov 2006

    Posted 03 May 2012 Link to this post

    I am going to add some MapPinPoint to the RadMap, these MapPinPoint contains image and text,I would like to display the MapPinPoint text in a specific zoom, other times only display the image.I tried to control this in ZoomChanged event, but no attribute can control the Text display or not, only can set the text assignment empty
    private void RadMapZoomChanged(object sender, EventArgs e)
                if (radMap.ZoomLevel >= 13 && radMap.ZoomLevel < 22)
                    SPBack.Visibility = Visibility.Visible;
    foreach (MapPinPoint point in Layer.Items)
                        point.Text = point.Tag;

                    SPBack.Visibility = Visibility.Collapsed;
                    foreach (MapPinPoint point in Layer.Items)
                        point.Text = "";
    How should I do if to achieve this function?
  2. Andrey
    Andrey avatar
    1681 posts

    Posted 08 May 2012 Link to this post

    Hi Jimmy,

    Unfortunately the MapPinPoint does not contain the functionality like you need. I would recommend to use a custom template for your data items. You can add necessary property in your data item class to allow changing a visibility of the text. For more information about Data Binding feature you can take a look at the following documentation topic and online example:

    Also the information layer supports using of the item template selector. It contains the AllowDataTemplateForZoomLevel property. When you set it to "true" then it allows using different templates for different zoom levels on the map.
    I have attached a sample solution which implements this approach.

    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top