@mattilsynet/design 2.2.19 → 2.2.21
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/mtds/atlas/atlas-element.d.ts +7 -5
- package/mtds/atlas/atlas-element.js +70 -38
- package/mtds/atlas/atlas-element.js.map +1 -1
- package/mtds/atlas/atlas.css.js +27 -9
- package/mtds/atlas/atlas.css.js.map +1 -1
- package/mtds/atlas/atlas.stories.d.ts +4 -1
- package/mtds/atlas/cluster.js +1149 -0
- package/mtds/atlas/cluster.js.map +1 -0
- package/mtds/atlas.iife.js +629 -685
- package/mtds/atlas.js +4 -2
- package/mtds/atlas.js.map +1 -1
- package/mtds/external/leaflet/dist/leaflet-src.js +6265 -0
- package/mtds/external/leaflet/dist/leaflet-src.js.map +1 -0
- package/mtds/external/leaflet/dist/leaflet.css.js +607 -0
- package/mtds/external/leaflet/dist/leaflet.css.js.map +1 -0
- package/mtds/index.iife.js +12 -12
- package/mtds/package.json.js +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/styles.json +43 -43
- package/mtds/styles.module.css.js +53 -53
- package/mtds/tabs/tabs.stories.d.ts +1 -0
- package/mtds/utils.d.ts +1 -1
- package/mtds/utils.js +9 -9
- package/mtds/utils.js.map +1 -1
- package/package.json +5 -6
- package/mtds/atlas/atlas.d.ts +0 -14
|
@@ -1,24 +1,26 @@
|
|
|
1
|
+
import { default as L } from 'leaflet';
|
|
1
2
|
import { MTDSElement } from '../utils';
|
|
2
|
-
import * as L from "leaflet";
|
|
3
3
|
import type * as ReactTypes from "react";
|
|
4
|
+
export { L };
|
|
4
5
|
declare global {
|
|
5
6
|
namespace React.JSX {
|
|
6
7
|
interface IntrinsicElements {
|
|
7
8
|
"mtds-atlas": ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<MTDSAtlasElement>, MTDSAtlasElement> & {
|
|
8
9
|
class?: string;
|
|
9
|
-
"data-view"?: string;
|
|
10
|
+
"data-view"?: string | number[];
|
|
10
11
|
};
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
export declare class MTDSAtlasElement extends MTDSElement {
|
|
15
|
-
map?: L.Map;
|
|
16
|
-
tiles?: L.TileLayer;
|
|
17
16
|
cluster?: L.MarkerClusterGroup;
|
|
18
|
-
|
|
17
|
+
map?: L.Map;
|
|
18
|
+
_popup?: [HTMLElement, L.Popup];
|
|
19
19
|
static get observedAttributes(): string[];
|
|
20
20
|
constructor();
|
|
21
21
|
connectedCallback(): void;
|
|
22
|
+
attributeChangedCallback(name: string, _prev?: string | null, next?: string | null): void;
|
|
23
|
+
setView(view: string | number[], options?: L.ZoomPanOptions): void;
|
|
22
24
|
addMarker(latlng: L.LatLngExpression, options?: L.MarkerOptions): L.Marker<any>;
|
|
23
25
|
disconnectedCallback(): void;
|
|
24
26
|
}
|
|
@@ -1,57 +1,89 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import "
|
|
5
|
-
import { IS_BROWSER as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
});
|
|
12
|
-
const f = "57.95, 4.73, 71.19, 31.44, 15", v = "https://cache.kartverket.no/v1/wmts/1.0.0/topo/default/webmercator/{z}/{y}/{x}.png", w = "https://cache.kartverket.no/v1/wmts/1.0.0/topograatone/default/webmercator/{z}/{y}/{x}.png";
|
|
13
|
-
class g extends p {
|
|
14
|
-
map;
|
|
15
|
-
tiles;
|
|
1
|
+
import i from "../external/leaflet/dist/leaflet-src.js";
|
|
2
|
+
import C from "../external/leaflet/dist/leaflet.css.js";
|
|
3
|
+
import k from "./atlas.css.js";
|
|
4
|
+
import "./cluster.js";
|
|
5
|
+
import { IS_BROWSER as y, MTDSElement as E, tag as c, attr as s, debounce as S, on as x, off as z } from "../utils.js";
|
|
6
|
+
const d = [30, 30], A = [
|
|
7
|
+
[57.5, 4.73],
|
|
8
|
+
[71.5, 31.44]
|
|
9
|
+
], B = "https://cache.kartverket.no/v1/wmts/1.0.0/topo/default/webmercator/{z}/{y}/{x}.png";
|
|
10
|
+
class p extends E {
|
|
16
11
|
cluster;
|
|
17
|
-
|
|
12
|
+
map;
|
|
13
|
+
// Private properties
|
|
14
|
+
_popup;
|
|
18
15
|
static get observedAttributes() {
|
|
19
|
-
return ["data-view", "data-
|
|
16
|
+
return ["data-view", "data-scrollzoom"];
|
|
20
17
|
}
|
|
21
18
|
constructor() {
|
|
22
|
-
super(), this.
|
|
23
|
-
|
|
24
|
-
${
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
s("div")
|
|
19
|
+
super(), this.attachShadow({ mode: "open" }).append(
|
|
20
|
+
c("style", {}, `${C}
|
|
21
|
+
${k}`),
|
|
22
|
+
c("slot"),
|
|
23
|
+
c("div")
|
|
28
24
|
);
|
|
29
25
|
}
|
|
30
26
|
connectedCallback() {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
layers: [this.tiles, this.cluster],
|
|
27
|
+
const e = this.shadowRoot?.lastElementChild, o = Number(s(this, "data-cluster")) || 1, t = new i.TileLayer(B, {
|
|
28
|
+
attribution: "© Kartverket",
|
|
29
|
+
maxZoom: 18
|
|
30
|
+
});
|
|
31
|
+
this.map = new i.Map(e, {
|
|
37
32
|
attributionControl: !1,
|
|
38
33
|
wheelPxPerZoomLevel: 20,
|
|
39
34
|
zoomControl: !1,
|
|
40
|
-
zoomSnap: 0
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
zoomSnap: 0,
|
|
36
|
+
layers: [t]
|
|
37
|
+
}), this.cluster = new i.MarkerClusterGroup({
|
|
38
|
+
disableClusteringAtZoom: o,
|
|
39
|
+
showCoverageOnHover: !1,
|
|
40
|
+
zoomToBoundsOnClick: !0
|
|
41
|
+
}).addTo(this.map), this.map.addControl(new i.Control.Attribution({ prefix: "" })), this.map.addControl(new i.Control.Zoom({ position: "bottomright" })), this.map.on("popupopen", L), p.observedAttributes.forEach((n) => {
|
|
42
|
+
this.attributeChangedCallback(n, null, s(this, n));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
attributeChangedCallback(e, o = null, t = null) {
|
|
46
|
+
this.map && (e === "data-view" && this.setView(t || ""), e === "data-scrollzoom" && this.map.scrollWheelZoom[t === "false" ? "disable" : "enable"]());
|
|
45
47
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
setView(e, o) {
|
|
49
|
+
const t = `${e}`.split(",").map(parseFloat).filter(Number.isFinite), n = this.cluster?.getBounds();
|
|
50
|
+
t.length === 3 ? this.map?.setView([t[0], t[1]], t[2], o) : e !== "fit" ? this.map?.fitBounds(A, o) : n?.isValid() ? this.map?.fitBounds(n, o || { padding: [40, 40] }) : this.cluster?.on("layeradd", g, this);
|
|
51
|
+
}
|
|
52
|
+
addMarker(e, o) {
|
|
53
|
+
return new i.Marker(e, o).addTo(
|
|
54
|
+
this.cluster
|
|
55
|
+
);
|
|
48
56
|
}
|
|
49
57
|
disconnectedCallback() {
|
|
50
58
|
this.map?.remove();
|
|
51
59
|
}
|
|
52
60
|
}
|
|
53
|
-
|
|
61
|
+
y && !window.customElements.get("mtds-atlas") && (i.Marker.prototype.options.icon = new i.DivIcon({
|
|
62
|
+
html: '<svg class="map-pin" viewBox="0 0 256 256"><rect x="78" y="50" width="100" height="100" /><path fill="var(--mtds-)" d="M128,16a88.1,88.1,0,0,0-88,88c0,75.3,80,132.17,83.41,134.55a8,8,0,0,0,9.18,0C136,236.17,216,179.3,216,104A88.1,88.1,0,0,0,128,16Zm0,56a32,32,0,1,1-32,32A32,32,0,0,1,128,72Z"/></svg>',
|
|
63
|
+
iconSize: d,
|
|
64
|
+
iconAnchor: [15, 30],
|
|
65
|
+
popupAnchor: [0, -15]
|
|
66
|
+
}), window.customElements.define("mtds-atlas", p));
|
|
67
|
+
const g = S(function() {
|
|
68
|
+
this.cluster?.off("layeradd", g), this.cluster?.getBounds().isValid() && this.setView("fit");
|
|
69
|
+
}, 100), f = "popupclose move resize zoomanim viewreset", L = ({ target: l, popup: e }) => {
|
|
70
|
+
const o = e.getContent(), t = String(o)[0] === "#" && document.getElementById(o.slice(1));
|
|
71
|
+
if (t && t.closest("mtds-atlas")) {
|
|
72
|
+
const n = e.getLatLng(), v = s(t, "popover");
|
|
73
|
+
s(e.getElement(), "hidden", ""), s(t, "data-popover", "open"), s(t, "popover", "manual");
|
|
74
|
+
const m = new ResizeObserver(() => a()), a = (r) => {
|
|
75
|
+
if (r?.type === "popupclose" && r?.popup === e)
|
|
76
|
+
m.disconnect(), l.off(f, a), s(e.getElement(), "hidden", null), s(t, "data-popover", null), s(t, "popover", v), z(t, "click", h);
|
|
77
|
+
else {
|
|
78
|
+
const u = l.latLngToContainerPoint(n), w = u.x - t.offsetWidth / 2 - d[0] / 2, b = u.y - t.offsetHeight - d[1];
|
|
79
|
+
t.style.translate = `${w}px ${b}px`;
|
|
80
|
+
}
|
|
81
|
+
}, h = ({ target: r }) => r?.closest?.('[popovertargetaction="hide"]') && e.close();
|
|
82
|
+
l.on(f, a), x(t, "click", h), m.observe(t), a();
|
|
83
|
+
}
|
|
84
|
+
};
|
|
54
85
|
export {
|
|
55
|
-
|
|
86
|
+
i as L,
|
|
87
|
+
p as MTDSAtlasElement
|
|
56
88
|
};
|
|
57
89
|
//# sourceMappingURL=atlas-element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atlas-element.js","sources":["../../designsystem/atlas/atlas-element.ts"],"sourcesContent":["import * as L from \"leaflet\";\nimport LeafletCSS from \"leaflet/dist/leaflet.css?raw\";\nimport LeafletClusterCSS from \"leaflet.markercluster/dist/MarkerCluster.css?raw\";\nimport type * as ReactTypes from \"react\";\nimport \"leaflet.markercluster\";\n\nimport { attr, IS_BROWSER, MTDSElement, tag } from \"../utils\";\nimport css from \"./atlas.css?raw\";\n\ndeclare global {\n\tnamespace React.JSX {\n\t\tinterface IntrinsicElements {\n\t\t\t\"mtds-atlas\": ReactTypes.DetailedHTMLProps<\n\t\t\t\tReactTypes.HTMLAttributes<MTDSAtlasElement>,\n\t\t\t\tMTDSAtlasElement\n\t\t\t> & {\n\t\t\t\tclass?: string;\n\t\t\t\t\"data-view\"?: string;\n\t\t\t};\n\t\t}\n\t}\n}\n\nL.Marker.prototype.options.icon = L.divIcon({\n\thtml: '<svg class=\"map-pin\" viewBox=\"0 0 256 256\"><rect x=\"78\" y=\"50\" width=\"100\" height=\"100\" /><path fill=\"var(--mtds-)\" d=\"M128,16a88.1,88.1,0,0,0-88,88c0,75.3,80,132.17,83.41,134.55a8,8,0,0,0,9.18,0C136,236.17,216,179.3,216,104A88.1,88.1,0,0,0,128,16Zm0,56a32,32,0,1,1-32,32A32,32,0,0,1,128,72Z\"/></svg>',\n\ticonAnchor: [15, 30],\n\ticonSize: [30, 30],\n});\n\n// const strToLatLng = (str?: string | null) =>\n// \t[0, 0, ...(str || \"\").split(\",\").map(parseFloat)].slice(-2) as L.LatLngTuple;\n\nconst VIEW_NORWAY = \"57.95, 4.73, 71.19, 31.44, 15\";\nconst TILES_COLOR =\n\t\"https://cache.kartverket.no/v1/wmts/1.0.0/topo/default/webmercator/{z}/{y}/{x}.png\";\nconst TILES_GRAY =\n\t\"https://cache.kartverket.no/v1/wmts/1.0.0/topograatone/default/webmercator/{z}/{y}/{x}.png\";\n\nexport class MTDSAtlasElement extends MTDSElement {\n\tmap?: L.Map;\n\ttiles?: L.TileLayer;\n\tcluster?: L.MarkerClusterGroup;\n\tleaflet: typeof L;\n\n\tstatic get observedAttributes() {\n\t\treturn [\"data-view\", \"data-layers\", \"data-tiles\"]; // Using ES2015 syntax for backwards compatibility\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.leaflet = L;\n\t\tthis.attachShadow({ mode: \"open\" }).append(\n\t\t\ttag(\"style\", {}, `${LeafletCSS}\\n${LeafletClusterCSS}\\n${css}`),\n\t\t\ttag(\"slot\"),\n\t\t\ttag(\"div\"),\n\t\t);\n\t}\n\tconnectedCallback() {\n\t\tconst view = JSON.parse(`[${attr(this, \"data-view\") || VIEW_NORWAY}]`);\n\t\tconst div = this.shadowRoot?.lastElementChild;\n\t\tconst cluster = Number(attr(this, \"data-cluster\")) || 1;\n\t\tconst tiles =\n\t\t\tattr(this, \"data-tiles\") === \"color\" ? TILES_COLOR : TILES_GRAY;\n\n\t\tthis.tiles = L.tileLayer(tiles, { maxZoom: 18 });\n\t\tthis.cluster = L.markerClusterGroup({\n\t\t\tshowCoverageOnHover: false,\n\t\t\tdisableClusteringAtZoom: cluster,\n\t\t});\n\n\t\tthis.map = L.map(div as HTMLElement, {\n\t\t\tlayers: [this.tiles, this.cluster],\n\t\t\tattributionControl: false,\n\t\t\twheelPxPerZoomLevel: 20,\n\t\t\tzoomControl: false,\n\t\t\tzoomSnap: 0,\n\t\t});\n\t\tthis.map.addControl(L.control.zoom({ position: \"bottomright\" }));\n\n\t\t// If no view is set, use Norway as default bounding box\n\t\tif (view.length === 3) this.map.setView([view[0], view[1]], view[2]);\n\t\tif (view.length >= 4) {\n\t\t\tconst nw = [view[0], view[1]] as L.LatLngTuple;\n\t\t\tconst se = [view[2], view[3]] as L.LatLngTuple;\n\t\t\tconst padding = [view[4] ?? 0, view[5] ?? view[4] ?? 0] as L.PointTuple;\n\t\t\tthis.map.fitBounds([nw, se], { padding });\n\t\t}\n\t}\n\taddMarker(latlng: L.LatLngExpression, options?: L.MarkerOptions) {\n\t\treturn L.marker(latlng, options).addTo(this.cluster || (this.map as L.Map));\n\t}\n\tdisconnectedCallback() {\n\t\tthis.map?.remove();\n\t}\n}\n\nif (IS_BROWSER && !window.customElements.get(\"mtds-atlas\"))\n\twindow.customElements.define(\"mtds-atlas\", MTDSAtlasElement);\n\n// export type Adresse = {\n// \tadressekode: number;\n// \tadressetekst: string;\n// \tbokstav: string;\n// \tbruksenhetsnummer: string[];\n// \tbruksnummer: number;\n// \tfestenummer: number;\n// \tgardsnummer: number;\n// \tkommunenavn: string;\n// \tkommunenummer: string;\n// \tnummer: number;\n// \tobjtype: string;\n// \toppdateringsdato: string;\n// \tpostnummer: string;\n// \tpoststed: string;\n// \trepresentasjonspunkt: {\n// \t\tepsg: string;\n// \t\tlat: number;\n// \t\tlon: number;\n// \t};\n// \tstedfestingverifisert: boolean;\n// \tundernummer: string | null;\n// };\n\n// // Hent punkt for adresse fra GeoNorge\n// export async function getPunktFraAdresse(\n// \tadresseSoek: string,\n// ): Promise<Adresse[]> {\n// \ttry {\n// \t\tconst response = await fetch(\n// \t\t\t`https://ws.geonorge.no/adresser/v1/sok?sok=${adresseSoek}&fuzzy=false&utkoordsys=3857&treffPerSide=100&asciiKompatibel=true`,\n// \t\t);\n// \t\tconst jsonresponse = await response.json();\n// \t\tif (jsonresponse.adresser.length > 0) {\n// \t\t\treturn jsonresponse.adresser.map((adresse: Adresse) => ({\n// \t\t\t\tadressekode: adresse.adressekode,\n// \t\t\t\tadressetekst: adresse.adressetekst,\n// \t\t\t\tbokstav: adresse.bokstav,\n// \t\t\t\tbruksenhetsnummer: adresse.bruksenhetsnummer,\n// \t\t\t\tbruksnummer: adresse.bruksnummer,\n// \t\t\t\tfestenummer: adresse.festenummer,\n// \t\t\t\tgardsnummer: adresse.gardsnummer,\n// \t\t\t\tkommunenavn: adresse.kommunenavn,\n// \t\t\t\tkommunenummer: adresse.kommunenummer,\n// \t\t\t\tnummer: adresse.nummer,\n// \t\t\t\tobjtype: adresse.objtype,\n// \t\t\t\toppdateringsdato: adresse.oppdateringsdato,\n// \t\t\t\tpostnummer: adresse.postnummer,\n// \t\t\t\tpoststed: adresse.poststed,\n// \t\t\t\trepresentasjonspunkt: {\n// \t\t\t\t\tepsg: adresse.representasjonspunkt.epsg,\n// \t\t\t\t\tlat: adresse.representasjonspunkt.lat,\n// \t\t\t\t\tlon: adresse.representasjonspunkt.lon,\n// \t\t\t\t},\n// \t\t\t}));\n// \t\t} else {\n// \t\t\treturn [];\n// \t\t}\n// \t} catch (error) {\n// \t\tconsole.log(`Feilet i å hente adresse fra punkt: ${error}`);\n// \t\treturn [];\n// \t}\n// }\n"],"names":["L","VIEW_NORWAY","TILES_COLOR","TILES_GRAY","MTDSAtlasElement","MTDSElement","tag","LeafletCSS","LeafletClusterCSS","css","view","attr","div","cluster","tiles","nw","se","padding","latlng","options","IS_BROWSER"],"mappings":";;;;;;AAuBAA,EAAE,OAAO,UAAU,QAAQ,OAAOA,EAAE,QAAQ;AAAA,EAC3C,MAAM;AAAA,EACN,YAAY,CAAC,IAAI,EAAE;AAAA,EACnB,UAAU,CAAC,IAAI,EAAE;AAClB,CAAC;AAKD,MAAMC,IAAc,iCACdC,IACL,sFACKC,IACL;AAEM,MAAMC,UAAyBC,EAAY;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA,WAAW,qBAAqB;AAC/B,WAAO,CAAC,aAAa,eAAe,YAAY;AAAA,EACjD;AAAA,EAEA,cAAc;AACb,UAAA,GACA,KAAK,UAAUL,GACf,KAAK,aAAa,EAAE,MAAM,OAAA,CAAQ,EAAE;AAAA,MACnCM,EAAI,SAAS,IAAI,GAAGC,CAAU;AAAA,EAAKC,CAAiB;AAAA,EAAKC,CAAG,EAAE;AAAA,MAC9DH,EAAI,MAAM;AAAA,MACVA,EAAI,KAAK;AAAA,IAAA;AAAA,EAEX;AAAA,EACA,oBAAoB;AACnB,UAAMI,IAAO,KAAK,MAAM,IAAIC,EAAK,MAAM,WAAW,KAAKV,CAAW,GAAG,GAC/DW,IAAM,KAAK,YAAY,kBACvBC,IAAU,OAAOF,EAAK,MAAM,cAAc,CAAC,KAAK,GAChDG,IACLH,EAAK,MAAM,YAAY,MAAM,UAAUT,IAAcC;AAmBtD,QAjBA,KAAK,QAAQH,EAAE,UAAUc,GAAO,EAAE,SAAS,IAAI,GAC/C,KAAK,UAAUd,EAAE,mBAAmB;AAAA,MACnC,qBAAqB;AAAA,MACrB,yBAAyBa;AAAA,IAAA,CACzB,GAED,KAAK,MAAMb,EAAE,IAAIY,GAAoB;AAAA,MACpC,QAAQ,CAAC,KAAK,OAAO,KAAK,OAAO;AAAA,MACjC,oBAAoB;AAAA,MACpB,qBAAqB;AAAA,MACrB,aAAa;AAAA,MACb,UAAU;AAAA,IAAA,CACV,GACD,KAAK,IAAI,WAAWZ,EAAE,QAAQ,KAAK,EAAE,UAAU,cAAA,CAAe,CAAC,GAG3DU,EAAK,WAAW,KAAG,KAAK,IAAI,QAAQ,CAACA,EAAK,CAAC,GAAGA,EAAK,CAAC,CAAC,GAAGA,EAAK,CAAC,CAAC,GAC/DA,EAAK,UAAU,GAAG;AACrB,YAAMK,IAAK,CAACL,EAAK,CAAC,GAAGA,EAAK,CAAC,CAAC,GACtBM,IAAK,CAACN,EAAK,CAAC,GAAGA,EAAK,CAAC,CAAC,GACtBO,IAAU,CAACP,EAAK,CAAC,KAAK,GAAGA,EAAK,CAAC,KAAKA,EAAK,CAAC,KAAK,CAAC;AACtD,WAAK,IAAI,UAAU,CAACK,GAAIC,CAAE,GAAG,EAAE,SAAAC,GAAS;AAAA,IACzC;AAAA,EACD;AAAA,EACA,UAAUC,GAA4BC,GAA2B;AAChE,WAAOnB,EAAE,OAAOkB,GAAQC,CAAO,EAAE,MAAM,KAAK,WAAY,KAAK,GAAa;AAAA,EAC3E;AAAA,EACA,uBAAuB;AACtB,SAAK,KAAK,OAAA;AAAA,EACX;AACD;AAEIC,KAAc,CAAC,OAAO,eAAe,IAAI,YAAY,KACxD,OAAO,eAAe,OAAO,cAAchB,CAAgB;"}
|
|
1
|
+
{"version":3,"file":"atlas-element.js","sources":["../../designsystem/atlas/atlas-element.ts"],"sourcesContent":["import L, { type PointExpression } from \"leaflet\";\nimport LeafletCSS from \"leaflet/dist/leaflet.css?raw\";\nimport type {} from \"leaflet.markercluster\";\nimport type * as ReactTypes from \"react\";\nimport css from \"./atlas.css?raw\";\nimport \"./cluster.js\";\nimport {\n\tattr,\n\tdebounce,\n\tIS_BROWSER,\n\tMTDSElement,\n\toff,\n\ton,\n\ttag,\n} from \"../utils\";\nexport { L };\n\ndeclare global {\n\tnamespace React.JSX {\n\t\tinterface IntrinsicElements {\n\t\t\t\"mtds-atlas\": ReactTypes.DetailedHTMLProps<\n\t\t\t\tReactTypes.HTMLAttributes<MTDSAtlasElement>,\n\t\t\t\tMTDSAtlasElement\n\t\t\t> & {\n\t\t\t\tclass?: string;\n\t\t\t\t\"data-view\"?: string | number[];\n\t\t\t};\n\t\t}\n\t}\n}\n\nconst MARKER_SIZE = [30, 30];\nconst BOUNDS_NORWAY: L.LatLngBoundsLiteral = [\n\t[57.5, 4.73],\n\t[71.5, 31.44],\n];\n\n// Turns out Kartverket's color tiles are better in grayscale than their grayscale tiles\nconst TILES_COLOR =\n\t\"https://cache.kartverket.no/v1/wmts/1.0.0/topo/default/webmercator/{z}/{y}/{x}.png\";\n\nexport class MTDSAtlasElement extends MTDSElement {\n\tcluster?: L.MarkerClusterGroup;\n\tmap?: L.Map;\n\n\t// Private properties\n\t_popup?: [HTMLElement, L.Popup];\n\n\tstatic get observedAttributes() {\n\t\treturn [\"data-view\", \"data-scrollzoom\"]; //TODO: \"data-layers\" // Using ES2015 syntax for backwards compatibility\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.attachShadow({ mode: \"open\" }).append(\n\t\t\ttag(\"style\", {}, `${LeafletCSS}\\n${css}`),\n\t\t\ttag(\"slot\"),\n\t\t\ttag(\"div\"),\n\t\t);\n\t}\n\tconnectedCallback() {\n\t\tconst div = this.shadowRoot?.lastElementChild;\n\t\tconst cluster = Number(attr(this, \"data-cluster\")) || 1;\n\t\tconst tiles = new L.TileLayer(TILES_COLOR, {\n\t\t\tattribution: \"© Kartverket\",\n\t\t\tmaxZoom: 18,\n\t\t});\n\n\t\tthis.map = new L.Map(div as HTMLElement, {\n\t\t\tattributionControl: false,\n\t\t\twheelPxPerZoomLevel: 20,\n\t\t\tzoomControl: false,\n\t\t\tzoomSnap: 0,\n\t\t\tlayers: [tiles],\n\t\t});\n\n\t\tthis.cluster = new L.MarkerClusterGroup({\n\t\t\tdisableClusteringAtZoom: cluster,\n\t\t\tshowCoverageOnHover: false,\n\t\t\tzoomToBoundsOnClick: true,\n\t\t}).addTo(this.map);\n\n\t\tthis.map.addControl(new L.Control.Attribution({ prefix: \"\" }));\n\t\tthis.map.addControl(new L.Control.Zoom({ position: \"bottomright\" }));\n\t\tthis.map.on(\"popupopen\", handlePopupById);\n\n\t\t// Initial setup when map is connected\n\t\tMTDSAtlasElement.observedAttributes.forEach((name) => {\n\t\t\tthis.attributeChangedCallback(name, null, attr(this, name));\n\t\t});\n\t}\n\tattributeChangedCallback(\n\t\tname: string,\n\t\t_prev: string | null = null,\n\t\tnext: string | null = null,\n\t) {\n\t\tif (!this.map) return; // No map yet\n\t\tif (name === \"data-view\") this.setView(next || \"\");\n\t\tif (name === \"data-scrollzoom\")\n\t\t\tthis.map.scrollWheelZoom[next === \"false\" ? \"disable\" : \"enable\"]();\n\t}\n\tsetView(view: string | number[], options?: L.ZoomPanOptions) {\n\t\tconst pos = `${view}`.split(\",\").map(parseFloat).filter(Number.isFinite);\n\t\tconst bounds = this.cluster?.getBounds();\n\n\t\tif (pos.length === 3) this.map?.setView([pos[0], pos[1]], pos[2], options);\n\t\telse if (view !== \"fit\") this.map?.fitBounds(BOUNDS_NORWAY, options);\n\t\telse if (!bounds?.isValid())\n\t\t\tthis.cluster?.on(\"layeradd\", fitWhenMarkers, this);\n\t\telse this.map?.fitBounds(bounds, options || { padding: [40, 40] });\n\t}\n\taddMarker(latlng: L.LatLngExpression, options?: L.MarkerOptions) {\n\t\treturn new L.Marker(latlng, options).addTo(\n\t\t\tthis.cluster as L.MarkerClusterGroup,\n\t\t);\n\t}\n\tdisconnectedCallback() {\n\t\tthis.map?.remove();\n\t}\n}\n\n// Set default marker icon and define custom element\nif (IS_BROWSER && !window.customElements.get(\"mtds-atlas\")) {\n\tL.Marker.prototype.options.icon = new L.DivIcon({\n\t\thtml: '<svg class=\"map-pin\" viewBox=\"0 0 256 256\"><rect x=\"78\" y=\"50\" width=\"100\" height=\"100\" /><path fill=\"var(--mtds-)\" d=\"M128,16a88.1,88.1,0,0,0-88,88c0,75.3,80,132.17,83.41,134.55a8,8,0,0,0,9.18,0C136,236.17,216,179.3,216,104A88.1,88.1,0,0,0,128,16Zm0,56a32,32,0,1,1-32,32A32,32,0,0,1,128,72Z\"/></svg>',\n\t\ticonSize: MARKER_SIZE as PointExpression,\n\t\ticonAnchor: [15, 30],\n\t\tpopupAnchor: [0, -15],\n\t});\n\twindow.customElements.define(\"mtds-atlas\", MTDSAtlasElement);\n}\n\n// TODO: Style markers\n// TODO: Synlig label til marker\n\nconst fitWhenMarkers = debounce(function (this: MTDSAtlasElement) {\n\tthis.cluster?.off(\"layeradd\", fitWhenMarkers);\n\tif (this.cluster?.getBounds().isValid()) this.setView(\"fit\");\n}, 100);\n\nconst HANDLE_POPUP_EVENTS = \"popupclose move resize zoomanim viewreset\";\nconst handlePopupById = ({ target: map, popup }: L.LeafletEvent) => {\n\tconst id = popup.getContent();\n\tconst popover = String(id)[0] === \"#\" && document.getElementById(id.slice(1));\n\n\tif (!!popover && popover.closest(\"mtds-atlas\")) {\n\t\tconst latlng = popup.getLatLng();\n\t\tconst mode = attr(popover, \"popover\"); // Save current popover mode\n\t\tattr(popup.getElement(), \"hidden\", \"\"); // Hide Leaflet popup element\n\t\tattr(popover, \"data-popover\", \"open\"); // Show popover\n\t\tattr(popover, \"popover\", \"manual\"); // Disable Popover API to show and ensure overflow: clip on mtds-atlas works\n\n\t\tconst resize = new ResizeObserver(() => update());\n\t\tconst update = (event?: L.LeafletEvent) => {\n\t\t\tif (event?.type === \"popupclose\" && event?.popup === popup) {\n\t\t\t\tresize.disconnect();\n\t\t\t\tmap.off(HANDLE_POPUP_EVENTS, update);\n\t\t\t\tattr(popup.getElement(), \"hidden\", null); // Un-hide Leaflet popup element\n\t\t\t\tattr(popover, \"data-popover\", null); // Hide popover\n\t\t\t\tattr(popover, \"popover\", mode); // Re-enable Popover API\n\t\t\t\toff(popover, \"click\", click);\n\t\t\t} else {\n\t\t\t\tconst point = map.latLngToContainerPoint(latlng);\n\t\t\t\tconst x = point.x - popover.offsetWidth / 2 - MARKER_SIZE[0] / 2;\n\t\t\t\tconst y = point.y - popover.offsetHeight - MARKER_SIZE[1];\n\t\t\t\tpopover.style.translate = `${x}px ${y}px`;\n\t\t\t}\n\t\t};\n\t\tconst click = ({ target: el }: Event) =>\n\t\t\t(el as Element)?.closest?.('[popovertargetaction=\"hide\"]') &&\n\t\t\tpopup.close();\n\n\t\tmap.on(HANDLE_POPUP_EVENTS, update);\n\t\ton(popover, \"click\", click); // Listen for close actions inside popover since we are not using actual Popover API\n\t\tresize.observe(popover); // Listen for changes of popover size\n\t\tupdate(); // Initial position\n\t}\n};\n\n// export type Adresse = {\n// \tadressekode: number;\n// \tadressetekst: string;\n// \tbokstav: string;\n// \tbruksenhetsnummer: string[];\n// \tbruksnummer: number;\n// \tfestenummer: number;\n// \tgardsnummer: number;\n// \tkommunenavn: string;\n// \tkommunenummer: string;\n// \tnummer: number;\n// \tobjtype: string;\n// \toppdateringsdato: string;\n// \tpostnummer: string;\n// \tpoststed: string;\n// \trepresentasjonspunkt: {\n// \t\tepsg: string;\n// \t\tlat: number;\n// \t\tlon: number;\n// \t};\n// \tstedfestingverifisert: boolean;\n// \tundernummer: string | null;\n// };\n\n// // Hent punkt for adresse fra GeoNorge\n// export async function getPunktFraAdresse(\n// \tadresseSoek: string,\n// ): Promise<Adresse[]> {\n// \ttry {\n// \t\tconst response = await fetch(\n// \t\t\t`https://ws.geonorge.no/adresser/v1/sok?sok=${adresseSoek}&fuzzy=false&utkoordsys=3857&treffPerSide=100&asciiKompatibel=true`,\n// \t\t);\n// \t\tconst jsonresponse = await response.json();\n// \t\tif (jsonresponse.adresser.length > 0) {\n// \t\t\treturn jsonresponse.adresser.map((adresse: Adresse) => ({\n// \t\t\t\tadressekode: adresse.adressekode,\n// \t\t\t\tadressetekst: adresse.adressetekst,\n// \t\t\t\tbokstav: adresse.bokstav,\n// \t\t\t\tbruksenhetsnummer: adresse.bruksenhetsnummer,\n// \t\t\t\tbruksnummer: adresse.bruksnummer,\n// \t\t\t\tfestenummer: adresse.festenummer,\n// \t\t\t\tgardsnummer: adresse.gardsnummer,\n// \t\t\t\tkommunenavn: adresse.kommunenavn,\n// \t\t\t\tkommunenummer: adresse.kommunenummer,\n// \t\t\t\tnummer: adresse.nummer,\n// \t\t\t\tobjtype: adresse.objtype,\n// \t\t\t\toppdateringsdato: adresse.oppdateringsdato,\n// \t\t\t\tpostnummer: adresse.postnummer,\n// \t\t\t\tpoststed: adresse.poststed,\n// \t\t\t\trepresentasjonspunkt: {\n// \t\t\t\t\tepsg: adresse.representasjonspunkt.epsg,\n// \t\t\t\t\tlat: adresse.representasjonspunkt.lat,\n// \t\t\t\t\tlon: adresse.representasjonspunkt.lon,\n// \t\t\t\t},\n// \t\t\t}));\n// \t\t} else {\n// \t\t\treturn [];\n// \t\t}\n// \t} catch (error) {\n// \t\tconsole.log(`Feilet i å hente adresse fra punkt: ${error}`);\n// \t\treturn [];\n// \t}\n// }\n"],"names":["MARKER_SIZE","BOUNDS_NORWAY","TILES_COLOR","MTDSAtlasElement","MTDSElement","tag","LeafletCSS","css","div","cluster","attr","tiles","L","handlePopupById","name","_prev","next","view","options","pos","bounds","fitWhenMarkers","latlng","IS_BROWSER","debounce","HANDLE_POPUP_EVENTS","map","popup","id","popover","mode","resize","update","event","off","click","point","x","y","el","on"],"mappings":";;;;;AA+BA,MAAMA,IAAc,CAAC,IAAI,EAAE,GACrBC,IAAuC;AAAA,EAC5C,CAAC,MAAM,IAAI;AAAA,EACX,CAAC,MAAM,KAAK;AACb,GAGMC,IACL;AAEM,MAAMC,UAAyBC,EAAY;AAAA,EACjD;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EAEA,WAAW,qBAAqB;AAC/B,WAAO,CAAC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host {
|
|
2
|
-
--mtdsc-atlas-background: var(--mtds-color-surface-default);
|
|
3
2
|
--mtdsc-atlas-cluster-size: var(--mtds-8);
|
|
3
|
+
--mtdsc-atlas-background: #fbfbfb;
|
|
4
|
+
--mtdsc-atlas-border-color: var(--mtds-color-border-subtle);
|
|
5
|
+
--mtdsc-atlas-border: var(--mtds-border-width-default) solid
|
|
6
|
+
var(--mtdsc-atlas-border-color);
|
|
4
7
|
|
|
5
|
-
aspect-ratio: 2; /* TODO: make possible to overwrite */
|
|
6
8
|
border-radius: var(--mtds-border-radius-md);
|
|
7
|
-
|
|
9
|
+
aspect-ratio: 2;
|
|
8
10
|
overflow: clip;
|
|
9
11
|
position: relative;
|
|
10
12
|
user-select: none;
|
|
@@ -12,16 +14,22 @@ const t = `:host {
|
|
|
12
14
|
:host(:not([hidden])) {
|
|
13
15
|
display: grid;
|
|
14
16
|
}
|
|
15
|
-
|
|
16
17
|
:host([data-cursor="pointer"]) .leaflet-grab {
|
|
17
18
|
cursor: pointer;
|
|
18
19
|
}
|
|
20
|
+
.leaflet-tile-container {
|
|
21
|
+
filter: grayscale(1) contrast(0.75) brightness(1.15);
|
|
22
|
+
}
|
|
23
|
+
:host([data-tiles="color"]) .leaflet-tile-container {
|
|
24
|
+
filter: grayscale(0.2);
|
|
25
|
+
}
|
|
19
26
|
:host([data-tiles="color"]) {
|
|
20
|
-
--mtdsc-atlas-background: #
|
|
27
|
+
--mtdsc-atlas-background: #e5fcfd;
|
|
21
28
|
}
|
|
22
|
-
:host(
|
|
23
|
-
:
|
|
24
|
-
|
|
29
|
+
:host:has(.leaflet-container:focus-visible) {
|
|
30
|
+
box-shadow: var(--mtdsc-focus-boxShadow);
|
|
31
|
+
outline: var(--mtdsc-focus-outline);
|
|
32
|
+
outline-offset: var(--mtds-border-width-focus);
|
|
25
33
|
}
|
|
26
34
|
slot {
|
|
27
35
|
display: grid;
|
|
@@ -38,10 +46,20 @@ slot {
|
|
|
38
46
|
border: 0;
|
|
39
47
|
}
|
|
40
48
|
.leaflet-container {
|
|
41
|
-
font: inherit;
|
|
42
49
|
background: var(--mtdsc-atlas-background);
|
|
50
|
+
border-radius: inherit;
|
|
51
|
+
border: var(--mtdsc-atlas-border);
|
|
52
|
+
box-sizing: border-box;
|
|
53
|
+
font: inherit;
|
|
43
54
|
outline: 0;
|
|
55
|
+
position: relative;
|
|
56
|
+
z-index: 1; /* Ensure <slot> is always on top */
|
|
44
57
|
}
|
|
58
|
+
.leaflet-control-attribution {
|
|
59
|
+
font-size: 12px;
|
|
60
|
+
border-top-left-radius: var(--mtds-border-radius-md);
|
|
61
|
+
}
|
|
62
|
+
|
|
45
63
|
.map-pin rect {
|
|
46
64
|
fill: var(--mtds-color-base-contrast-default);
|
|
47
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atlas.css.js","sources":["../../designsystem/atlas/atlas.css?raw"],"sourcesContent":["export default \":host {\\n\\t--mtdsc-atlas-
|
|
1
|
+
{"version":3,"file":"atlas.css.js","sources":["../../designsystem/atlas/atlas.css?raw"],"sourcesContent":["export default \":host {\\n\\t--mtdsc-atlas-cluster-size: var(--mtds-8);\\n\\t--mtdsc-atlas-background: #fbfbfb;\\n\\t--mtdsc-atlas-border-color: var(--ds-color-border-subtle);\\n\\t--mtdsc-atlas-border: var(--ds-border-width-default) solid\\n\\t\\tvar(--mtdsc-atlas-border-color);\\n\\n\\tborder-radius: var(--ds-border-radius-md);\\n\\taspect-ratio: 2;\\n\\toverflow: clip;\\n\\tposition: relative;\\n\\tuser-select: none;\\n}\\n:host(:not([hidden])) {\\n\\tdisplay: grid;\\n}\\n:host([data-cursor=\\\"pointer\\\"]) .leaflet-grab {\\n\\tcursor: pointer;\\n}\\n.leaflet-tile-container {\\n\\tfilter: grayscale(1) contrast(0.75) brightness(1.15);\\n}\\n:host([data-tiles=\\\"color\\\"]) .leaflet-tile-container {\\n\\tfilter: grayscale(0.2);\\n}\\n:host([data-tiles=\\\"color\\\"]) {\\n\\t--mtdsc-atlas-background: #e5fcfd;\\n}\\n:host:has(.leaflet-container:focus-visible) {\\n\\tbox-shadow: var(--dsc-focus-boxShadow);\\n\\toutline: var(--dsc-focus-outline);\\n\\toutline-offset: var(--ds-border-width-focus);\\n}\\nslot {\\n\\tdisplay: grid;\\n\\tinset: var(--mtds-3);\\n\\tpointer-events: none; /* Ensure slot does not stop pointer from reaching leaflet */\\n\\tposition: absolute;\\n\\tz-index: 2;\\n}\\n::slotted(*) {\\n\\tpointer-events: all; /* But let children of slot stop pointer from reaching leaflet */\\n}\\n.leaflet-div-icon {\\n\\tbackground: none;\\n\\tborder: 0;\\n}\\n.leaflet-container {\\n\\tbackground: var(--mtdsc-atlas-background);\\n\\tborder-radius: inherit;\\n\\tborder: var(--mtdsc-atlas-border);\\n\\tbox-sizing: border-box;\\n\\tfont: inherit;\\n\\toutline: 0;\\n\\tposition: relative;\\n\\tz-index: 1; /* Ensure <slot> is always on top */\\n}\\n.leaflet-control-attribution {\\n\\tfont-size: 12px;\\n\\tborder-top-left-radius: var(--ds-border-radius-md);\\n}\\n\\n.map-pin rect {\\n\\tfill: var(--ds-color-base-contrast-default);\\n}\\n.map-pin path {\\n\\tfill: var(--ds-color-base-default);\\n}\\n\\n.marker-cluster {\\n\\tbackground-color: var(--mtds-color-base-default);\\n\\tborder-radius: 100%;\\n\\tcolor: var(--mtds-color-base-contrast-default);\\n\\tfont-weight: 500;\\n\\tfont-size: var(--ds-body-xs-font-size);\\n\\tline-height: var(--mtdsc-atlas-cluster-size);\\n\\ttext-align: center;\\n\\n\\t/* biome-ignore lint/complexity/noImportantStyles: need to overwrite style attribute */\\n\\twidth: var(--mtdsc-atlas-cluster-size) !important;\\n\\t/* biome-ignore lint/complexity/noImportantStyles: need to overwrite style attribute */\\n\\theight: var(--mtdsc-atlas-cluster-size) !important;\\n\\t/* biome-ignore lint/complexity/noImportantStyles: need to overwrite style attribute */\\n\\tmargin: calc(var(--mtdsc-atlas-cluster-size) / -2) !important;\\n}\\n\""],"names":["css"],"mappings":"AAAA,MAAAA,IAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -9,8 +9,11 @@ export default meta;
|
|
|
9
9
|
type Story = StoryObj<typeof meta>;
|
|
10
10
|
export declare const Default: Story;
|
|
11
11
|
export declare const WithView: Story;
|
|
12
|
+
export declare const WithViewAdvanced: Story;
|
|
12
13
|
export declare const WithColor: Story;
|
|
13
14
|
export declare const WithCustomSize: Story;
|
|
14
15
|
export declare const WithMarker: Story;
|
|
15
|
-
export declare const
|
|
16
|
+
export declare const WithClickToAddMarker: Story;
|
|
16
17
|
export declare const WithClustering: Story;
|
|
18
|
+
export declare const WithPopover: Story;
|
|
19
|
+
export declare const WithoutScrollZoom: Story;
|