@trailstash/ultra 5.0.3 → 5.0.4
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/Examples/wikidata-photo.ultra +2 -2
- package/components/map-popup.js +6 -1
- package/lib/style.js +5 -1
- package/package.json +1 -1
|
@@ -7,8 +7,8 @@ options:
|
|
|
7
7
|
popupTemplate: >
|
|
8
8
|
<h2>
|
|
9
9
|
{{ type }}
|
|
10
|
-
<a href="https://
|
|
11
|
-
<a href="https://
|
|
10
|
+
<a href="https://openstreetmap.org/{{ type }}/{{ id }}" target="_blank">{{ id }}</a>
|
|
11
|
+
<a href="https://openstreetmap.org/edit?{{ type }}={{ id }}" target="_blank">✏️</a>
|
|
12
12
|
</h2>
|
|
13
13
|
{% assign wikidata = tags["siren:model:wikidata"] ?? tags["model:wikidata"] %}
|
|
14
14
|
{%- if wikidata %}
|
package/components/map-popup.js
CHANGED
|
@@ -22,7 +22,12 @@ const defaultTemplate = `
|
|
|
22
22
|
<br>
|
|
23
23
|
{%- endfor %}
|
|
24
24
|
`;
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
const defaultContextBuilder = ({ properties, geometry }) => {
|
|
27
|
+
const context = { properties: structuredClone(properties) };
|
|
28
|
+
if (geometry.type === "Point") context.geometry = geometry;
|
|
29
|
+
return context;
|
|
30
|
+
};
|
|
26
31
|
|
|
27
32
|
export class MapPopup extends HTMLElement {
|
|
28
33
|
constructor() {
|
package/lib/style.js
CHANGED
|
@@ -91,11 +91,15 @@ export async function getStyle(style, source) {
|
|
|
91
91
|
} else if (typeof style.sprite === "string") {
|
|
92
92
|
style.sprite = [{ id: "default", url: style.sprite }];
|
|
93
93
|
}
|
|
94
|
+
const spritesheets = style.sprite.map(({ id }) => id);
|
|
94
95
|
const extendedStyle = {
|
|
95
96
|
...parentStyle,
|
|
96
97
|
...style,
|
|
97
98
|
sources: { ...parentStyle.sources, ...(style.sources || {}) },
|
|
98
|
-
sprite: [
|
|
99
|
+
sprite: [
|
|
100
|
+
...parentStyle.sprite.filter(({ id }) => !spritesheets.includes(id)),
|
|
101
|
+
...style.sprite,
|
|
102
|
+
],
|
|
99
103
|
layers,
|
|
100
104
|
};
|
|
101
105
|
return ensureSourceAndLayers(extendedStyle, source);
|
package/package.json
CHANGED