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

Need MapPolygonModel from IMapShape

1 Answer 49 Views
Map
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
aaron
Top achievements
Rank 1
aaron asked on 02 Sep 2015, 04:36 PM

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!

1 Answer, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 07 Sep 2015, 01:07 PM
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.

Regards,
Rosy Topchiyska
Telerik
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
Tags
Map
Asked by
aaron
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Share this question
or