I have a collection of mapshapes which mostly consists of mappolygons. I want to draw lines on the map only if the line does not intersect with another shape. For this purpose i am using the "IntersectWithLine" but when the line comes near the shape, even if they do not intersect the result is always true. Below is the code:
Location point = somevalue;
Location point1 = somevalue1;
foreach (var item in myLayer.Items)
{
LocationRect rect = (item as MapShape).GeographicalBounds;
if (rect.IntersectWithLine(point, point1))
{
//change the color of the shape that intersects with the line
(item as MapShape).Fill = new SolidColorBrush(Colors.Black);
}
}
What am i doing wrong?? Can you provide me a sample project?
Thanks
Location point = somevalue;
Location point1 = somevalue1;
foreach (var item in myLayer.Items)
{
LocationRect rect = (item as MapShape).GeographicalBounds;
if (rect.IntersectWithLine(point, point1))
{
//change the color of the shape that intersects with the line
(item as MapShape).Fill = new SolidColorBrush(Colors.Black);
}
}
What am i doing wrong?? Can you provide me a sample project?
Thanks