From ca9424e23d734cce7a4774e9ed64ac96f9dde276 Mon Sep 17 00:00:00 2001 From: Lukas Martinelli Date: Fri, 13 Jan 2017 15:31:08 +0100 Subject: [PATCH] Remove interactive from style for diffing to work --- src/libs/style.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/libs/style.js b/src/libs/style.js index 5e2404f..726d6ec 100644 --- a/src/libs/style.js +++ b/src/libs/style.js @@ -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) {