@record-evolution/widget-mapbox 1.4.18 → 1.4.20
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.
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/widget-mapbox.js +9 -6
- package/dist/widget-mapbox.js.map +1 -1
- package/package.json +68 -67
- package/src/cors-config.json +8 -0
- package/src/widget-mapbox.ts +6 -2
package/package.json
CHANGED
|
@@ -1,69 +1,70 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
2
|
+
"name": "@record-evolution/widget-mapbox",
|
|
3
|
+
"description": "REWidget widget-mapbox",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"author": "widget-mapbox",
|
|
6
|
+
"version": "1.4.20",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/widget-mapbox.js",
|
|
9
|
+
"types": "dist/src/widget-mapbox.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"src"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"analyze": "cem analyze --litelement",
|
|
16
|
+
"start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
|
|
17
|
+
"build": "rollup -c rollup.config.js",
|
|
18
|
+
"watch": "rollup -w -c rollup.config.js",
|
|
19
|
+
"types": "cat src/definition-schema.json | json2ts > src/definition-schema.d.ts",
|
|
20
|
+
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
|
|
21
|
+
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
|
|
22
|
+
"release": "npm version patch --tag-version-prefix='' && git push && git push --tag",
|
|
23
|
+
"cors": "gcloud storage buckets update gs://reswarm-images --cors-file=src/cors-config.json"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@types/geojson": "^7946.0.12",
|
|
27
|
+
"@types/mapbox-gl": "^2.7.18",
|
|
28
|
+
"lit": "^3.0.2",
|
|
29
|
+
"mapbox-gl": "^2.15.0",
|
|
30
|
+
"tinycolor2": "^1.6.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@babel/plugin-syntax-import-assertions": "^7.22.5",
|
|
34
|
+
"@custom-elements-manifest/analyzer": "^0.9.0",
|
|
35
|
+
"@open-wc/eslint-config": "^12.0.2",
|
|
36
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
37
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
38
|
+
"@rollup/plugin-json": "^6.0.1",
|
|
39
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
40
|
+
"@rollup/plugin-replace": "^5.0.5",
|
|
41
|
+
"@rollup/plugin-typescript": "^11.1.5",
|
|
42
|
+
"@types/tinycolor2": "^1.4.6",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^6.9.1",
|
|
44
|
+
"@typescript-eslint/parser": "^6.9.1",
|
|
45
|
+
"@web/dev-server": "^0.4.0",
|
|
46
|
+
"concurrently": "^8.2.2",
|
|
47
|
+
"eslint": "^8.53.0",
|
|
48
|
+
"eslint-config-prettier": "^9.0.0",
|
|
49
|
+
"husky": "^8.0.3",
|
|
50
|
+
"json-schema-to-typescript": "^13.1.1",
|
|
51
|
+
"lint-staged": "^15.0.2",
|
|
52
|
+
"prettier": "^3.0.3",
|
|
53
|
+
"rollup": "^3.21.0",
|
|
54
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
55
|
+
"tslib": "^2.6.2",
|
|
56
|
+
"typescript": "^5.2.2"
|
|
57
|
+
},
|
|
58
|
+
"repository": {
|
|
59
|
+
"type": "git",
|
|
60
|
+
"url": "git+https://github.com/RecordEvolution/widget-mapbox.git"
|
|
61
|
+
},
|
|
62
|
+
"keywords": [
|
|
63
|
+
"widget",
|
|
64
|
+
"mapbox"
|
|
65
|
+
],
|
|
66
|
+
"bugs": {
|
|
67
|
+
"url": "https://github.com/RecordEvolution/widget-mapbox/issues"
|
|
68
|
+
},
|
|
69
|
+
"homepage": "https://github.com/RecordEvolution/widget-mapbox#readme"
|
|
69
70
|
}
|
package/src/widget-mapbox.ts
CHANGED
|
@@ -112,7 +112,9 @@ export class WidgetMapbox extends LitElement {
|
|
|
112
112
|
|
|
113
113
|
// Filter for latest Values
|
|
114
114
|
this.dataSets.forEach((ds) => {
|
|
115
|
-
if (ds?.latestValues && ds?.latestValues > 0)
|
|
115
|
+
if (ds?.latestValues && ds?.latestValues > 0) {
|
|
116
|
+
ds.data = ds?.data?.slice(0, ds.latestValues ?? 1) ?? []
|
|
117
|
+
}
|
|
116
118
|
})
|
|
117
119
|
|
|
118
120
|
// console.log('mapbox datasets', this.dataSets)
|
|
@@ -387,7 +389,9 @@ export class WidgetMapbox extends LitElement {
|
|
|
387
389
|
if (['line', 'symbol'].includes(ds.type ?? '') && !this.imageList.includes(imageName)) {
|
|
388
390
|
const img = new Image(24 * sz, 24 * sz) as HTMLImageElement
|
|
389
391
|
img.onload = () => this.map.addImage(imageName, img, { sdf: true })
|
|
390
|
-
img.
|
|
392
|
+
img.crossOrigin = 'anonymous'
|
|
393
|
+
img.referrerPolicy = 'no-referrer'
|
|
394
|
+
img.src = `https://storage.googleapis.com/reswarm-images/${_imageName}.svg`
|
|
391
395
|
this.imageList.push(imageName)
|
|
392
396
|
}
|
|
393
397
|
const fc = this.dataSources.get('input:' + ds.label)
|