Skip to content
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

Merged
merged 4 commits into from
Nov 20, 2021

Conversation

AAverin
Copy link
Contributor

@AAverin AAverin commented Nov 18, 2021

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

…upport hex color strings for lines

Solves flutter-mapbox-gl#762 by interpreting and setting geometry on the line, allowing to programmatically move lines
@AAverin
Copy link
Contributor Author

AAverin commented Nov 19, 2021

@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.
Should we do there something similar to what I have in this PR for line?

ios/Classes/Convert.swift Outdated Show resolved Hide resolved
@felix-ht
Copy link
Collaborator

@AAverin doing the same for fills would be a good idea as well

felix-ht
felix-ht previously approved these changes Nov 19, 2021

if let geometry = options["geometry"] as? [[Double]], geometry.count > 0 {
var coordinates: [CLLocationCoordinate2D] = []
class func getCoordinates(options: Any?) -> [CLLocationCoordinate2D] {
Copy link
Collaborator

@felix-ht felix-ht Nov 19, 2021

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

Copy link
Contributor Author

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

Copy link
Collaborator

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!

@felix-ht felix-ht dismissed their stale review November 19, 2021 20:23

wrong button


if let geometry = options["geometry"] as? [[Double]], geometry.count > 0 {
var coordinates: [CLLocationCoordinate2D] = []
class func getCoordinates(options: Any?) -> [CLLocationCoordinate2D] {
Copy link
Collaborator

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!

@tobrun tobrun merged commit 9a07be7 into flutter-mapbox-gl:master Nov 20, 2021
m0nac0 added a commit to maplibre/flutter-maplibre-gl that referenced this pull request May 15, 2022
https: //github.com/flutter-mapbox-gl/maps/pull/776
Co-Authored-By: Anton Averin <1481332+AAverin@users.noreply.github.com>
m0nac0 added a commit to maplibre/flutter-maplibre-gl that referenced this pull request May 15, 2022
Cherry-pick upstream#776

https: //github.com/flutter-mapbox-gl/maps/pull/776

Co-Authored-By: Anton Averin <1481332+AAverin@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants