-
Notifications
You must be signed in to change notification settings - Fork 127
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
new feature: set arbitrary layer properties #303
new feature: set arbitrary layer properties #303
Conversation
…file (which was manually swift-formatted so far, resulting in removal of these semicolons and breaks)
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.
Note for review: this file was automatically generated by the script.
Apparently it was manually formatted in the past, but I did not do this again.
It is much easier to review when enabling "hide whitespace changes"
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.
also automatically generated
Closes #250 |
@stefanschaller can you take a look? |
try { | ||
_map.setLayoutProperty(layerId, entry.key, entry.value); | ||
} catch (e) { | ||
print('Caught exception (usually safe to ignore): $e'); | ||
} | ||
try { | ||
_map.setPaintProperty(layerId, entry.key, entry.value); | ||
} catch (e) { | ||
print('Caught exception (usually safe to ignore): $e'); | ||
} |
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.
try { | |
_map.setLayoutProperty(layerId, entry.key, entry.value); | |
} catch (e) { | |
print('Caught exception (usually safe to ignore): $e'); | |
} | |
try { | |
_map.setPaintProperty(layerId, entry.key, entry.value); | |
} catch (e) { | |
print('Caught exception (usually safe to ignore): $e'); | |
} | |
try { | |
_map.setLayoutProperty(layerId, entry.key, entry.value); | |
_map.setPaintProperty(layerId, entry.key, entry.value); | |
} catch (e) { | |
print('Caught exception (usually safe to ignore): $e'); | |
} |
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 think with your suggestion, if it is a paint property, the setLayoutProperty method would (usually?) throw an error and the setPaintProperty method would not be called.
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.
@stefanschaller What do you think, is it fine to keep the code as is with that explanation?
Looks good to me. I didn't have any issues with the layer api @JulianBissekkou |
@stefanschaller @JulianBissekkou Can we merge this? |
This introduces a new method:
MaplibreMapController#setLayerProperties
to change any properties of any given layer at runtime.I had to fix LayerPropertyConverter for android and iOS because there was a problem with the visibility property (which gets somewhat special treatment, and did not work because it received a string like ""visible"" instead of "visible" (notice the unnecessary quotes)). In the process I also fixed the script to generate these files.
TODO: