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

Fix bug preventing the use of property functions in style classes #3091

Closed
kristfal opened this issue Aug 29, 2016 · 5 comments
Closed

Fix bug preventing the use of property functions in style classes #3091

kristfal opened this issue Aug 29, 2016 · 5 comments

Comments

@kristfal
Copy link

kristfal commented Aug 29, 2016

mapbox-gl-js version: Master and 23.0

Steps to Trigger Behavior

Map style is set with paint properties:

'paint': {
    'fill-color': {
        'property': 'drval1',
        'stops': [[0, 'red'], [10, 'red']]
    },
    'fill-antialias': false
  },
  'paint.contrast': {
     'fill-color': {
        'property': 'drval1',
        'stops': [[0, 'blue'], [10, 'green']]
    }
  },
  'paint.night': {
     'fill-color': {
        'property': 'drval1',
        'stops': [[0, 'yellow'], [10, 'orange']]
    }
  }

Call setClasses(['night']) or setClasses(['contrast']). The DDS layer does not update it's style.

Expected Behavior

Paint classes containing DDSs should update and render the selected class.

Actual Behavior

Paint classes containg DDSs are not updated.

Minimum fiddle: https://jsfiddle.net/3y6pv6q3/1/

@lucaswoj lucaswoj changed the title Property driven DDS does not work with paint classes Fix bug preventing the use of property functions in style classes Aug 29, 2016
@lucaswoj
Copy link
Contributor

lucaswoj commented Sep 6, 2016

This is likely a subset of #3098

@kristfal
Copy link
Author

Any progress or timeline on this? It's been 6 months and it would be really cool to have this working properly.

@anandthakker
Copy link
Contributor

@kristfal I'm not aware of any recent work on this, but note that we are planning to deprecate style classes in the near future.

As an alternative to using classes, please consider using map.setStyle(...), which, as of v0.29.0, should smoothly transition from one style to another, performing only the necessary changes rather than reloading the whole style. (We'll be adding examples of this to the docs soon.)

@kristfal
Copy link
Author

@anandthakker Alright thanks for the info. I'll migrate to a classless approach instead. Feel free to close this issue then.

@anandthakker
Copy link
Contributor

@kristfal 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants