RadMap Small pin point and Detailed pinpoint overlap

2 posts, 0 answers
  1. priya
    priya avatar
    10 posts
    Member since:
    May 2011

    Posted 27 Jul 2011 Link to this post

    Hi,

    I have a radmap and i have small pinpoints which on clicking shows up a detailed pint point.
    The detailed pin point when open has the other neighbouring smaller pin points over lapping this and hiding the details.
    I have attached a screenshot which shows the scenario.

    Please help me with an example.Very critical.

    Thanks,
    Priya
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 29 Jul 2011 Link to this post

    Hello Priya,

    You can use the Canvas.ZIndex property to display the item on the top of the other points. This property should be assigned to the ContentPresenter instance which is used as a cover for the control on the information layer. You can get it using the GetVisualParent extension. The sample code is below.
    using System;
    using System.Collections.ObjectModel;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Input;
    using Telerik.Windows.Controls;
    using Telerik.Windows.Controls.Map;
     
    namespace ExpandedPinPoints
    {
        public partial class MainPage : UserControl
        {
            private int zIndex = 0;
     
            public MainPage()
            {
                InitializeComponent();
     
                this.radMap.InitializeCompleted += new EventHandler(radMap_InitializeCompleted);
            }
     
            private void radMap_InitializeCompleted(object sender, EventArgs e)
            {
                var collection = new Collection<DataPoint>();
                collection.Add(new DataPoint()
                {
                    Location = new Location(40, -100),
                    Title="POI 1",
                    Description="Can be here."
                });
                collection.Add(new DataPoint()
                {
                    Location = new Location(40.2, -100),
                    Title = "POI 2",
                    Description = "Can be here 2."
                });
     
                this.informationLayer.ItemsSource = collection;
            }
     
            private void ParentRoot_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
            {
                var templateRoot = sender as FrameworkElement;
                if (templateRoot != null)
                {
                    var small = templateRoot.FindName("small") as FrameworkElement;
                    var big = templateRoot.FindName("big") as FrameworkElement;
                    if (small != null && big != null)
                    {
                        var presenter = templateRoot.GetVisualParent<ContentPresenter>();
                        if (small.Visibility == System.Windows.Visibility.Visible)
                        {
                            Canvas.SetZIndex(presenter, ++zIndex);
                            small.Visibility = System.Windows.Visibility.Collapsed;
                            big.Visibility = System.Windows.Visibility.Visible;
     
                        }
                        else
                        {
                            Canvas.SetZIndex(presenter, 0);
                            small.Visibility = System.Windows.Visibility.Visible;
                            big.Visibility = System.Windows.Visibility.Collapsed;
                        }
                    }
     
                    e.Handled = true;
                }
            }
        }
    }

    Regards,
    Andrey Murzov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
Back to Top