Skip to content

Commit

Permalink
Merge pull request #19 from 2gis/TILES-5062
Browse files Browse the repository at this point in the history
TILES-5062 layer removes fix
  • Loading branch information
Kuznecoff authored Mar 3, 2023
2 parents f6871c9 + 38c2998 commit 8b863d0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@2gis/deck2gis-layer",
"version": "1.1.8",
"version": "1.1.9",
"description": "",
"main": "dist/deck2gislayer.js",
"typings": "dist/types/index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/deckgl2gisLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ export class Deck2gisLayer<LayerT extends Layer> implements DeckCustomLayer {
if (this.deck) {
removeLayer(this.deck, this);
}
this.deck = null;
this.map = null;
};

/**
Expand Down
3 changes: 0 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ export function addLayer(deck: Deck, layer: Deck2gisLayer<any>): void {
export function removeLayer(deck: Deck, layer: Deck2gisLayer<any>): void {
(deck.props as CustomRenderProps)._2gisData._2gisCustomLayers.delete(layer);
updateLayers(deck);
if ((deck.props as CustomRenderProps)._2gisData._2gisCustomLayers.size === 0) {
(deck.props as CustomRenderProps)._2gisData._2gisMap.__deck = undefined;
}
}

/**
Expand Down

0 comments on commit 8b863d0

Please sign in to comment.