Need MapPolygonModel from IMapShape

Thread is closed for posting
2 posts, 0 answers
  1. aaron
    aaron avatar
    1 posts
    Member since:
    Sep 2015

    Posted 02 Sep 2015 Link to this post

    I am trying to get the location points from a single shape that I am pulling from a layer of the Map control. I am using the following code to get the shape I want:

     var shape = WorkspaceSpaces.Source.Shapes.Where(s => s.GetAttribute("ID").ToString().Equals("1")).FirstOrDefault();

     This returns an IMapShape which does not have what I need, when I debug the code I can see that it appears to be using an internal class MapPolygonModel which contains the locations​ I need. 


    What I am trying to do is draw a new pushpin on top of this location. I am unable to use the tooltip because I will need to have multiple pushpins dropped at once and they are shown programatically not from a users interacting with the map.


    Any help would be great!

  2. Rosy Topchiyska
    Rosy Topchiyska avatar
    586 posts

    Posted 07 Sep 2015 Link to this post

    Hi Aaron,

    Thank you for contacting us.

    The MapPolygonModel implements the IMap2DShape interface which is public and defines the Locations property:
    var shape = WorkspaceSpaces.Source.Shapes.Where(s => s.GetAttribute("ID").ToString().Equals("1")).FirstOrDefault();
    if (shape != null)
        var locations = (shape as IMap2DShape).Locations;

    I hope this helps.

    Rosy Topchiyska
    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 Feedback Portal and vote to affect the priority of the items
Back to Top