@trailstash/ultra 4.2.6 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +1 -2
- package/build-examples-images.js +3 -2
- package/components/map-popup.js +10 -1
- package/components/style-picker.js +10 -9
- package/docs/style.md +2 -2
- package/lib/sprites.js +5 -2
- package/package.json +2 -2
package/.gitlab-ci.yml
CHANGED
package/build-examples-images.js
CHANGED
|
@@ -10,7 +10,7 @@ const {
|
|
|
10
10
|
width,
|
|
11
11
|
waitTime,
|
|
12
12
|
output,
|
|
13
|
-
} = minimist(process.argv.slice(2))
|
|
13
|
+
} = minimist(process.argv.slice(2));
|
|
14
14
|
|
|
15
15
|
const browser = await puppeteer.launch({ headless: true });
|
|
16
16
|
|
|
@@ -50,7 +50,8 @@ async function createImage(exampleName) {
|
|
|
50
50
|
console.log(`Timed out waiting for map load on ${exampleName}.`);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
const filename =
|
|
53
|
+
const filename =
|
|
54
|
+
output || `./docs/assets/${exampleName.replace(".ultra", ".png")}`;
|
|
54
55
|
|
|
55
56
|
await page
|
|
56
57
|
.screenshot({
|
package/components/map-popup.js
CHANGED
|
@@ -51,7 +51,16 @@ export class MapPopup extends HTMLElement {
|
|
|
51
51
|
this.template,
|
|
52
52
|
this.contextBuilder(f),
|
|
53
53
|
);
|
|
54
|
-
div.appendChild(
|
|
54
|
+
div.appendChild(
|
|
55
|
+
h(
|
|
56
|
+
"div",
|
|
57
|
+
{},
|
|
58
|
+
DOMPurify.sanitize(html, {
|
|
59
|
+
ALLOWED_URI_REGEXP:
|
|
60
|
+
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|geo):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,
|
|
61
|
+
}),
|
|
62
|
+
),
|
|
63
|
+
);
|
|
55
64
|
}
|
|
56
65
|
shadow.appendChild(div);
|
|
57
66
|
}
|
|
@@ -70,7 +70,10 @@ export class StylePicker extends HTMLElement {
|
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
const div = h("div", {
|
|
73
|
+
const div = h("div", {
|
|
74
|
+
slot: "modal-content",
|
|
75
|
+
style: "max-width: 1055px;",
|
|
76
|
+
});
|
|
74
77
|
const button = h(
|
|
75
78
|
"button-modal",
|
|
76
79
|
{ text: "Pick Style", icon: "paintbrush" },
|
|
@@ -83,18 +86,16 @@ export class StylePicker extends HTMLElement {
|
|
|
83
86
|
if (!stylesByProvider[provider]) {
|
|
84
87
|
stylesByProvider[provider] = [];
|
|
85
88
|
}
|
|
86
|
-
stylesByProvider[provider].push({name, value});
|
|
89
|
+
stylesByProvider[provider].push({ name, value });
|
|
87
90
|
}
|
|
88
91
|
for (const [provider, styles] of Object.entries(stylesByProvider)) {
|
|
89
|
-
const div2 = h("div", {
|
|
92
|
+
const div2 = h("div", {
|
|
93
|
+
style: "display:inline-block;margin-right:1.25em;",
|
|
94
|
+
});
|
|
90
95
|
div.appendChild(div2);
|
|
91
96
|
div2.appendChild(h("h3", {}, provider));
|
|
92
|
-
for (const {name, value} of styles) {
|
|
93
|
-
const styleButton = h(
|
|
94
|
-
"button",
|
|
95
|
-
{},
|
|
96
|
-
name,
|
|
97
|
-
);
|
|
97
|
+
for (const { name, value } of styles) {
|
|
98
|
+
const styleButton = h("button", {}, name);
|
|
98
99
|
styleButton.addEventListener("click", (e) => {
|
|
99
100
|
button.toggle();
|
|
100
101
|
this.dispatchEvent(
|
package/docs/style.md
CHANGED
|
@@ -89,11 +89,11 @@ In order to place your layers below existing style layers, you can use the `befo
|
|
|
89
89
|
|
|
90
90
|
[Example](./Examples/bike-infra.md)
|
|
91
91
|
|
|
92
|
-
##
|
|
92
|
+
## sprites via HTTPS
|
|
93
93
|
|
|
94
94
|
In order to facilitate adding icons to the map that don't exist in the basemap's
|
|
95
95
|
[sprites](),
|
|
96
|
-
if `icon-image` is set to an HTTPS URL to
|
|
96
|
+
if `icon-image` is set to an HTTPS URL to an image, Ultra will automatically download
|
|
97
97
|
it and add it to the Map's images.
|
|
98
98
|
|
|
99
99
|
[Example](./MapLibre-Examples/add-image.md)
|
package/lib/sprites.js
CHANGED
|
@@ -4,8 +4,11 @@ export const handleStyleImageMissing = async (ev) => {
|
|
|
4
4
|
if (ev.id.startsWith("https://") || ev.id.startsWith("data:")) {
|
|
5
5
|
if (!fetchedImages[ev.id]) {
|
|
6
6
|
fetchedImages[ev.id] = true;
|
|
7
|
-
const image =
|
|
8
|
-
|
|
7
|
+
const image = new Image();
|
|
8
|
+
image.crossOrigin = "anonymous";
|
|
9
|
+
image.src = ev.id;
|
|
10
|
+
await image.decode();
|
|
11
|
+
ev.target.addImage(ev.id, image);
|
|
9
12
|
}
|
|
10
13
|
}
|
|
11
14
|
if (builtin) {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "4.
|
|
6
|
+
"version": "4.3.0",
|
|
7
7
|
"description": "A web based tool for making MapLibre GL maps with data from sources such as Overpass, GeoJSON, GPX, KML, TCX, etc",
|
|
8
8
|
"main": "index.js",
|
|
9
9
|
"scripts": {
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"liquidjs": "^10.17.0",
|
|
71
71
|
"lodash.pick": "^4.4.0",
|
|
72
72
|
"lz-string": "^1.5.0",
|
|
73
|
-
"maplibre-gl": "^5.
|
|
73
|
+
"maplibre-gl": "^5.5.0",
|
|
74
74
|
"marked": "^14.1.2",
|
|
75
75
|
"node-events": "^0.0.2",
|
|
76
76
|
"normalize.css": "^8.0.1",
|