Moved to using @mapbox/mapbox-gl-style-spec

This commit is contained in:
orangemug
2017-04-10 13:29:57 +01:00
parent ac8ae0da66
commit c3174a0c72
19 changed files with 52 additions and 56 deletions
+3 -3
View File
@@ -1,16 +1,16 @@
import GlSpec from 'mapbox-gl/src/style-spec/reference/latest'
import styleSpec from '@mapbox/mapbox-gl-style-spec'
export function changeType(layer, newType) {
const changedPaintProps = { ...layer.paint }
Object.keys(changedPaintProps).forEach(propertyName => {
if(!(propertyName in GlSpec['paint_' + newType])) {
if(!(propertyName in styleSpec.latest['paint_' + newType])) {
delete changedPaintProps[propertyName]
}
})
const changedLayoutProps = { ...layer.layout }
Object.keys(changedLayoutProps).forEach(propertyName => {
if(!(propertyName in GlSpec['layout_' + newType])) {
if(!(propertyName in styleSpec.latest['layout_' + newType])) {
delete changedLayoutProps[propertyName]
}
})