This is a migrated thread and some comments may be shown as answers.

RadMap Small pin point and Detailed pinpoint overlap

1 Answer 118 Views
Map
This is a migrated thread and some comments may be shown as answers.
priya
Top achievements
Rank 1
priya asked on 27 Jul 2011, 01:23 PM
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

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 29 Jul 2011, 04:14 PM
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!

Tags
Map
Asked by
priya
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or