Z-order pinpoints

5 posts, 0 answers
  1. ABECON Groep BV
    ABECON Groep BV avatar
    28 posts
    Member since:
    Apr 2007

    Posted 15 Mar 2010 Link to this post

    Hello,

    Im trying to load 200 items into a map control but they are over each other.
    I want to change the z-index when i hover an item to get it on top.

    Is there a way to do that?

    Thanks for your help

    Marcel de Groot
    Abecon



  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 17 Mar 2010 Link to this post

    Hi Marcel,

    You can use the Canvas.SetZIndex method to highlight the pin point. The following sample code uses the MouseEnter event to set z-index:
    private void AddPinpoint(MapPinPoint pinPoint)
    {
        pinPoint.MouseEnter += this.MapPinPoint_MouseEnter;
        informationLayer.Items.Add(pinPoint);
    }
    private int lastIndex = 0;
    private void MapPinPoint_MouseEnter(object sender, MouseEventArgs e)
    {
        UIElement element = sender as UIElement;
        if (element != null)
        {
            Canvas.SetZIndex(element, ++lastIndex);
        }
    }

    Sincerely yours,
    Andrey Murzov
    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
  4. ABECON Groep BV
    ABECON Groep BV avatar
    28 posts
    Member since:
    Apr 2007

    Posted 17 Mar 2010 Link to this post

    Thanks for your response!
    It works great!

    Marcel de Groot
    Abecon
  5. Pete
    Pete avatar
    67 posts
    Member since:
    Sep 2012

    Posted 01 Jul 2011 Link to this post

    I have the same problem but my information layers are databound (Itemsource property is bound to a collection of objects).
    Is there a way to achieve this (preferably in an MVVM way)?
    Thanks
  6. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 06 Jul 2011 Link to this post

    Hi Xamlmax,

    This post is more than 1 year old. Since this post we have changed the architecture of the information layer completely. The ZIndex is attachable property of the Canvas element. The InformationLayer does not use Canvas, so ZIndex is not supported. The only way to bring some element to front of others is put it to the end of the collection which is items source for the information layer.

    Greetings,
    Andrey Murzov
    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
Back to Top
DevCraft banner