-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle line color and geometry #776
Handle line color and geometry #776
Conversation
…upport hex color strings for lines Solves flutter-mapbox-gl#762 by interpreting and setting geometry on the line, allowing to programmatically move lines
@felix-ht I see that fill also doesn't interpret geometry when updating so moving the fill layer doesn't seem to work for me on iOS. |
@AAverin doing the same for fills would be a good idea as well |
|
||
if let geometry = options["geometry"] as? [[Double]], geometry.count > 0 { | ||
var coordinates: [CLLocationCoordinate2D] = [] | ||
class func getCoordinates(options: Any?) -> [CLLocationCoordinate2D] { |
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.
rename this to something like getLineCoordinates
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.
I was wondering if same code can be later reused for other annotations like Circle or Fill. But you're right, in this PR getLineCoordinates
probably makes more sense
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.
hmm it could be indeed be reused for polygons (not for circles or symbols tho) so the name is probably fine!
|
||
if let geometry = options["geometry"] as? [[Double]], geometry.count > 0 { | ||
var coordinates: [CLLocationCoordinate2D] = [] | ||
class func getCoordinates(options: Any?) -> [CLLocationCoordinate2D] { |
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.
hmm it could be indeed be reused for polygons (not for circles or symbols tho) so the name is probably fine!
https: //github.com/flutter-mapbox-gl/maps/pull/776 Co-Authored-By: Anton Averin <1481332+AAverin@users.noreply.github.com>
Cherry-pick upstream#776 https: //github.com/flutter-mapbox-gl/maps/pull/776 Co-Authored-By: Anton Averin <1481332+AAverin@users.noreply.github.com>
Solves #448 by using Color.parseColor to correctly support hex color strings for lines
Solves #762 by interpreting and setting geometry on the line, allowing to programmatically move lines