Talk:Drawing shapes with Windows Phone maps API
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).
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;
locations.Add(new GeoCoordinate(latTransDeg , lonTransDeg );
talk) 19:41, 21 March 2014 (EET)(