mirror of
https://github.com/maputnik/editor.git
synced 2026-08-26 15:07:41 +00:00
Moved to using @mapbox/mapbox-gl-style-spec
This commit is contained in:
+3
-3
@@ -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]
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user