mapbox / mapbox-gl-style-spec

76 stars 38 forks source link

Add declass module to preprocess a style's paint classes #573

Closed anandthakker closed 7 years ago

anandthakker commented 7 years ago

Prepares for removal of paint classes from GL JS by providing declass as a migration path for projects relying on them. map.setClasses(classes) will become map.setStyle(declass(myBaseStyleJSON, classes)).

Couple notes:

jfirebaugh commented 7 years ago
  • Currently I have declass leaving the paint.foo properties on layers, even after applying the foo class, but I'm not sure whether that's a good idea.

It should remove them -- the output should include only plain paint properties.

  • Based on my admittedly brief skim of GL JS paint class code, I believe there's no provision for a paint class to unset a property, and so that's the case here as well.

Correct, they are additive only.

anandthakker commented 7 years ago

It should remove them -- the output should include only plain paint properties

@jfirebaugh removed.