Composite MapShape and custom MapShape

5 posts, 0 answers
  1. Markus
    Markus avatar
    10 posts
    Member since:
    Aug 2010

    Posted 27 Aug 2012 Link to this post

    Hello there,

    I am currently developing a mapping application with WPF radmap for my company.
    Therefore I have a question:

    I have multiple arrows (WPF path shape) for which I also have locations in Lat/Lon.
    I want to show these arrows on an InformationLayer, which works fine by just using MapLayer.SetLocation and InformationLayer's Items property.
    My problem is now that I have a set of arrow-sets (imagine a list of tours and each tour has a set of direction arrows) and I need a 1to1 relation between objects on the information layer and my model (e.g. if a tour is deleted i want to remove the corresponding polyline and the corresponding arrows).
    Is there any kind of CompositeMapShape which can have arbitrary WPF FrameworkElements (all of them have their own MapLayer location) as children?

    Best regards,
    Markus
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 30 Aug 2012 Link to this post

    Hello Markus,

    Unfortunately RadMap does not contain control like CompositeMapShape.However I suggest that you use two information layers, one for polyline and second for arrows to achieve this.
    I have attached a sample solution which uses a similar approach.
    I hope it helps.

    All the best,
    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Markus
    Markus avatar
    10 posts
    Member since:
    Aug 2010

    Posted 03 Sep 2012 Link to this post

    Hello Andrey,

    thanks for your answer. I think I will do it that way. But there is one more question:
    Since my tour arrows are standard WPF elements I have to use the static method MapLayer.SetLocation on them.
    I am wondering if this would result in a memory leak (I assume MapLayer has a static member holding the references to the WPF elements).
    If so - is it possible to release the elements, e.g. with something like MapLayer.Release?

    Best regards,
       Markus
  5. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 05 Sep 2012 Link to this post

    Hi Markus,

    The MapLayer doesn't have a static member holding the references to the WPF elements. This is a standard implementation of the attachable dependency property.

    Greetings,
    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Markus
    Markus avatar
    10 posts
    Member since:
    Aug 2010

    Posted 05 Sep 2012 Link to this post

    Hi Andrey,

    thanks - that's good to know.

    Best regards,
    Markus
Back to Top
UI for WPF is Visual Studio 2017 Ready