map-ol-utils 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -0
- package/dist/index.js +6 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -827,9 +827,15 @@ var disposeMap = (mapInstance = instance) => {
|
|
|
827
827
|
mapInstance.getOverlays().forEach((overlay) => {
|
|
828
828
|
mapInstance.removeOverlay(overlay);
|
|
829
829
|
});
|
|
830
|
+
mapInstance.getInteractions().clear();
|
|
830
831
|
const layers = mapInstance.getAllLayers();
|
|
831
832
|
layers.forEach((layer) => {
|
|
833
|
+
const source = layer.getSource();
|
|
834
|
+
if (source && source.dispose) {
|
|
835
|
+
source.dispose();
|
|
836
|
+
}
|
|
832
837
|
mapInstance.removeLayer(layer);
|
|
838
|
+
layer.dispose();
|
|
833
839
|
});
|
|
834
840
|
mapInstance.setTarget("");
|
|
835
841
|
mapInstance = void 0;
|
package/dist/index.js
CHANGED
|
@@ -761,9 +761,15 @@ var disposeMap = (mapInstance = instance) => {
|
|
|
761
761
|
mapInstance.getOverlays().forEach((overlay) => {
|
|
762
762
|
mapInstance.removeOverlay(overlay);
|
|
763
763
|
});
|
|
764
|
+
mapInstance.getInteractions().clear();
|
|
764
765
|
const layers = mapInstance.getAllLayers();
|
|
765
766
|
layers.forEach((layer) => {
|
|
767
|
+
const source = layer.getSource();
|
|
768
|
+
if (source && source.dispose) {
|
|
769
|
+
source.dispose();
|
|
770
|
+
}
|
|
766
771
|
mapInstance.removeLayer(layer);
|
|
772
|
+
layer.dispose();
|
|
767
773
|
});
|
|
768
774
|
mapInstance.setTarget("");
|
|
769
775
|
mapInstance = void 0;
|