@mcp-b/geo-openlayers 0.3.0 → 0.3.2

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.
@@ -49,7 +49,8 @@ let SigveloOlGeojson = class SigveloOlGeojson extends LitElement {
49
49
  /** @internal */
50
50
  _subscribeChannel() {
51
51
  this._unsubscribeChannel?.();
52
- if (!this.channel) return;
52
+ this._unsubscribeChannel = null;
53
+ if (!this.isConnected || !this.channel) return;
53
54
  this._unsubscribeChannel = subscribeClassify(this.channel, (detail) => {
54
55
  this.styleFunction = detail.styleFunction;
55
56
  });
@@ -74,7 +75,7 @@ let SigveloOlGeojson = class SigveloOlGeojson extends LitElement {
74
75
  }
75
76
  /** @internal */
76
77
  _addLayer() {
77
- if (!this._mapEl?.map || !this.data) return;
78
+ if (!this.isConnected || !this._mapEl?.map || !this.data) return;
78
79
  const source = new VectorSource({ features: new GeoJSON().readFeatures(this.data, { featureProjection: "EPSG:3857" }) });
79
80
  const defaultStyle = new Style({
80
81
  fill: new Fill({ color: hexToRgba(this.fillColor, this.fillOpacity) }),
@@ -148,6 +149,7 @@ let SigveloOlGeojson = class SigveloOlGeojson extends LitElement {
148
149
  });
149
150
  }
150
151
  updated(changed) {
152
+ if (changed.has("channel")) this._subscribeChannel();
151
153
  if (changed.has("data") || changed.has("styleFunction") || changed.has("fillColor") || changed.has("fillOpacity") || changed.has("strokeColor") || changed.has("strokeWidth") || changed.has("circleRadius")) {
152
154
  this._removeLayer();
153
155
  this._addLayer();
@@ -1451,7 +1451,7 @@
1451
1451
  "package": {
1452
1452
  "name": "@mcp-b/geo-openlayers",
1453
1453
  "description": "OpenLayers web components for Sigvelo, built with Lit.",
1454
- "version": "0.3.0",
1454
+ "version": "0.3.2",
1455
1455
  "license": "MIT"
1456
1456
  }
1457
1457
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-b/geo-openlayers",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "OpenLayers web components for Sigvelo, built with Lit.",
5
5
  "keywords": [
6
6
  "custom-elements",
@@ -35,8 +35,8 @@
35
35
  "access": "public"
36
36
  },
37
37
  "dependencies": {
38
- "@mcp-b/geo-support": "0.3.0",
39
- "@mcp-b/wc-support": "0.3.0"
38
+ "@mcp-b/geo-support": "0.3.2",
39
+ "@mcp-b/wc-support": "0.3.2"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@custom-elements-manifest/analyzer": "^0.10.10",