Merge develop

This commit is contained in:
Pieter Vander Vennet 2024-03-21 23:37:36 +01:00
commit 5ce9292215
16 changed files with 384 additions and 168 deletions

View file

@ -5,7 +5,8 @@
"nl": "Velopark naar OpenStreetMap sync tool" "nl": "Velopark naar OpenStreetMap sync tool"
}, },
"mustHaveLanguage": [ "mustHaveLanguage": [
"nl", "en" "nl",
"en"
], ],
"description": { "description": {
"en": "<p><a href='https://velopark.be' target='_blank'>Velopark.be</a> is a website collecting data about bicycle parkings in a semi-crowdsourced way. However, only 'authorized' instances are allowed to make changes there, in practice the operator of the bicycle parking such as SNCB, de Lijn or the municipality. They have now decided to synchronize their dataset with OpenStreetMap, and this MapComplete-instance is set up to help link and import their data into OpenStreetMap.</p> How to use: <ul><li>A velopark-icon on the map (yellow with bicycle silhouette) represents a bicycle known by Velopark but not yet known by OpenStreetMap</li><li>Blue pins are bicycle parkings known by OpenStreetMap</li><li>Light blue pins are bicycle parkings known by OpenStreetMap with a reference to Velopark.be (<span class='literal-code'>ref-velopark=*</span>)</li><li>Click a velopark item, you can either link it with a nearby OSM-bicycle parking or create a new bicycle parking. Note that the geometry of Velopark is often incorrect and can be a few up till 100 meters away from the actual bicycle parking. Use aerial imagery, linked images and streetview to determine the correct location</li><li>Once linked, you can compare the Velopark- and OSM-attributes and apply correct attributes</li><li>If Velopark has an image, you can also link the image</li></ul> That's it! Thanks for helping to import this!", "en": "<p><a href='https://velopark.be' target='_blank'>Velopark.be</a> is a website collecting data about bicycle parkings in a semi-crowdsourced way. However, only 'authorized' instances are allowed to make changes there, in practice the operator of the bicycle parking such as SNCB, de Lijn or the municipality. They have now decided to synchronize their dataset with OpenStreetMap, and this MapComplete-instance is set up to help link and import their data into OpenStreetMap.</p> How to use: <ul><li>A velopark-icon on the map (yellow with bicycle silhouette) represents a bicycle known by Velopark but not yet known by OpenStreetMap</li><li>Blue pins are bicycle parkings known by OpenStreetMap</li><li>Light blue pins are bicycle parkings known by OpenStreetMap with a reference to Velopark.be (<span class='literal-code'>ref-velopark=*</span>)</li><li>Click a velopark item, you can either link it with a nearby OSM-bicycle parking or create a new bicycle parking. Note that the geometry of Velopark is often incorrect and can be a few up till 100 meters away from the actual bicycle parking. Use aerial imagery, linked images and streetview to determine the correct location</li><li>Once linked, you can compare the Velopark- and OSM-attributes and apply correct attributes</li><li>If Velopark has an image, you can also link the image</li></ul> That's it! Thanks for helping to import this!",

207
package-lock.json generated
View file

@ -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": "*"
} }
@ -7445,9 +7462,9 @@
"dev": true "dev": true
}, },
"node_modules/follow-redirects": { "node_modules/follow-redirects": {
"version": "1.15.4", "version": "1.15.6",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
"integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
"funding": [ "funding": [
{ {
"type": "individual", "type": "individual",
@ -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": "*"
} }
@ -19481,9 +19529,9 @@
"dev": true "dev": true
}, },
"follow-redirects": { "follow-redirects": {
"version": "1.15.4", "version": "1.15.6",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
"integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==" "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA=="
}, },
"for-each": { "for-each": {
"version": "0.3.3", "version": "0.3.3",
@ -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",

View file

@ -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",

View file

@ -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;
} }

View file

@ -139,9 +139,9 @@ class GenerateLayouts extends Script {
id: "icon", id: "icon",
transform: `translate(${cx - r},${cy - r}) scale(${ transform: `translate(${cx - r},${cy - r}) scale(${
(r * 2) / Number(width) (r * 2) / Number(width)
}) `, }) `
}, },
g: [svg], g: [svg]
} }
}, },
(mightBeTokenToReplace) => { (mightBeTokenToReplace) => {
@ -202,19 +202,19 @@ class GenerateLayouts extends Script {
icons.push({ icons.push({
src: name, src: name,
sizes: size + "x" + size, sizes: size + "x" + size,
type: "image/png", type: "image/png"
}) })
} }
icons.push({ icons.push({
src: path, src: path,
sizes: "513x513", sizes: "513x513",
type: "image/svg", type: "image/svg"
}) })
} else if (icon.endsWith(".png")) { } else if (icon.endsWith(".png")) {
icons.push({ icons.push({
src: icon, src: icon,
sizes: "513x513", sizes: "513x513",
type: "image/png", type: "image/png"
}) })
} else { } else {
console.log(icon) console.log(icon)
@ -233,11 +233,11 @@ class GenerateLayouts extends Script {
description: ogDescr, description: ogDescr,
orientation: "portrait-primary, landscape-primary", orientation: "portrait-primary, landscape-primary",
icons: icons, icons: icons,
categories: ["map", "navigation"], categories: ["map", "navigation"]
} }
return { return {
manifest, manifest,
whiteIcons, whiteIcons
} }
} }
@ -261,7 +261,7 @@ class GenerateLayouts extends Script {
const rasterLayers = [ const rasterLayers = [
AvailableRasterLayers.maptilerDefaultLayer, AvailableRasterLayers.maptilerDefaultLayer,
...eli.features, ...eli.features,
...eli_global.layers.map((properties) => ({ properties })), ...eli_global.layers.map((properties) => ({ properties }))
] ]
for (const feature of rasterLayers) { for (const feature of rasterLayers) {
const f = <RasterLayerPolygon>feature const f = <RasterLayerPolygon>feature
@ -277,8 +277,15 @@ class GenerateLayouts extends Script {
if (f.properties.type === "vector") { if (f.properties.type === "vector") {
// We also need to whitelist eventual sources // We also need to whitelist eventual sources
const styleSpec = await Utils.downloadJsonCached(f.properties.url, 1000 * 120) let url = f.properties.url
for (const key of Object.keys(styleSpec.sources)) { if (url.startsWith("pmtiles://")) {
url = url.substring("pmtiles://".length)
}
const styleSpec = await Utils.downloadJsonCached(url, 1000 * 120, {
Origin: "https://mapcomplete.org"
})
urls.push(...(f.properties["connect-src"]??[]))
for (const key of Object.keys(styleSpec?.sources ?? {})) {
const url = styleSpec.sources[key].url const url = styleSpec.sources[key].url
if (!url) { if (!url) {
continue continue
@ -290,7 +297,9 @@ class GenerateLayouts extends Script {
console.log("Source url ", key, url) console.log("Source url ", key, url)
urls.push(url) urls.push(url)
if (urlClipped.endsWith(".json")) { if (urlClipped.endsWith(".json")) {
const tileInfo = await Utils.downloadJsonCached(url, 1000 * 120) const tileInfo = await Utils.downloadJsonCached(url, 1000 * 120, {
Origin: "https://mapcomplete.org"
})
urls.push(tileInfo["tiles"] ?? []) urls.push(tileInfo["tiles"] ?? [])
} }
} }
@ -317,7 +326,7 @@ class GenerateLayouts extends Script {
"https://www.openstreetmap.org", "https://www.openstreetmap.org",
"https://api.openstreetmap.org", "https://api.openstreetmap.org",
"https://pietervdvn.goatcounter.com", "https://pietervdvn.goatcounter.com",
"https://cache.mapcomplete.org", "https://cache.mapcomplete.org"
].concat(...(await this.eliUrls())) ].concat(...(await this.eliUrls()))
SpecialVisualizations.specialVisualizations.forEach((sv) => { SpecialVisualizations.specialVisualizations.forEach((sv) => {
@ -354,9 +363,17 @@ class GenerateLayouts extends Script {
const eliLayers: RasterLayerPolygon[] = AvailableRasterLayers.layersAvailableAt( const eliLayers: RasterLayerPolygon[] = AvailableRasterLayers.layersAvailableAt(
new ImmutableStore({ lon: 0, lat: 0 }) new ImmutableStore({ lon: 0, lat: 0 })
).data ).data
{
const vectorLayers = eliLayers.filter((l) => l.properties.type === "vector") const vectorLayers = eliLayers.filter((l) => l.properties.type === "vector")
const vectorSources = vectorLayers.map((l) => l.properties.url) const vectorSources = vectorLayers.map((l) => l.properties.url)
apiUrls.push(...vectorSources) vectorSources.push(...vectorLayers.map((l) => l.properties.style))
apiUrls.push(...vectorSources.map(url => {
if (url?.startsWith("pmtiles://")) {
return url.substring("pmtiles://".length)
}
return url
}))
}
for (let connectSource of apiUrls.concat(geojsonSources)) { for (let connectSource of apiUrls.concat(geojsonSources)) {
if (!connectSource) { if (!connectSource) {
continue continue
@ -400,8 +417,8 @@ class GenerateLayouts extends Script {
"script-src": [ "script-src": [
"'self'", "'self'",
"https://gc.zgo.at/count.js", "https://gc.zgo.at/count.js",
...(options?.scriptSrcs?.map((s) => "'" + s + "'") ?? []), ...(options?.scriptSrcs?.map((s) => "'" + s + "'") ?? [])
].join(" "), ].join(" ")
} }
const content = Object.keys(csp) const content = Object.keys(csp)
.map((k) => k + " " + csp[k]) .map((k) => k + " " + csp[k])
@ -409,7 +426,7 @@ class GenerateLayouts extends Script {
return [ return [
`<meta http-equiv ="Report-To" content='{"group":"csp-endpoint", "max_age": 86400,"endpoints": [\{"url": "https://report.mapcomplete.org/csp"}], "include_subdomains": true}'>`, `<meta http-equiv ="Report-To" content='{"group":"csp-endpoint", "max_age": 86400,"endpoints": [\{"url": "https://report.mapcomplete.org/csp"}], "include_subdomains": true}'>`,
`<meta http-equiv="Content-Security-Policy" content="${content}">`, `<meta http-equiv="Content-Security-Policy" content="${content}">`
].join("\n") ].join("\n")
} }
@ -421,12 +438,12 @@ class GenerateLayouts extends Script {
) { ) {
Locale.language.setData(layout.language[0]) Locale.language.setData(layout.language[0])
const targetLanguage = layout.language[0] const targetLanguage = layout.language[0]
const ogTitle = Translations.T(layout.title).textFor(targetLanguage).replace(/"/g, '\\"') const ogTitle = Translations.T(layout.title).textFor(targetLanguage).replace(/"/g, "\\\"")
const ogDescr = Translations.T( const ogDescr = Translations.T(
layout.shortDescription ?? "Easily add and edit geodata with OpenStreetMap" layout.shortDescription ?? "Easily add and edit geodata with OpenStreetMap"
) )
.textFor(targetLanguage) .textFor(targetLanguage)
.replace(/"/g, '\\"') .replace(/"/g, "\\\"")
let ogImage = layout.socialImage let ogImage = layout.socialImage
let twitterImage = ogImage let twitterImage = ogImage
if (ogImage === LayoutConfig.defaultSocialImage && layout.official) { if (ogImage === LayoutConfig.defaultSocialImage && layout.official) {
@ -485,7 +502,7 @@ class GenerateLayouts extends Script {
og, og,
customCss, customCss,
`<link rel="icon" href="${icon}" sizes="any" type="image/svg+xml">`, `<link rel="icon" href="${icon}" sizes="any" type="image/svg+xml">`,
...apple_icons, ...apple_icons
].join("\n") ].join("\n")
let branchname = await this.getBranchName() let branchname = await this.getBranchName()
@ -508,7 +525,7 @@ class GenerateLayouts extends Script {
.replace( .replace(
/<!-- CSP -->/, /<!-- CSP -->/,
await this.generateCsp(layout, layoutJson, { await this.generateCsp(layout, layoutJson, {
scriptSrcs: [this.removeOtherLanguagesHash], scriptSrcs: [this.removeOtherLanguagesHash]
}) })
) )
.replace( .replace(
@ -517,7 +534,7 @@ class GenerateLayouts extends Script {
) )
.replace( .replace(
/<!-- IMAGE-START -->.*<!-- IMAGE-END -->/s, /<!-- IMAGE-START -->.*<!-- IMAGE-END -->/s,
"<img class='p-0 mb-8 h-32 w-32 self-start' src='" + icon + "' />" "<img class='p-0 h-32 w-32 self-start' src='" + icon + "' />"
) )
.replace( .replace(
/.*\/src\/index\.ts.*/, /.*\/src\/index\.ts.*/,
@ -539,7 +556,7 @@ class GenerateLayouts extends Script {
const imports = [ const imports = [
`import layout from "./src/assets/generated/themes/${theme.id}.json"`, `import layout from "./src/assets/generated/themes/${theme.id}.json"`,
`import { ThemeMetaTagging } from "./src/assets/generated/metatagging/${theme.id}"`, `import { ThemeMetaTagging } from "./src/assets/generated/metatagging/${theme.id}"`
] ]
for (const layerName of Constants.added_by_default) { for (const layerName of Constants.added_by_default) {
imports.push( imports.push(
@ -586,7 +603,7 @@ class GenerateLayouts extends Script {
"account", "account",
"openstreetmap", "openstreetmap",
"custom", "custom",
"theme", "theme"
] ]
// @ts-ignore // @ts-ignore
const all: LayoutConfigJson[] = all_known_layouts.themes const all: LayoutConfigJson[] = all_known_layouts.themes
@ -638,7 +655,7 @@ class GenerateLayouts extends Script {
startLon: 0, startLon: 0,
startZoom: 0, startZoom: 0,
title: { en: "MapComplete" }, title: { en: "MapComplete" },
description: { en: "A thematic map viewer and editor based on OpenStreetMap" }, description: { en: "A thematic map viewer and editor based on OpenStreetMap" }
}), }),
alreadyWritten alreadyWritten
) )

View file

@ -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

View file

@ -55,6 +55,9 @@ export class AvailableRasterLayers {
url: url:
"https://api.maptiler.com/maps/15cc8f61-0353-4be6-b8da-13daea5f7432/style.json?key=" + "https://api.maptiler.com/maps/15cc8f61-0353-4be6-b8da-13daea5f7432/style.json?key=" +
Constants.maptilerApiKey, Constants.maptilerApiKey,
style:
"https://api.maptiler.com/maps/15cc8f61-0353-4be6-b8da-13daea5f7432/style.json?key=" +
Constants.maptilerApiKey,
category: "osmbasedmap", category: "osmbasedmap",
id: "maptiler", id: "maptiler",
type: "vector", type: "vector",

View file

@ -6,7 +6,6 @@
import Constants from "../../Models/Constants" import Constants from "../../Models/Constants"
import type { LayoutInformation } from "../../Models/ThemeConfig/LayoutConfig" import type { LayoutInformation } from "../../Models/ThemeConfig/LayoutConfig"
import Tr from "../Base/Tr.svelte" import Tr from "../Base/Tr.svelte"
import SubtleLink from "../Base/SubtleLink.svelte"
import Translations from "../i18n/Translations" import Translations from "../i18n/Translations"
import { LocalStorageSource } from "../../Logic/Web/LocalStorageSource" import { LocalStorageSource } from "../../Logic/Web/LocalStorageSource"
@ -86,8 +85,10 @@
</script> </script>
{#if theme.id !== personal.id || $unlockedPersonal} {#if theme.id !== personal.id || $unlockedPersonal}
<SubtleLink href={$href} options={{ extraClasses: "w-full" }}> <a
<img slot="image" src={theme.icon} class="m-1 mr-2 block h-11 w-11 sm:m-2 sm:mr-4" alt="" /> class={"w-full button text-ellipsis"}
href={$href}
> <img src={theme.icon} class="m-1 mr-2 block h-11 w-11 sm:m-2 sm:mr-4" alt="" />
<span class="flex flex-col overflow-hidden text-ellipsis"> <span class="flex flex-col overflow-hidden text-ellipsis">
<Tr t={title} /> <Tr t={title} />
@ -96,6 +97,5 @@
<Tr t={Translations.t.general.morescreen.enterToOpen} /> <Tr t={Translations.t.general.morescreen.enterToOpen} />
</span> </span>
{/if} {/if}
</span> </span></a>
</SubtleLink>
{/if} {/if}

View file

@ -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)
} }
/** /**

View file

@ -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 { AvailableRasterLayers, 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,30 @@ 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 ?? background.url)
} 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) => {
try{
map.setPaintProperty(background.id, "raster-opacity", o) map.setPaintProperty(background.id, "raster-opacity", o)
}catch (e) {
console.debug("Could not set raster-opacity of", background.id)
return true // This layer probably doesn't exist anymore, so we unregister
}
}) })
} }
}
return true return true
} }
@ -168,7 +180,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 +197,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 +211,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) {

File diff suppressed because one or more lines are too long

View file

@ -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,71 @@
"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.json?key=2af8b969a9e8b692",
"style": "https://api.protomaps.com/styles/v2/white.json?key=2af8b969a9e8b692",
"connect-src": ["https://protomaps.github.io"],
"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.json?key=2af8b969a9e8b692",
"style": "https://api.protomaps.com/styles/v2/light.json?key=2af8b969a9e8b692",
"connect-src": ["https://protomaps.github.io"],
"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.json?key=2af8b969a9e8b692",
"connect-src": ["https://protomaps.github.io"],
"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.json?key=2af8b969a9e8b692",
"connect-src": ["https://protomaps.github.io"],
"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.json?key=2af8b969a9e8b692",
"style": "https://api.protomaps.com/styles/v2/black.json?key=2af8b969a9e8b692",
"connect-src": ["https://protomaps.github.io"],
"id": "protomaps.black",
"name": "Protomaps Black",
"type": "vector",
"category": "osmbasedmap",
"attribution": {
"text": "Protomaps",
"url": "https://protomaps.com/"
}
} }
] ]
} }

View file

@ -44,6 +44,9 @@ async function main() {
const state = new ThemeViewState(layout, availableLayers) const state = new ThemeViewState(layout, availableLayers)
const main = new SvelteUIElement(ThemeViewGUI, { state }) const main = new SvelteUIElement(ThemeViewGUI, { state })
main.AttachTo("maindiv") main.AttachTo("maindiv")
Array.from(document.getElementsByClassName("delete-on-load")).forEach(el => {
el.parentElement.removeChild(el)
})
} catch (err) { } catch (err) {
console.error("Error while initializing: ", err, err.stack) console.error("Error while initializing: ", err, err.stack)
const customDefinition = DetermineLayout.getCustomDefinition() const customDefinition = DetermineLayout.getCustomDefinition()

View file

@ -39,6 +39,9 @@ async function main() {
const state = new ThemeViewState(new LayoutConfig(<any> layout), availableLayers) const state = new ThemeViewState(new LayoutConfig(<any> layout), availableLayers)
const main = new SvelteUIElement(ThemeViewGUI, { state }) const main = new SvelteUIElement(ThemeViewGUI, { state })
main.AttachTo("maindiv") main.AttachTo("maindiv")
Array.from(document.getElementsByClassName("delete-on-load")).forEach(el => {
el.parentElement.removeChild(el)
})
} }
} }
main() main()

View file

@ -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"/>

View file

@ -68,7 +68,12 @@
</p> </p>
</div> </div>
<div class="flex justify-between items-end w-full">
</div>
</div>
</div>
<div class="flex justify-between items-end w-full absolute bottom-0 p-4 h-fit delete-on-load">
<!-- IMAGE-START --> <!-- IMAGE-START -->
<img aria-hidden="true" class="p-4 h-32 w-32 self-start" src="./assets/svg/add.svg"> <img aria-hidden="true" class="p-4 h-32 w-32 self-start" src="./assets/svg/add.svg">
@ -78,9 +83,7 @@
</div> </div>
</div> </div>
</div>
</div>
</div>
<div aria-hidden="true" id="belowmap" class="absolute top-0 left-0 -z-10">Below</div> <div aria-hidden="true" id="belowmap" class="absolute top-0 left-0 -z-10">Below</div>
<script src="./src/UI/RemoveOtherLanguages.ts" type="module"></script> <script src="./src/UI/RemoveOtherLanguages.ts" type="module"></script>
<script async src="./src/InstallServiceWorker.ts" type="module"></script> <script async src="./src/InstallServiceWorker.ts" type="module"></script>