map-ol-utils 0.1.5 → 0.1.6

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 CHANGED
@@ -823,7 +823,7 @@ var createMap = (config = {}) => {
823
823
  });
824
824
  return instance2;
825
825
  };
826
- var disposeMap = (mapInstance = instance) => {
826
+ var disposeMap = (mapInstance = instance, disposeAll = true) => {
827
827
  mapInstance.getOverlays().forEach((overlay) => {
828
828
  mapInstance.removeOverlay(overlay);
829
829
  });
@@ -839,7 +839,7 @@ var disposeMap = (mapInstance = instance) => {
839
839
  });
840
840
  mapInstance.setTarget("");
841
841
  mapInstance.dispose();
842
- if (!mapInstance) {
842
+ if (disposeAll) {
843
843
  instance = void 0;
844
844
  }
845
845
  mapInstance = void 0;
package/dist/index.d.cts CHANGED
@@ -125,7 +125,7 @@ declare const removeLayerByName: (name: string) => void;
125
125
  declare let instance: CustomMap;
126
126
  declare const createMapInstance: (config?: {}) => CustomMap;
127
127
  declare const createMap: (config?: {}) => CustomMap;
128
- declare const disposeMap: (mapInstance?: CustomMap) => void;
128
+ declare const disposeMap: (mapInstance?: CustomMap, disposeAll?: boolean) => void;
129
129
  declare const getMapInstance: () => CustomMap;
130
130
  declare const resetZoomAndCenter: (center?: [number, number]) => void;
131
131
  declare const resetMap: (config?: {
package/dist/index.d.ts CHANGED
@@ -125,7 +125,7 @@ declare const removeLayerByName: (name: string) => void;
125
125
  declare let instance: CustomMap;
126
126
  declare const createMapInstance: (config?: {}) => CustomMap;
127
127
  declare const createMap: (config?: {}) => CustomMap;
128
- declare const disposeMap: (mapInstance?: CustomMap) => void;
128
+ declare const disposeMap: (mapInstance?: CustomMap, disposeAll?: boolean) => void;
129
129
  declare const getMapInstance: () => CustomMap;
130
130
  declare const resetZoomAndCenter: (center?: [number, number]) => void;
131
131
  declare const resetMap: (config?: {
package/dist/index.js CHANGED
@@ -757,7 +757,7 @@ var createMap = (config = {}) => {
757
757
  });
758
758
  return instance2;
759
759
  };
760
- var disposeMap = (mapInstance = instance) => {
760
+ var disposeMap = (mapInstance = instance, disposeAll = true) => {
761
761
  mapInstance.getOverlays().forEach((overlay) => {
762
762
  mapInstance.removeOverlay(overlay);
763
763
  });
@@ -773,7 +773,7 @@ var disposeMap = (mapInstance = instance) => {
773
773
  });
774
774
  mapInstance.setTarget("");
775
775
  mapInstance.dispose();
776
- if (!mapInstance) {
776
+ if (disposeAll) {
777
777
  instance = void 0;
778
778
  }
779
779
  mapInstance = void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "map-ol-utils",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "description": "Openlayers utils library",
6
6
  "files": [