File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
src/mapboxgl/overlay/symbol Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ function MapExtendSymbol(){
2020 if ( ! mapboxgl . Map . prototype . symbolHandler ) {
2121 mapboxgl . Map . prototype . symbolHandler = new SymbolHandler ( map ) ;
2222 }
23- return mapboxgl . Map . prototype . symbolHandler ;
23+ return mapboxgl . Map . prototype . symbolHandler . _update ( map ) ;
2424 }
2525
2626 if ( mapboxgl . Map . prototype . addLayerBySymbolBak === undefined ) {
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ class SymbolHandler {
2323 this . #layerSymbols = { } ;
2424 }
2525
26+ _update ( map ) {
27+ this . map = map ;
28+ return this ;
29+ }
30+
2631 /**
2732 * 添加符号图层
2833 * @param {Object } layer
@@ -339,7 +344,7 @@ class SymbolHandler {
339344 */
340345 moveLayer ( layerId , beforeId ) {
341346 const layerIds = this . getLayerIds ( layerId ) ;
342- const realBeforeId = beforeId && ( this . map . style . getLayer ( beforeId ) ?. id ?? this . getFirstLayerId ( beforeId ) ) ;
347+ const realBeforeId = beforeId && ( this . map . style . getLayer ( beforeId ) ?. id ?? this . getFirstLayerId ( beforeId ) ) ;
343348 if ( layerIds ?. length > 0 ) {
344349 layerIds . forEach ( id => this . map . style . moveLayer ( id , realBeforeId ) ) ;
345350 } else {
You can’t perform that action at this time.
0 commit comments