Feature: add Protomaps as background layers
This commit is contained in:
parent
4ff67addf7
commit
f2a6225c80
8 changed files with 272 additions and 104 deletions
195
package-lock.json
generated
195
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "mapcomplete",
|
"name": "mapcomplete",
|
||||||
"version": "0.40.5",
|
"version": "0.40.6",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "mapcomplete",
|
"name": "mapcomplete",
|
||||||
"version": "0.40.5",
|
"version": "0.40.6",
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rgossiaux/svelte-headlessui": "^1.0.2",
|
"@rgossiaux/svelte-headlessui": "^1.0.2",
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
"libphonenumber-js": "^1.10.8",
|
"libphonenumber-js": "^1.10.8",
|
||||||
"lz-string": "^1.4.4",
|
"lz-string": "^1.4.4",
|
||||||
"mangrove-reviews-typescript": "^1.1.0",
|
"mangrove-reviews-typescript": "^1.1.0",
|
||||||
"maplibre-gl": "^3.5.0",
|
"maplibre-gl": "^4.1.1",
|
||||||
"monaco-editor": "^0.46.0",
|
"monaco-editor": "^0.46.0",
|
||||||
"nano-markdown": "^1.2.2",
|
"nano-markdown": "^1.2.2",
|
||||||
"opening_hours": "^3.6.0",
|
"opening_hours": "^3.6.0",
|
||||||
|
@ -55,6 +55,7 @@
|
||||||
"pbf": "^3.2.1",
|
"pbf": "^3.2.1",
|
||||||
"pg": "^8.11.3",
|
"pg": "^8.11.3",
|
||||||
"pic4carto": "^2.1.15",
|
"pic4carto": "^2.1.15",
|
||||||
|
"pmtiles": "^3.0.5",
|
||||||
"prompt-sync": "^4.2.0",
|
"prompt-sync": "^4.2.0",
|
||||||
"qrcode-generator": "^1.4.4",
|
"qrcode-generator": "^1.4.4",
|
||||||
"showdown": "^2.1.0",
|
"showdown": "^2.1.0",
|
||||||
|
@ -2343,13 +2344,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@maplibre/maplibre-gl-style-spec": {
|
"node_modules/@maplibre/maplibre-gl-style-spec": {
|
||||||
"version": "19.3.2",
|
"version": "20.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-19.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-20.1.1.tgz",
|
||||||
"integrity": "sha512-C2JAk64XUz9v78+bpyTk1zvgjjnDsB8CCjNumyAYdWK2dvdDtILzh1AGBMdS/llX3KaHjGYxAE5wOwfdwq4Pog==",
|
"integrity": "sha512-z85ARNPCBI2Cs5cPOS3DSbraTN+ue8zrcYVoSWBuNrD/mA+2SKAJ+hIzI22uN7gac6jBMnCdpPKRxS/V0KSZVQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mapbox/jsonlint-lines-primitives": "~2.0.2",
|
"@mapbox/jsonlint-lines-primitives": "~2.0.2",
|
||||||
"@mapbox/unitbezier": "^0.0.1",
|
"@mapbox/unitbezier": "^0.0.1",
|
||||||
"json-stringify-pretty-compact": "^3.0.0",
|
"json-stringify-pretty-compact": "^4.0.0",
|
||||||
"minimist": "^1.2.8",
|
"minimist": "^1.2.8",
|
||||||
"rw": "^1.3.3",
|
"rw": "^1.3.3",
|
||||||
"sort-object": "^3.0.3"
|
"sort-object": "^3.0.3"
|
||||||
|
@ -4157,9 +4158,17 @@
|
||||||
"integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ=="
|
"integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ=="
|
||||||
},
|
},
|
||||||
"node_modules/@types/geojson": {
|
"node_modules/@types/geojson": {
|
||||||
"version": "7946.0.11",
|
"version": "7946.0.14",
|
||||||
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.14.tgz",
|
||||||
"integrity": "sha512-L7A0AINMXQpVwxHJ4jxD6/XjZ4NDufaRlUJHjNIFKYUFBH1SvOW+neaqb0VTRSLW5suSrSu19ObFEFnfNcr+qg=="
|
"integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg=="
|
||||||
|
},
|
||||||
|
"node_modules/@types/geojson-vt": {
|
||||||
|
"version": "3.2.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/geojson-vt/-/geojson-vt-3.2.5.tgz",
|
||||||
|
"integrity": "sha512-qDO7wqtprzlpe8FfQ//ClPV9xiuoh2nkIgiouIptON9w5jvD/fA4szvP9GBlDVdJ5dldAl0kX/sy3URbWwLx0g==",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/geojson": "*"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/istanbul-lib-coverage": {
|
"node_modules/@types/istanbul-lib-coverage": {
|
||||||
"version": "2.0.4",
|
"version": "2.0.4",
|
||||||
|
@ -4194,6 +4203,14 @@
|
||||||
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==",
|
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/leaflet": {
|
||||||
|
"version": "1.9.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.8.tgz",
|
||||||
|
"integrity": "sha512-EXdsL4EhoUtGm2GC2ZYtXn+Fzc6pluVgagvo2VC1RHWToLGlTRwVYoDpqS/7QXa01rmDyBjJk3Catpf60VMkwg==",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/geojson": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@types/lz-string": {
|
"node_modules/@types/lz-string": {
|
||||||
"version": "1.3.34",
|
"version": "1.3.34",
|
||||||
"resolved": "https://registry.npmjs.org/@types/lz-string/-/lz-string-1.3.34.tgz",
|
"resolved": "https://registry.npmjs.org/@types/lz-string/-/lz-string-1.3.34.tgz",
|
||||||
|
@ -4201,14 +4218,14 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/mapbox__point-geometry": {
|
"node_modules/@types/mapbox__point-geometry": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz",
|
||||||
"integrity": "sha512-D0lgCq+3VWV85ey1MZVkE8ZveyuvW5VAfuahVTQRpXFQTxw03SuIf1/K4UQ87MMIXVKzpFjXFiFMZzLj2kU+iA=="
|
"integrity": "sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA=="
|
||||||
},
|
},
|
||||||
"node_modules/@types/mapbox__vector-tile": {
|
"node_modules/@types/mapbox__vector-tile": {
|
||||||
"version": "1.3.1",
|
"version": "1.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.4.tgz",
|
||||||
"integrity": "sha512-RpwGE57xM4a/YCH6XWzfcPVRPAu/jiCll0bEGRn6a4iubN2k4xZizskQoRj8fuXyo9BpI7F3bwz3uxs0pWbGNw==",
|
"integrity": "sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/geojson": "*",
|
"@types/geojson": "*",
|
||||||
"@types/mapbox__point-geometry": "*",
|
"@types/mapbox__point-geometry": "*",
|
||||||
|
@ -4236,9 +4253,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/pbf": {
|
"node_modules/@types/pbf": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz",
|
||||||
"integrity": "sha512-hw6bDMjvm+QTvEC+pRLpnTknQXoPu8Fnf+A+zX9HB7j/7RfYajFSbdukabo3adPwvvEHhIMafQl0R0Tpej7clQ=="
|
"integrity": "sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA=="
|
||||||
},
|
},
|
||||||
"node_modules/@types/pg": {
|
"node_modules/@types/pg": {
|
||||||
"version": "8.10.9",
|
"version": "8.10.9",
|
||||||
|
@ -4350,9 +4367,9 @@
|
||||||
"integrity": "sha512-70xBJoLv+oXjB5PhtA8vo7erjLDp9/qqI63SRHm4REKrwuPOLs8HhXwlZJBJaB4kC18cCZ1UUZ6Fb/PLFW4TCA=="
|
"integrity": "sha512-70xBJoLv+oXjB5PhtA8vo7erjLDp9/qqI63SRHm4REKrwuPOLs8HhXwlZJBJaB4kC18cCZ1UUZ6Fb/PLFW4TCA=="
|
||||||
},
|
},
|
||||||
"node_modules/@types/supercluster": {
|
"node_modules/@types/supercluster": {
|
||||||
"version": "7.1.1",
|
"version": "7.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.3.tgz",
|
||||||
"integrity": "sha512-dNK02GO1UApgo+1KpY4jOfm3uWb2eBCMB/VMM2y8cMoF49FiqVVcOawEg19wxYcaX7SvEs370incOuFtFGrVLg==",
|
"integrity": "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/geojson": "*"
|
"@types/geojson": "*"
|
||||||
}
|
}
|
||||||
|
@ -8792,9 +8809,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/json-stringify-pretty-compact": {
|
"node_modules/json-stringify-pretty-compact": {
|
||||||
"version": "3.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-4.0.0.tgz",
|
||||||
"integrity": "sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA=="
|
"integrity": "sha512-3CNZ2DnrpByG9Nqj6Xo8vqbjT4F6N+tb4Gb28ESAZjYZ5yqvmc56J+/kuIwkaAMOyblTQhUW7PxMkUb8Q36N3Q=="
|
||||||
},
|
},
|
||||||
"node_modules/json-stringify-safe": {
|
"node_modules/json-stringify-safe": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
|
@ -9158,9 +9175,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/maplibre-gl": {
|
"node_modules/maplibre-gl": {
|
||||||
"version": "3.5.0",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-3.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.1.1.tgz",
|
||||||
"integrity": "sha512-kPEBz6r1LBOZjUpFy+4wZU5Nvnkr60wBtYN/JD6N7oaA4Prpe21afYKxi1oWzSPSfspS1tWNF18GlpF2XcmNSA==",
|
"integrity": "sha512-DmHru9FTHCOngNHzIx9W2+MlUziYPfPxd2qjyeWwczBYNx2SDpmH394MkuCvSgnfUm5Zvs4NaYCqMu44jUga1Q==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mapbox/geojson-rewind": "^0.5.2",
|
"@mapbox/geojson-rewind": "^0.5.2",
|
||||||
"@mapbox/jsonlint-lines-primitives": "^2.0.2",
|
"@mapbox/jsonlint-lines-primitives": "^2.0.2",
|
||||||
|
@ -9169,12 +9186,13 @@
|
||||||
"@mapbox/unitbezier": "^0.0.1",
|
"@mapbox/unitbezier": "^0.0.1",
|
||||||
"@mapbox/vector-tile": "^1.3.1",
|
"@mapbox/vector-tile": "^1.3.1",
|
||||||
"@mapbox/whoots-js": "^3.1.0",
|
"@mapbox/whoots-js": "^3.1.0",
|
||||||
"@maplibre/maplibre-gl-style-spec": "^19.3.2",
|
"@maplibre/maplibre-gl-style-spec": "^20.1.1",
|
||||||
"@types/geojson": "^7946.0.11",
|
"@types/geojson": "^7946.0.14",
|
||||||
"@types/mapbox__point-geometry": "^0.1.2",
|
"@types/geojson-vt": "3.2.5",
|
||||||
"@types/mapbox__vector-tile": "^1.3.1",
|
"@types/mapbox__point-geometry": "^0.1.4",
|
||||||
"@types/pbf": "^3.0.3",
|
"@types/mapbox__vector-tile": "^1.3.4",
|
||||||
"@types/supercluster": "^7.1.1",
|
"@types/pbf": "^3.0.5",
|
||||||
|
"@types/supercluster": "^7.1.3",
|
||||||
"earcut": "^2.2.4",
|
"earcut": "^2.2.4",
|
||||||
"geojson-vt": "^3.2.1",
|
"geojson-vt": "^3.2.1",
|
||||||
"gl-matrix": "^3.4.3",
|
"gl-matrix": "^3.4.3",
|
||||||
|
@ -10196,6 +10214,20 @@
|
||||||
"pathe": "^1.0.0"
|
"pathe": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/pmtiles": {
|
||||||
|
"version": "3.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/pmtiles/-/pmtiles-3.0.5.tgz",
|
||||||
|
"integrity": "sha512-K6NxVvW/vXE3052VZKF2ppyjdyhLx41FidR5yV8L/+El+lcMJpXS0vHBSPFmjdag5zkYv2XGDdq+3VjB2K7l6w==",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/leaflet": "^1.9.8",
|
||||||
|
"fflate": "^0.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/pmtiles/node_modules/fflate": {
|
||||||
|
"version": "0.8.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz",
|
||||||
|
"integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A=="
|
||||||
|
},
|
||||||
"node_modules/point-in-polygon": {
|
"node_modules/point-in-polygon": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/point-in-polygon/-/point-in-polygon-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/point-in-polygon/-/point-in-polygon-1.1.0.tgz",
|
||||||
|
@ -15592,13 +15624,13 @@
|
||||||
"integrity": "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q=="
|
"integrity": "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q=="
|
||||||
},
|
},
|
||||||
"@maplibre/maplibre-gl-style-spec": {
|
"@maplibre/maplibre-gl-style-spec": {
|
||||||
"version": "19.3.2",
|
"version": "20.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-19.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-20.1.1.tgz",
|
||||||
"integrity": "sha512-C2JAk64XUz9v78+bpyTk1zvgjjnDsB8CCjNumyAYdWK2dvdDtILzh1AGBMdS/llX3KaHjGYxAE5wOwfdwq4Pog==",
|
"integrity": "sha512-z85ARNPCBI2Cs5cPOS3DSbraTN+ue8zrcYVoSWBuNrD/mA+2SKAJ+hIzI22uN7gac6jBMnCdpPKRxS/V0KSZVQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@mapbox/jsonlint-lines-primitives": "~2.0.2",
|
"@mapbox/jsonlint-lines-primitives": "~2.0.2",
|
||||||
"@mapbox/unitbezier": "^0.0.1",
|
"@mapbox/unitbezier": "^0.0.1",
|
||||||
"json-stringify-pretty-compact": "^3.0.0",
|
"json-stringify-pretty-compact": "^4.0.0",
|
||||||
"minimist": "^1.2.8",
|
"minimist": "^1.2.8",
|
||||||
"rw": "^1.3.3",
|
"rw": "^1.3.3",
|
||||||
"sort-object": "^3.0.3"
|
"sort-object": "^3.0.3"
|
||||||
|
@ -17008,9 +17040,17 @@
|
||||||
"integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ=="
|
"integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ=="
|
||||||
},
|
},
|
||||||
"@types/geojson": {
|
"@types/geojson": {
|
||||||
"version": "7946.0.11",
|
"version": "7946.0.14",
|
||||||
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.14.tgz",
|
||||||
"integrity": "sha512-L7A0AINMXQpVwxHJ4jxD6/XjZ4NDufaRlUJHjNIFKYUFBH1SvOW+neaqb0VTRSLW5suSrSu19ObFEFnfNcr+qg=="
|
"integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg=="
|
||||||
|
},
|
||||||
|
"@types/geojson-vt": {
|
||||||
|
"version": "3.2.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/geojson-vt/-/geojson-vt-3.2.5.tgz",
|
||||||
|
"integrity": "sha512-qDO7wqtprzlpe8FfQ//ClPV9xiuoh2nkIgiouIptON9w5jvD/fA4szvP9GBlDVdJ5dldAl0kX/sy3URbWwLx0g==",
|
||||||
|
"requires": {
|
||||||
|
"@types/geojson": "*"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"@types/istanbul-lib-coverage": {
|
"@types/istanbul-lib-coverage": {
|
||||||
"version": "2.0.4",
|
"version": "2.0.4",
|
||||||
|
@ -17045,6 +17085,14 @@
|
||||||
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==",
|
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"@types/leaflet": {
|
||||||
|
"version": "1.9.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.8.tgz",
|
||||||
|
"integrity": "sha512-EXdsL4EhoUtGm2GC2ZYtXn+Fzc6pluVgagvo2VC1RHWToLGlTRwVYoDpqS/7QXa01rmDyBjJk3Catpf60VMkwg==",
|
||||||
|
"requires": {
|
||||||
|
"@types/geojson": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@types/lz-string": {
|
"@types/lz-string": {
|
||||||
"version": "1.3.34",
|
"version": "1.3.34",
|
||||||
"resolved": "https://registry.npmjs.org/@types/lz-string/-/lz-string-1.3.34.tgz",
|
"resolved": "https://registry.npmjs.org/@types/lz-string/-/lz-string-1.3.34.tgz",
|
||||||
|
@ -17052,14 +17100,14 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/mapbox__point-geometry": {
|
"@types/mapbox__point-geometry": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz",
|
||||||
"integrity": "sha512-D0lgCq+3VWV85ey1MZVkE8ZveyuvW5VAfuahVTQRpXFQTxw03SuIf1/K4UQ87MMIXVKzpFjXFiFMZzLj2kU+iA=="
|
"integrity": "sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA=="
|
||||||
},
|
},
|
||||||
"@types/mapbox__vector-tile": {
|
"@types/mapbox__vector-tile": {
|
||||||
"version": "1.3.1",
|
"version": "1.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.4.tgz",
|
||||||
"integrity": "sha512-RpwGE57xM4a/YCH6XWzfcPVRPAu/jiCll0bEGRn6a4iubN2k4xZizskQoRj8fuXyo9BpI7F3bwz3uxs0pWbGNw==",
|
"integrity": "sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/geojson": "*",
|
"@types/geojson": "*",
|
||||||
"@types/mapbox__point-geometry": "*",
|
"@types/mapbox__point-geometry": "*",
|
||||||
|
@ -17087,9 +17135,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/pbf": {
|
"@types/pbf": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz",
|
||||||
"integrity": "sha512-hw6bDMjvm+QTvEC+pRLpnTknQXoPu8Fnf+A+zX9HB7j/7RfYajFSbdukabo3adPwvvEHhIMafQl0R0Tpej7clQ=="
|
"integrity": "sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA=="
|
||||||
},
|
},
|
||||||
"@types/pg": {
|
"@types/pg": {
|
||||||
"version": "8.10.9",
|
"version": "8.10.9",
|
||||||
|
@ -17187,9 +17235,9 @@
|
||||||
"integrity": "sha512-70xBJoLv+oXjB5PhtA8vo7erjLDp9/qqI63SRHm4REKrwuPOLs8HhXwlZJBJaB4kC18cCZ1UUZ6Fb/PLFW4TCA=="
|
"integrity": "sha512-70xBJoLv+oXjB5PhtA8vo7erjLDp9/qqI63SRHm4REKrwuPOLs8HhXwlZJBJaB4kC18cCZ1UUZ6Fb/PLFW4TCA=="
|
||||||
},
|
},
|
||||||
"@types/supercluster": {
|
"@types/supercluster": {
|
||||||
"version": "7.1.1",
|
"version": "7.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.3.tgz",
|
||||||
"integrity": "sha512-dNK02GO1UApgo+1KpY4jOfm3uWb2eBCMB/VMM2y8cMoF49FiqVVcOawEg19wxYcaX7SvEs370incOuFtFGrVLg==",
|
"integrity": "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/geojson": "*"
|
"@types/geojson": "*"
|
||||||
}
|
}
|
||||||
|
@ -20480,9 +20528,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"json-stringify-pretty-compact": {
|
"json-stringify-pretty-compact": {
|
||||||
"version": "3.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-4.0.0.tgz",
|
||||||
"integrity": "sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA=="
|
"integrity": "sha512-3CNZ2DnrpByG9Nqj6Xo8vqbjT4F6N+tb4Gb28ESAZjYZ5yqvmc56J+/kuIwkaAMOyblTQhUW7PxMkUb8Q36N3Q=="
|
||||||
},
|
},
|
||||||
"json-stringify-safe": {
|
"json-stringify-safe": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
|
@ -20767,9 +20815,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"maplibre-gl": {
|
"maplibre-gl": {
|
||||||
"version": "3.5.0",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-3.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.1.1.tgz",
|
||||||
"integrity": "sha512-kPEBz6r1LBOZjUpFy+4wZU5Nvnkr60wBtYN/JD6N7oaA4Prpe21afYKxi1oWzSPSfspS1tWNF18GlpF2XcmNSA==",
|
"integrity": "sha512-DmHru9FTHCOngNHzIx9W2+MlUziYPfPxd2qjyeWwczBYNx2SDpmH394MkuCvSgnfUm5Zvs4NaYCqMu44jUga1Q==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@mapbox/geojson-rewind": "^0.5.2",
|
"@mapbox/geojson-rewind": "^0.5.2",
|
||||||
"@mapbox/jsonlint-lines-primitives": "^2.0.2",
|
"@mapbox/jsonlint-lines-primitives": "^2.0.2",
|
||||||
|
@ -20778,12 +20826,13 @@
|
||||||
"@mapbox/unitbezier": "^0.0.1",
|
"@mapbox/unitbezier": "^0.0.1",
|
||||||
"@mapbox/vector-tile": "^1.3.1",
|
"@mapbox/vector-tile": "^1.3.1",
|
||||||
"@mapbox/whoots-js": "^3.1.0",
|
"@mapbox/whoots-js": "^3.1.0",
|
||||||
"@maplibre/maplibre-gl-style-spec": "^19.3.2",
|
"@maplibre/maplibre-gl-style-spec": "^20.1.1",
|
||||||
"@types/geojson": "^7946.0.11",
|
"@types/geojson": "^7946.0.14",
|
||||||
"@types/mapbox__point-geometry": "^0.1.2",
|
"@types/geojson-vt": "3.2.5",
|
||||||
"@types/mapbox__vector-tile": "^1.3.1",
|
"@types/mapbox__point-geometry": "^0.1.4",
|
||||||
"@types/pbf": "^3.0.3",
|
"@types/mapbox__vector-tile": "^1.3.4",
|
||||||
"@types/supercluster": "^7.1.1",
|
"@types/pbf": "^3.0.5",
|
||||||
|
"@types/supercluster": "^7.1.3",
|
||||||
"earcut": "^2.2.4",
|
"earcut": "^2.2.4",
|
||||||
"geojson-vt": "^3.2.1",
|
"geojson-vt": "^3.2.1",
|
||||||
"gl-matrix": "^3.4.3",
|
"gl-matrix": "^3.4.3",
|
||||||
|
@ -21568,6 +21617,22 @@
|
||||||
"pathe": "^1.0.0"
|
"pathe": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"pmtiles": {
|
||||||
|
"version": "3.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/pmtiles/-/pmtiles-3.0.5.tgz",
|
||||||
|
"integrity": "sha512-K6NxVvW/vXE3052VZKF2ppyjdyhLx41FidR5yV8L/+El+lcMJpXS0vHBSPFmjdag5zkYv2XGDdq+3VjB2K7l6w==",
|
||||||
|
"requires": {
|
||||||
|
"@types/leaflet": "^1.9.8",
|
||||||
|
"fflate": "^0.8.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"fflate": {
|
||||||
|
"version": "0.8.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz",
|
||||||
|
"integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"point-in-polygon": {
|
"point-in-polygon": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/point-in-polygon/-/point-in-polygon-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/point-in-polygon/-/point-in-polygon-1.1.0.tgz",
|
||||||
|
|
18
package.json
18
package.json
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "mapcomplete",
|
"name": "mapcomplete",
|
||||||
"version": "0.40.6",
|
"version": "0.41.0",
|
||||||
"repository": "https://github.com/pietervdvn/MapComplete",
|
"repository": "https://github.com/pietervdvn/MapComplete",
|
||||||
"description": "A small website to edit OSM easily",
|
"description": "A small website to edit OSM easily",
|
||||||
"bugs": "https://github.com/pietervdvn/MapComplete/issues",
|
"bugs": "https://github.com/pietervdvn/MapComplete/issues",
|
||||||
|
@ -40,7 +40,18 @@
|
||||||
"https://overpass.openstreetmap.ru/cgi/interpreter"
|
"https://overpass.openstreetmap.ru/cgi/interpreter"
|
||||||
],
|
],
|
||||||
"country_coder_host": "https://raw.githubusercontent.com/pietervdvn/MapComplete-data/main/latlon2country",
|
"country_coder_host": "https://raw.githubusercontent.com/pietervdvn/MapComplete-data/main/latlon2country",
|
||||||
"nominatimEndpoint": "https://geocoding.geofabrik.de/b75350b1cfc34962ac49824fe5b582dc/"
|
"nominatimEndpoint": "https://geocoding.geofabrik.de/b75350b1cfc34962ac49824fe5b582dc/",
|
||||||
|
"protomaps": {
|
||||||
|
"api-key": "2af8b969a9e8b692",
|
||||||
|
"endpoint": "https://api.protomaps.com/tiles/",
|
||||||
|
"styles": [
|
||||||
|
"https://api.protomaps.com/styles/v2/light.json",
|
||||||
|
"https://api.protomaps.com/styles/v2/dark.json",
|
||||||
|
"https://api.protomaps.com/styles/v2/white.json",
|
||||||
|
"https://api.protomaps.com/styles/v2/grayscale.json",
|
||||||
|
"https://api.protomaps.com/styles/v2/black.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "npm run generate:layeroverview && npm run strt",
|
"start": "npm run generate:layeroverview && npm run strt",
|
||||||
|
@ -145,7 +156,7 @@
|
||||||
"libphonenumber-js": "^1.10.8",
|
"libphonenumber-js": "^1.10.8",
|
||||||
"lz-string": "^1.4.4",
|
"lz-string": "^1.4.4",
|
||||||
"mangrove-reviews-typescript": "^1.1.0",
|
"mangrove-reviews-typescript": "^1.1.0",
|
||||||
"maplibre-gl": "^3.5.0",
|
"maplibre-gl": "^4.1.1",
|
||||||
"monaco-editor": "^0.46.0",
|
"monaco-editor": "^0.46.0",
|
||||||
"nano-markdown": "^1.2.2",
|
"nano-markdown": "^1.2.2",
|
||||||
"opening_hours": "^3.6.0",
|
"opening_hours": "^3.6.0",
|
||||||
|
@ -156,6 +167,7 @@
|
||||||
"pbf": "^3.2.1",
|
"pbf": "^3.2.1",
|
||||||
"pg": "^8.11.3",
|
"pg": "^8.11.3",
|
||||||
"pic4carto": "^2.1.15",
|
"pic4carto": "^2.1.15",
|
||||||
|
"pmtiles": "^3.0.5",
|
||||||
"prompt-sync": "^4.2.0",
|
"prompt-sync": "^4.2.0",
|
||||||
"qrcode-generator": "^1.4.4",
|
"qrcode-generator": "^1.4.4",
|
||||||
"showdown": "^2.1.0",
|
"showdown": "^2.1.0",
|
||||||
|
|
|
@ -900,6 +900,10 @@ video {
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mb-8 {
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
.mt-4 {
|
.mt-4 {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
|
@ -964,10 +968,6 @@ video {
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mb-8 {
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.-ml-6 {
|
.-ml-6 {
|
||||||
margin-left: -1.5rem;
|
margin-left: -1.5rem;
|
||||||
}
|
}
|
||||||
|
@ -1111,6 +1111,10 @@ video {
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.h-96 {
|
||||||
|
height: 24rem;
|
||||||
|
}
|
||||||
|
|
||||||
.h-0 {
|
.h-0 {
|
||||||
height: 0px;
|
height: 0px;
|
||||||
}
|
}
|
||||||
|
@ -1552,6 +1556,10 @@ video {
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.self-stretch {
|
||||||
|
align-self: stretch;
|
||||||
|
}
|
||||||
|
|
||||||
.justify-self-start {
|
.justify-self-start {
|
||||||
justify-self: start;
|
justify-self: start;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,10 @@ export type EliCategory =
|
||||||
| "qa"
|
| "qa"
|
||||||
| "elevation"
|
| "elevation"
|
||||||
| "other"
|
| "other"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class has grown beyond the point of only containing Raster Layers
|
||||||
|
*/
|
||||||
export interface RasterLayerProperties {
|
export interface RasterLayerProperties {
|
||||||
/**
|
/**
|
||||||
* The name of the imagery source
|
* The name of the imagery source
|
||||||
|
@ -19,7 +23,8 @@ export interface RasterLayerProperties {
|
||||||
|
|
||||||
readonly url: string
|
readonly url: string
|
||||||
readonly category?: string | EliCategory
|
readonly category?: string | EliCategory
|
||||||
readonly type?: "vector" | string
|
readonly type?: "vector" | "raster" | string
|
||||||
|
readonly style?: string,
|
||||||
|
|
||||||
readonly attribution?: {
|
readonly attribution?: {
|
||||||
readonly url?: string
|
readonly url?: string
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { ImmutableStore, Store, UIEventSource } from "../../Logic/UIEventSource"
|
import { ImmutableStore, Store, UIEventSource } from "../../Logic/UIEventSource"
|
||||||
import type { Map as MLMap } from "maplibre-gl"
|
import { Map as MLMap } from "maplibre-gl"
|
||||||
import { Map as MlMap, SourceSpecification } from "maplibre-gl"
|
import { Map as MlMap, SourceSpecification } from "maplibre-gl"
|
||||||
|
import maplibregl from "maplibre-gl";
|
||||||
import { RasterLayerPolygon } from "../../Models/RasterLayers"
|
import { RasterLayerPolygon } from "../../Models/RasterLayers"
|
||||||
import { Utils } from "../../Utils"
|
import { Utils } from "../../Utils"
|
||||||
import { BBox } from "../../Logic/BBox"
|
import { BBox } from "../../Logic/BBox"
|
||||||
|
@ -11,7 +12,7 @@ import { RasterLayerProperties } from "../../Models/RasterLayerProperties"
|
||||||
import * as htmltoimage from "html-to-image"
|
import * as htmltoimage from "html-to-image"
|
||||||
import RasterLayerHandler from "./RasterLayerHandler"
|
import RasterLayerHandler from "./RasterLayerHandler"
|
||||||
import Constants from "../../Models/Constants"
|
import Constants from "../../Models/Constants"
|
||||||
|
import { Protocol } from "pmtiles";
|
||||||
/**
|
/**
|
||||||
* The 'MapLibreAdaptor' bridges 'MapLibre' with the various properties of the `MapProperties`
|
* The 'MapLibreAdaptor' bridges 'MapLibre' with the various properties of the `MapProperties`
|
||||||
*/
|
*/
|
||||||
|
@ -46,6 +47,7 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap {
|
||||||
readonly pitch: UIEventSource<number>
|
readonly pitch: UIEventSource<number>
|
||||||
readonly useTerrain: Store<boolean>
|
readonly useTerrain: Store<boolean>
|
||||||
|
|
||||||
|
private static pmtilesInited = false
|
||||||
/**
|
/**
|
||||||
* Functions that are called when one of those actions has happened
|
* Functions that are called when one of those actions has happened
|
||||||
* @private
|
* @private
|
||||||
|
@ -55,6 +57,10 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap {
|
||||||
private readonly _maplibreMap: Store<MLMap>
|
private readonly _maplibreMap: Store<MLMap>
|
||||||
|
|
||||||
constructor(maplibreMap: Store<MLMap>, state?: Partial<MapProperties>) {
|
constructor(maplibreMap: Store<MLMap>, state?: Partial<MapProperties>) {
|
||||||
|
if(!MapLibreAdaptor.pmtilesInited){
|
||||||
|
maplibregl.addProtocol("pmtiles",new Protocol().tile);
|
||||||
|
MapLibreAdaptor.pmtilesInited = true
|
||||||
|
}
|
||||||
this._maplibreMap = maplibreMap
|
this._maplibreMap = maplibreMap
|
||||||
|
|
||||||
this.location = state?.location ?? new UIEventSource(undefined)
|
this.location = state?.location ?? new UIEventSource(undefined)
|
||||||
|
@ -103,6 +109,7 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap {
|
||||||
}
|
}
|
||||||
|
|
||||||
maplibreMap.addCallbackAndRunD((map) => {
|
maplibreMap.addCallbackAndRunD((map) => {
|
||||||
|
|
||||||
map.on("load", () => {
|
map.on("load", () => {
|
||||||
self.MoveMapToCurrentLoc(self.location.data)
|
self.MoveMapToCurrentLoc(self.location.data)
|
||||||
self.SetZoom(self.zoom.data)
|
self.SetZoom(self.zoom.data)
|
||||||
|
@ -212,7 +219,7 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static prepareWmsSource(layer: RasterLayerProperties): SourceSpecification {
|
public static prepareWmsSource(layer: RasterLayerProperties): SourceSpecification {
|
||||||
return RasterLayerHandler.prepareWmsSource(layer)
|
return RasterLayerHandler.prepareSource(layer)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import { Map as MLMap, SourceSpecification } from "maplibre-gl"
|
import { Map as MLMap, RasterSourceSpecification, VectorTileSource } from "maplibre-gl"
|
||||||
import { Store, Stores, UIEventSource } from "../../Logic/UIEventSource"
|
import { Store, Stores, UIEventSource } from "../../Logic/UIEventSource"
|
||||||
import { RasterLayerPolygon } from "../../Models/RasterLayers"
|
import { RasterLayerPolygon } from "../../Models/RasterLayers"
|
||||||
import { RasterLayerProperties } from "../../Models/RasterLayerProperties"
|
import { RasterLayerProperties } from "../../Models/RasterLayerProperties"
|
||||||
import { Utils } from "../../Utils"
|
import { Utils } from "../../Utils"
|
||||||
|
import { VectorSourceSpecification } from "@maplibre/maplibre-gl-style-spec"
|
||||||
|
|
||||||
class SingleBackgroundHandler {
|
class SingleBackgroundHandler {
|
||||||
// Value between 0 and 1.0
|
// Value between 0 and 1.0
|
||||||
|
@ -17,6 +18,7 @@ class SingleBackgroundHandler {
|
||||||
*/
|
*/
|
||||||
public static readonly DEACTIVATE_AFTER = 60
|
public static readonly DEACTIVATE_AFTER = 60
|
||||||
private fadeStep = 0.1
|
private fadeStep = 0.1
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
map: Store<MLMap>,
|
map: Store<MLMap>,
|
||||||
targetLayer: RasterLayerPolygon,
|
targetLayer: RasterLayerPolygon,
|
||||||
|
@ -75,6 +77,7 @@ class SingleBackgroundHandler {
|
||||||
this.fadeIn()
|
this.fadeIn()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async awaitStyleIsLoaded(): Promise<void> {
|
private async awaitStyleIsLoaded(): Promise<void> {
|
||||||
const map = this._map.data
|
const map = this._map.data
|
||||||
if (!map) {
|
if (!map) {
|
||||||
|
@ -89,7 +92,7 @@ class SingleBackgroundHandler {
|
||||||
let ttl = 15
|
let ttl = 15
|
||||||
await this.awaitStyleIsLoaded()
|
await this.awaitStyleIsLoaded()
|
||||||
while (!this.tryEnable() && ttl > 0) {
|
while (!this.tryEnable() && ttl > 0) {
|
||||||
ttl --;
|
ttl--
|
||||||
await Utils.waitFor(250)
|
await Utils.waitFor(250)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,9 +113,10 @@ class SingleBackgroundHandler {
|
||||||
// The background layer is already an OSM-based map or another map, so we don't want anything from the baselayer
|
// The background layer is already an OSM-based map or another map, so we don't want anything from the baselayer
|
||||||
addLayerBeforeId = undefined
|
addLayerBeforeId = undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!map.getSource(background.id)) {
|
if (!map.getSource(background.id)) {
|
||||||
try {
|
try {
|
||||||
map.addSource(background.id, RasterLayerHandler.prepareWmsSource(background))
|
map.addSource(background.id, RasterLayerHandler.prepareSource(background))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -122,22 +126,26 @@ class SingleBackgroundHandler {
|
||||||
.getStyle()
|
.getStyle()
|
||||||
.layers.find((l) => l.id.startsWith("mapcomplete_"))?.id
|
.layers.find((l) => l.id.startsWith("mapcomplete_"))?.id
|
||||||
|
|
||||||
|
if (background.type === "vector") {
|
||||||
|
map.setStyle(background["style"])
|
||||||
|
} else {
|
||||||
|
|
||||||
map.addLayer(
|
map.addLayer(
|
||||||
{
|
{
|
||||||
id: background.id,
|
id: background.id,
|
||||||
type: "raster",
|
type: "raster",
|
||||||
source: background.id,
|
source: background.id,
|
||||||
paint: {
|
paint: {
|
||||||
"raster-opacity": 0,
|
"raster-opacity": 0
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
addLayerBeforeId
|
addLayerBeforeId
|
||||||
)
|
)
|
||||||
|
|
||||||
this.opacity.addCallbackAndRun((o) => {
|
this.opacity.addCallbackAndRun((o) => {
|
||||||
map.setPaintProperty(background.id, "raster-opacity", o)
|
map.setPaintProperty(background.id, "raster-opacity", o)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +176,14 @@ export default class RasterLayerHandler {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public static prepareWmsSource(layer: RasterLayerProperties): SourceSpecification {
|
public static prepareSource(layer: RasterLayerProperties): RasterSourceSpecification | VectorSourceSpecification {
|
||||||
|
if (layer.type === "vector") {
|
||||||
|
const vs: VectorSourceSpecification = {
|
||||||
|
type: "vector",
|
||||||
|
url: layer.url
|
||||||
|
}
|
||||||
|
return vs
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
type: "raster",
|
type: "raster",
|
||||||
// use the tiles option to specify a 256WMS tile source URL
|
// use the tiles option to specify a 256WMS tile source URL
|
||||||
|
@ -178,7 +193,7 @@ export default class RasterLayerHandler {
|
||||||
minzoom: layer["min_zoom"] ?? 1,
|
minzoom: layer["min_zoom"] ?? 1,
|
||||||
maxzoom: layer["max_zoom"] ?? 25,
|
maxzoom: layer["max_zoom"] ?? 25,
|
||||||
// Bit of a hack, but seems to work
|
// Bit of a hack, but seems to work
|
||||||
scheme: layer.url.includes("{-y}") ? "tms" : "xyz",
|
scheme: layer.url.includes("{-y}") ? "tms" : "xyz"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +207,7 @@ export default class RasterLayerHandler {
|
||||||
"{width}": "" + size,
|
"{width}": "" + size,
|
||||||
"{height}": "" + size,
|
"{height}": "" + size,
|
||||||
"{zoom}": "{z}",
|
"{zoom}": "{z}",
|
||||||
"{-y}": "{y}",
|
"{-y}": "{y}"
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const key in toReplace) {
|
for (const key in toReplace) {
|
||||||
|
|
|
@ -88,7 +88,8 @@
|
||||||
"text": "Stamen/Stadiamaps",
|
"text": "Stamen/Stadiamaps",
|
||||||
"url": "https://stadiamaps.com/"
|
"url": "https://stadiamaps.com/"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"name": "Stamen Watercolor",
|
"name": "Stamen Watercolor",
|
||||||
"url": "https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?key=14c5a900-7137-42f7-9cb9-fff0f4696f75",
|
"url": "https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?key=14c5a900-7137-42f7-9cb9-fff0f4696f75",
|
||||||
"category": "osmbasedmap",
|
"category": "osmbasedmap",
|
||||||
|
@ -142,8 +143,6 @@
|
||||||
"url": "https://carto.com/"
|
"url": "https://carto.com/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"url": "https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json?key=eyJhbGciOiJIUzI1NiJ9.eyJhIjoiYWNfdW4ybmhlbTciLCJqdGkiOiIwZGQxNjJmNyJ9.uATJpa6QcrtXhph3Bzvk2nX3QsxEw-Q8dj5khUG6hGk",
|
"url": "https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json?key=eyJhbGciOiJIUzI1NiJ9.eyJhIjoiYWNfdW4ybmhlbTciLCJqdGkiOiIwZGQxNjJmNyJ9.uATJpa6QcrtXhph3Bzvk2nX3QsxEw-Q8dj5khUG6hGk",
|
||||||
"name": "Carto Positron (no labels)",
|
"name": "Carto Positron (no labels)",
|
||||||
|
@ -176,6 +175,66 @@
|
||||||
"text": "<a href=\"https://carto.com/about-carto/\" target=\"_blank\" rel=\"noopener\">CARTO</a>",
|
"text": "<a href=\"https://carto.com/about-carto/\" target=\"_blank\" rel=\"noopener\">CARTO</a>",
|
||||||
"url": "https://carto.com/"
|
"url": "https://carto.com/"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "pmtiles://https://api.protomaps.com/tiles/v3/{z}/{x}/{y}.mvt?key=2af8b969a9e8b692",
|
||||||
|
"style": "https://api.protomaps.com/styles/v2/white.json?key=2af8b969a9e8b692",
|
||||||
|
"id": "protomaps.white",
|
||||||
|
"name": "Protomaps White",
|
||||||
|
"type": "vector",
|
||||||
|
"category": "osmbasedmap",
|
||||||
|
"attribution": {
|
||||||
|
"text": "Protomaps",
|
||||||
|
"url": "https://protomaps.com/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "pmtiles://https://api.protomaps.com/tiles/v3/{z}/{x}/{y}.mvt?key=2af8b969a9e8b692",
|
||||||
|
"style": "https://api.protomaps.com/styles/v2/light.json?key=2af8b969a9e8b692",
|
||||||
|
"id": "protomaps.light",
|
||||||
|
"name": "Protomaps Light",
|
||||||
|
"type": "vector",
|
||||||
|
"category": "osmbasedmap",
|
||||||
|
"attribution": {
|
||||||
|
"text": "Protomaps",
|
||||||
|
"url": "https://protomaps.com/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "pmtiles://https://api.protomaps.com/tiles/v3/{z}/{x}/{y}.mvt?key=2af8b969a9e8b692",
|
||||||
|
"style": "https://api.protomaps.com/styles/v2/grayscale.json?key=2af8b969a9e8b692",
|
||||||
|
"id": "protomaps.grayscale",
|
||||||
|
"name": "Protomaps Grayscale",
|
||||||
|
"type": "vector",
|
||||||
|
"category": "osmbasedmap",
|
||||||
|
"attribution": {
|
||||||
|
"text": "Protomaps",
|
||||||
|
"url": "https://protomaps.com/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "pmtiles://https://api.protomaps.com/tiles/v3/{z}/{x}/{y}.mvt?key=2af8b969a9e8b692",
|
||||||
|
"style": "https://api.protomaps.com/styles/v2/dark.json?key=2af8b969a9e8b692",
|
||||||
|
"id": "protomaps.dark",
|
||||||
|
"name": "Protomaps Dark",
|
||||||
|
"type": "vector",
|
||||||
|
"category": "osmbasedmap",
|
||||||
|
"attribution": {
|
||||||
|
"text": "Protomaps",
|
||||||
|
"url": "https://protomaps.com/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "pmtiles://https://api.protomaps.com/tiles/v3/{z}/{x}/{y}.mvt?key=2af8b969a9e8b692",
|
||||||
|
"style": "https://api.protomaps.com/styles/v2/black.json?key=2af8b969a9e8b692",
|
||||||
|
"id": "protomaps.black",
|
||||||
|
"name": "Protomaps Black",
|
||||||
|
"type": "vector",
|
||||||
|
"category": "osmbasedmap",
|
||||||
|
"attribution": {
|
||||||
|
"text": "Protomaps",
|
||||||
|
"url": "https://protomaps.com/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Small tests</title>
|
<title>Small tests</title>
|
||||||
<link href="index.css" rel="stylesheet"/>
|
|
||||||
<link href="./index.css" rel="stylesheet"/>
|
|
||||||
<link href="./css/tabbedComponent.css" rel="stylesheet"/>
|
|
||||||
<link href="./css/mobile.css" rel="stylesheet"/>
|
<link href="./css/mobile.css" rel="stylesheet"/>
|
||||||
<link href="./css/openinghourstable.css" rel="stylesheet"/>
|
<link href="./css/openinghourstable.css" rel="stylesheet"/>
|
||||||
<link href="./css/tagrendering.css" rel="stylesheet"/>
|
<link href="./css/tagrendering.css" rel="stylesheet"/>
|
||||||
|
|
Loading…
Reference in a new issue