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

Runtime styling #60

Open
ritter1 opened this issue Dec 4, 2019 · 3 comments
Open

Runtime styling #60

ritter1 opened this issue Dec 4, 2019 · 3 comments

Comments

@ritter1
Copy link

ritter1 commented Dec 4, 2019

Is there already a way to dynamically style a symbol?

How would I dynamically show/hide an icon? Formerly, with expression, it worked like this:
symbols.iconOpacity = NSExpression(format: "mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)",
[5.9: 0, 6: 1])

@maximumbuster
Copy link

I don't think this is supported on ios currently although it's supported on the android mapbox annotation plugin by setting a filter expression on the style layer: android docs.

A similar style layer object is available in the ios annotation controllers as well though so perhaps this could be added as a feature request?

@captainbarbosa
Copy link
Contributor

Hi @ritter1 - @maximumbuster is correct, this extension currently doesn't support NSExpression usage for runtime styling. I will keep this issue open though for future tracking purposes.

@maximumbuster
Copy link

@captainbarbosa It appears that the mapbox layers already have support for setting a predicate to do filtering, do you know if we could just add a set predicate method on the annotation controllers which would pass the predicate along to the controller's style layer? https://docs.mapbox.com/ios/api/maps/4.2.0/Classes/MGLVectorStyleLayer.html#/c:objc(cs)MGLVectorStyleLayer(py)predicate

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

No branches or pull requests

3 participants