@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
|
-
|
|
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();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-b/geo-maplibre",
|
|
3
|
-
"version": "0.3.
|
|
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.
|
|
38
|
-
"@mcp-b/wc-support": "0.3.
|
|
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",
|