@mcp-b/geo-maplibre 0.3.0 → 0.3.1

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.
@@ -50,7 +50,8 @@ let SigveloMaplibreGeojson = class SigveloMaplibreGeojson extends LitElement {
50
50
  /** @internal */
51
51
  _subscribeChannel() {
52
52
  this._unsubscribeChannel?.();
53
- if (!this.channel) return;
53
+ this._unsubscribeChannel = null;
54
+ if (!this.isConnected || !this.channel) return;
54
55
  this._unsubscribeChannel = subscribeClassify(this.channel, (detail) => {
55
56
  this.styleFunction = detail.styleFunction;
56
57
  });
@@ -79,7 +80,7 @@ let SigveloMaplibreGeojson = class SigveloMaplibreGeojson extends LitElement {
79
80
  }
80
81
  _addSource() {
81
82
  const map = this._mapEl?.map;
82
- if (!map || !this.data) return;
83
+ if (!this.isConnected || !map || !this.data) return;
83
84
  if (!map.isStyleLoaded()) return;
84
85
  this._removeSource();
85
86
  const processedData = this._prepareData();
@@ -201,6 +202,7 @@ let SigveloMaplibreGeojson = class SigveloMaplibreGeojson extends LitElement {
201
202
  if (map.getSource(this._sourceId)) map.removeSource(this._sourceId);
202
203
  }
203
204
  updated(changed) {
205
+ if (changed.has("channel")) this._subscribeChannel();
204
206
  if (changed.has("data") || changed.has("styleFunction") || changed.has("fillColor") || changed.has("fillOpacity") || changed.has("strokeColor") || changed.has("strokeWidth") || changed.has("circleRadius")) {
205
207
  this._removeSource();
206
208
  this._addSource();
@@ -1582,7 +1582,7 @@
1582
1582
  "package": {
1583
1583
  "name": "@mcp-b/geo-maplibre",
1584
1584
  "description": "MapLibre GL JS web components for Sigvelo, built with Lit.",
1585
- "version": "0.3.0",
1585
+ "version": "0.3.1",
1586
1586
  "license": "MIT"
1587
1587
  }
1588
1588
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-b/geo-maplibre",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "MapLibre GL JS web components for Sigvelo, built with Lit.",
5
5
  "keywords": [
6
6
  "custom-elements",
@@ -34,8 +34,8 @@
34
34
  "access": "public"
35
35
  },
36
36
  "dependencies": {
37
- "@mcp-b/geo-support": "0.3.0",
38
- "@mcp-b/wc-support": "0.3.0"
37
+ "@mcp-b/geo-support": "0.3.1",
38
+ "@mcp-b/wc-support": "0.3.1"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@custom-elements-manifest/analyzer": "^0.10.10",