Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Talk:Drawing shapes with Windows Phone maps API

From Wiki
Jump to: navigation, search

Andrés - Drawing issues for less than 65m

The function CreateCircle(GeoCoordinate center, double radius) Works great and gives me a circle that I can draw on a map **as long as the circle is over 80m in diameter**.

My problem is that if the circle is less than approximately (it varies) 70-90m in radius, it will not display at all when added to the Map (*). However, the problem is somehow on the CreateCircle function, because I am able to display rectangular shapes down to 3m wide without issue.

At the end, I had to modify my code so if the area/radius I need to draw is over 90m then use the CreateCircle function, otherwise, use a derivative of the CreateRectangle function above, which creates an 8-point diamond, sort of...

While debugging I checked the output of the CreateCircle function and did not see any evident problems; simply, the circle will not draw.

Btw, all the samples ARE great. Thanks.


(*) The sample code that makes use of this can be read at GitHub (https://github.com/nokia-developer/maps-samples/blob/master/MoreMapContent/MoreMapContent/MainPage.xaml.cs).

Andrés (talk) 06:07, 10 February 2014 (EET)

A.J.Bauer - MapPolygon not drawing

I was having the same issue with MapPolygon and finally found out that if points in the GeoCoordinateCollection are too close together then the MapPolygpn will not draw. In the code above, instead of:" locations.Add(new GeoCoordinate(ToDegrees(latRadians), ToDegrees(lngRadians)));" you could try something like:

double latTransDeg = ToDegrees(latRadians);
double lonTransDeg = ToDegrees(lonRadians);
bool nearlyTheSameGeoCoordinateFound = false;
 
foreach (GeoCoordinate gc in locations)
{
if (((long)(latTransDeg * 1000000) == (long)(gc.Latitude * 1000000)) &&
((long)(lonTransDeg * 1000000) == (long)(gc.Longitude * 1000000)))
{
nearlyTheSameGeoCoordinateFound = true;
break;
}
}
 
if (!nearlyTheSameGeoCoordinateFound)
{
locations.Add(new GeoCoordinate(latTransDeg , lonTransDeg );
}
You could also make the steps in (for (var x = 0; x <= 360; x=x+stepdependingonradius)) bigger if radius gets smaller..

A.J.Bauer (talk) 19:41, 21 March 2014 (EET)

 

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×