mirror of
https://github.com/maputnik/editor.git
synced 2026-07-25 23:37:27 +00:00
Remove interactive from style for diffing to work
This commit is contained in:
+15
-1
@@ -19,6 +19,20 @@ function ensureHasId(style) {
|
|||||||
return style
|
return style
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ensureHasNoInteractive(style) {
|
||||||
|
const changedLayers = style.layers.map(layer => {
|
||||||
|
const changedLayer = { ...layer }
|
||||||
|
delete changedLayer.interactive
|
||||||
|
return changedLayer
|
||||||
|
})
|
||||||
|
|
||||||
|
const nonInteractiveStyle = {
|
||||||
|
...style,
|
||||||
|
layers: changedLayers
|
||||||
|
}
|
||||||
|
return nonInteractiveStyle
|
||||||
|
}
|
||||||
|
|
||||||
function ensureHasNoRefs(style) {
|
function ensureHasNoRefs(style) {
|
||||||
const derefedStyle = {
|
const derefedStyle = {
|
||||||
...style,
|
...style,
|
||||||
@@ -28,7 +42,7 @@ function ensureHasNoRefs(style) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ensureStyleValidity(style) {
|
function ensureStyleValidity(style) {
|
||||||
return ensureHasNoRefs(ensureHasId(style))
|
return ensureHasNoInteractive(ensureHasNoRefs(ensureHasId(style)))
|
||||||
}
|
}
|
||||||
|
|
||||||
function indexOfLayer(layers, layerId) {
|
function indexOfLayer(layers, layerId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user