mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-29 11:10:27 +01:00
Remove interactive from style for diffing to work
This commit is contained in:
parent
fb518c2be5
commit
ca9424e23d
1 changed files with 15 additions and 1 deletions
|
@ -19,6 +19,20 @@ function ensureHasId(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) {
|
||||
const derefedStyle = {
|
||||
...style,
|
||||
|
@ -28,7 +42,7 @@ function ensureHasNoRefs(style) {
|
|||
}
|
||||
|
||||
function ensureStyleValidity(style) {
|
||||
return ensureHasNoRefs(ensureHasId(style))
|
||||
return ensureHasNoInteractive(ensureHasNoRefs(ensureHasId(style)))
|
||||
}
|
||||
|
||||
function indexOfLayer(layers, layerId) {
|
||||
|
|
Loading…
Reference in a new issue