I have a MapPolygon which covers a certain area on the Silverlight Bing Maps control,
and I would like to know if a particular Location is located within this MapPolygon.
I have tried the following code which doesen’t return the result I want because it only checks if the tested location is one of the vertices of the MapPolygon, and doesn’t check if this Location is contained within this MapPolygon.
polygon.Locations.Contains(new Location(this.Site.Latitude, this.Site.Longitude, this.Site.Altitude));
Is it also possible to determine if two MapPolygons intersect one another?
The polygon.Locations is a list of points defining the polygon.
You have to make a method to find if your point is inside the polygon.
Use something like this (not tested if compiles):
And call it like this: