mirror of
https://github.com/maputnik/editor.git
synced 2026-04-21 08:50:02 +00:00
This is a temporary fix for: - #871 The fix is using `patch-package` to fix the part of the code that is causing the issue, I believe. Initial tests shows that this is fixing the issue, I hope it is not introducing other issues. A proper fix and also using the maplibre package will be done once a repo is migrated as can be expected after the following PR is resolved: - https://github.com/maplibre/maplibre/issues/359
19 lines
758 B
Diff
19 lines
758 B
Diff
diff --git a/node_modules/mapbox-gl-inspect/lib/MapboxInspect.js b/node_modules/mapbox-gl-inspect/lib/MapboxInspect.js
|
|
index ea9bf07..3e7ab38 100644
|
|
--- a/node_modules/mapbox-gl-inspect/lib/MapboxInspect.js
|
|
+++ b/node_modules/mapbox-gl-inspect/lib/MapboxInspect.js
|
|
@@ -159,7 +159,12 @@ MapboxInspect.prototype._onSourceChange = function () {
|
|
});
|
|
|
|
if (!isEqual(previousSources, sources) && Object.keys(sources).length > 0) {
|
|
- this.render();
|
|
+ setTimeout(() => {
|
|
+ // The calling method is being called when the sources are being updated.
|
|
+ // render might call setStyle, which is not a good idea while updating the source.
|
|
+ // So, we are delaying the render to the next event loop.
|
|
+ this.render();
|
|
+ }, 100);
|
|
}
|
|
};
|
|
|