mirror of
https://github.com/maputnik/editor.git
synced 2026-08-24 14:07:33 +00:00
Temp fix using patch-package for maplibre-inspect issue (#885)
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
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user