Skip to content

Commit 7b7aa00

Browse files
committed
【feature】初始化overlayermanager优化
1 parent 24fb1b3 commit 7b7aa00

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/mapboxgl/core/MapExtend.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ export var MapExtend = (function () {
2323
};
2424
}
2525
mapboxgl.Map = class Map extends mapboxgl.Map {
26-
overlayLayersManager = {};
26+
constructor(options) {
27+
super(options);
28+
this.overlayLayersManager = {};
29+
}
2730
}
2831
if (mapboxgl.Map.prototype.addLayerBak === undefined) {
2932
mapboxgl.Map.prototype.addLayerBak = mapboxgl.Map.prototype.addLayer;

src/maplibregl/core/MapExtend.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ import maplibregl from 'maplibre-gl';
1010
*/
1111
export var MapExtend = (function () {
1212
maplibregl.Map = class Map extends maplibregl.Map {
13-
overlayLayersManager = {};
13+
constructor(options) {
14+
super(options);
15+
this.overlayLayersManager = {};
16+
}
1417
}
1518
if (maplibregl.Map.prototype.addLayerBak === undefined) {
1619
maplibregl.Map.prototype.addLayerBak = maplibregl.Map.prototype.addLayer;

0 commit comments

Comments
 (0)