Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to retarget this PR to 4.3.0 and get it included in a service release? I'm finding it difficult to add a subclass of MapElement into custom renderers in 3rd party code. |
@jcmanke I'm afraid we don't add new API to service releases, but please rebase on 4.4.0! Thanks! |
formsPolyline.PropertyChanged -= MapElementPropertyChanged; | ||
} | ||
} | ||
_polylines?.ForEach(p => p.Remove()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.ForEach()
is not performant on Android. Can you find a way to write this with a for loop instead? Thanks!
_polylines?.ForEach(p => p.Remove()); | ||
_polylines = null; | ||
|
||
_polygons?.ForEach(p => p.Remove()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.ForEach()
is not performant on Android. Can you find a way to write this with a for loop instead? Thanks!
_polygons?.ForEach(p => p.Remove()); | ||
_polygons = null; | ||
|
||
_circles?.ForEach(c => c.Remove()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.ForEach()
is not performant on Android. Can you find a way to write this with a for loop instead? Thanks!
|
||
protected ACircle GetNativeCircle(Circle circle) | ||
{ | ||
return _circles?.Find(c => c.Id == (string)circle.MapElementId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.Find()
is not performant on Android. Can you find a way to write this with a for loop instead? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's funny because you told someone else to use .Find()
in this file a year ago. #3751 (comment)
I'll switch everything to loops.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is awesome. Yes, I will slowly but surely move all code to for
loops. 😂
…yUtils, made EarthRadiusKm internal
Looks like this missed the cut for 4.4.0... |
Any plan to develop colorized pins? |
Description of Change
Added a Circle MapElement to maps. On UWP, since there is no native circle overlay in Bing Maps, it is implemented as a 360-sided MapPolygon, borrowing from the Highlighting a Circular Area on a Map sample.
Also added GeographyUtils helper class and Distance.BetweenPoints method.
Issues Resolved
N/A
API Changes
Added:
public class Circle : MapElement
public static class GeographyUtils
public static Distance Distance.BetweenPositions(Position position1, Position position2)
protected virtual CircleOptions CreateCircleOptions(Circle circle)
protected ACircle GetNativeCircle(Circle circle)
protected Circle GetFormsCircle(ACircle circle)
protected virtual MKCircleRenderer GetViewForCircle(MKCircle mkCircle)
protected virtual MapPolygon LoadCircle(Circle circle)
Platforms Affected
Behavioral/Visual Changes
None
Before/After Screenshots
Not applicable
Testing Procedure
Use the MapElements page in the control gallery app and select Circle from the picker. Clicking the map will change the radius of the currently selected circle. When adding a new circle, the first click will set the center and the second click will set the radius.
PR Checklist