@panneau/fields 5.0.0-alpha.5 → 5.0.0-alpha.6
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/README.md +34 -0
- package/dist/duration/DurationField.css +11 -0
- package/dist/duration/DurationField.d.ts +26 -0
- package/dist/duration/DurationField.d.ts.map +1 -0
- package/dist/duration/DurationField.js +129 -0
- package/dist/duration/DurationField.js.map +1 -0
- package/dist/duration/DurationField.module.js +12 -0
- package/dist/duration/DurationField.module.js.map +1 -0
- package/dist/duration/index.d.ts +2 -0
- package/dist/duration/index.d.ts.map +1 -0
- package/dist/duration/index.js +1 -0
- package/dist/embed/EmbedField.css +60 -0
- package/dist/embed/EmbedField.d.ts +20 -0
- package/dist/embed/EmbedField.d.ts.map +1 -0
- package/dist/embed/EmbedField.js +130 -0
- package/dist/embed/EmbedField.js.map +1 -0
- package/dist/embed/EmbedField.module.js +22 -0
- package/dist/embed/EmbedField.module.js.map +1 -0
- package/dist/embed/index.d.ts +3 -0
- package/dist/embed/index.d.ts.map +1 -0
- package/dist/embed/index.js +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/json/JsonField.css +7 -0
- package/dist/json/JsonField.d.ts +22 -0
- package/dist/json/JsonField.d.ts.map +1 -0
- package/dist/json/JsonField.js +125 -0
- package/dist/json/JsonField.js.map +1 -0
- package/dist/json/JsonField.module.js +8 -0
- package/dist/json/JsonField.module.js.map +1 -0
- package/dist/json/index.d.ts +2 -0
- package/dist/json/index.d.ts.map +1 -0
- package/dist/json/index.js +1 -0
- package/dist/location/LocationField.css +54 -0
- package/dist/location/LocationField.d.ts +31 -0
- package/dist/location/LocationField.d.ts.map +1 -0
- package/dist/location/LocationField.js +350 -0
- package/dist/location/LocationField.js.map +1 -0
- package/dist/location/LocationField.module.js +22 -0
- package/dist/location/LocationField.module.js.map +1 -0
- package/dist/location/LocationMap.d.ts +25 -0
- package/dist/location/LocationMap.d.ts.map +1 -0
- package/dist/location/LocationMap.js +115 -0
- package/dist/location/LocationMap.js.map +1 -0
- package/dist/location/index.d.ts +5 -0
- package/dist/location/index.d.ts.map +1 -0
- package/dist/location/index.js +4 -0
- package/dist/location/leafletCss.d.ts +2 -0
- package/dist/location/leafletCss.d.ts.map +1 -0
- package/dist/location/leafletCss.js +6 -0
- package/dist/location/leafletCss.js.map +1 -0
- package/dist/location/nominatim.d.ts +17 -0
- package/dist/location/nominatim.d.ts.map +1 -0
- package/dist/location/nominatim.js +50 -0
- package/dist/location/nominatim.js.map +1 -0
- package/dist/location/types.d.ts +40 -0
- package/dist/location/types.d.ts.map +1 -0
- package/dist/range/RangeField.d.ts +22 -0
- package/dist/range/RangeField.d.ts.map +1 -0
- package/dist/range/RangeField.js +132 -0
- package/dist/range/RangeField.js.map +1 -0
- package/dist/range/index.d.ts +2 -0
- package/dist/range/index.d.ts.map +1 -0
- package/dist/range/index.js +1 -0
- package/dist/shared/builtIn.d.ts +1 -0
- package/dist/shared/builtIn.d.ts.map +1 -1
- package/dist/shared/builtIn.js +16 -1
- package/dist/shared/builtIn.js.map +1 -1
- package/dist/shared/context.d.ts +13 -3
- package/dist/shared/context.d.ts.map +1 -1
- package/dist/shared/context.js +27 -19
- package/dist/shared/context.js.map +1 -1
- package/dist/shared/embed.d.ts +19 -0
- package/dist/shared/embed.d.ts.map +1 -0
- package/dist/shared/embed.js +14 -0
- package/dist/shared/embed.js.map +1 -0
- package/dist/tags/TagsField.d.ts +17 -0
- package/dist/tags/TagsField.d.ts.map +1 -0
- package/dist/tags/TagsField.js +120 -0
- package/dist/tags/TagsField.js.map +1 -0
- package/dist/tags/index.d.ts +2 -0
- package/dist/tags/index.d.ts.map +1 -0
- package/dist/tags/index.js +1 -0
- package/dist/tel/TelField.d.ts +11 -0
- package/dist/tel/TelField.d.ts.map +1 -0
- package/dist/tel/TelField.js +87 -0
- package/dist/tel/TelField.js.map +1 -0
- package/dist/tel/index.d.ts +2 -0
- package/dist/tel/index.d.ts.map +1 -0
- package/dist/tel/index.js +1 -0
- package/package.json +41 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocationField.module.js","names":[],"sources":["../../src/location/LocationField.module.css"],"sourcesContent":["/* The search, the map, then the coordinates and the address. */\n.location {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-2);\n}\n\n.map {\n position: relative;\n z-index: 0;\n height: 16rem;\n overflow: hidden;\n background-color: var(--panneau-color-surface-sunken);\n border: var(--panneau-border-width) solid var(--panneau-color-border-control);\n border-radius: var(--panneau-radius-md);\n}\n\n.map:focus-visible {\n outline: var(--panneau-focus-width) solid var(--panneau-color-focus);\n outline-offset: 1px;\n}\n\n/* A pin: a round head pointing down at the point. */\n.marker {\n background: none;\n border: 0;\n}\n\n.pin {\n display: block;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n background-color: var(--panneau-color-accent);\n border: 2px solid var(--panneau-color-surface);\n border-radius: 50% 50% 50% 0;\n box-shadow: var(--panneau-shadow-sm);\n rotate: -45deg;\n}\n\n.coordinates {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-end;\n gap: var(--panneau-space-2);\n}\n\n.coordinate {\n flex: 1 1 8rem;\n}\n\n.remove {\n flex: none;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { MapTiles } from './types';
|
|
2
|
+
export interface Point {
|
|
3
|
+
lat: number;
|
|
4
|
+
lng: number;
|
|
5
|
+
}
|
|
6
|
+
export interface LocationMapProps {
|
|
7
|
+
point: Point | null;
|
|
8
|
+
/** Called with the point clicked, or where the marker was dropped. */
|
|
9
|
+
onChange?: (point: Point) => void;
|
|
10
|
+
tiles: MapTiles;
|
|
11
|
+
/** Where the map opens without a point. */
|
|
12
|
+
center: Point;
|
|
13
|
+
/** Zoom of the map on a point; the map opens wider without one. */
|
|
14
|
+
zoom: number;
|
|
15
|
+
readOnly?: boolean;
|
|
16
|
+
/** Accessible name of the map. */
|
|
17
|
+
label: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A Leaflet map with a marker on the point. Clicking the map or dragging the marker moves the
|
|
22
|
+
* point. Leaflet and its stylesheet load when the map first shows.
|
|
23
|
+
*/
|
|
24
|
+
export declare function LocationMap({ point, onChange, tiles, center, zoom, readOnly, label, className, }: LocationMapProps): import("react").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=LocationMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocationMap.d.ts","sourceRoot":"","sources":["../../src/location/LocationMap.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAkBxC,MAAM,WAAW,KAAK;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAClC,KAAK,EAAE,QAAQ,CAAC;IAChB,2CAA2C;IAC3C,MAAM,EAAE,KAAK,CAAC;IACd,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EACxB,KAAK,EACL,QAAQ,EACR,KAAK,EACL,MAAM,EACN,IAAI,EACJ,QAAgB,EAChB,KAAK,EACL,SAAS,GACZ,EAAE,gBAAgB,+BAsGlB"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import LocationField_module_default from "./LocationField.module.js";
|
|
2
|
+
import { LEAFLET_CSS } from "./leafletCss.js";
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/location/LocationMap.tsx
|
|
6
|
+
var STYLE_ID = "panneau-leaflet-css";
|
|
7
|
+
/** Adds Leaflet's stylesheet to the document of the map, once. */
|
|
8
|
+
function injectStyles(document) {
|
|
9
|
+
if (document.getElementById(STYLE_ID) === null) {
|
|
10
|
+
const style = document.createElement("style");
|
|
11
|
+
style.id = STYLE_ID;
|
|
12
|
+
style.textContent = LEAFLET_CSS;
|
|
13
|
+
document.head.append(style);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A Leaflet map with a marker on the point. Clicking the map or dragging the marker moves the
|
|
18
|
+
* point. Leaflet and its stylesheet load when the map first shows.
|
|
19
|
+
*/
|
|
20
|
+
function LocationMap({ point, onChange, tiles, center, zoom, readOnly = false, label, className }) {
|
|
21
|
+
const container = useRef(null);
|
|
22
|
+
const map = useRef(null);
|
|
23
|
+
const latest = useRef({
|
|
24
|
+
onChange,
|
|
25
|
+
readOnly
|
|
26
|
+
});
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
latest.current = {
|
|
29
|
+
onChange,
|
|
30
|
+
readOnly
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
const element = container.current;
|
|
35
|
+
if (element === null) return;
|
|
36
|
+
let cancelled = false;
|
|
37
|
+
import("leaflet").then((module) => {
|
|
38
|
+
if (cancelled) return;
|
|
39
|
+
const leaflet = module.default ?? module;
|
|
40
|
+
injectStyles(element.ownerDocument);
|
|
41
|
+
const instance = leaflet.map(element, { attributionControl: true });
|
|
42
|
+
leaflet.tileLayer(tiles.url, {
|
|
43
|
+
attribution: tiles.attribution,
|
|
44
|
+
maxZoom: tiles.maxZoom ?? 19
|
|
45
|
+
}).addTo(instance);
|
|
46
|
+
instance.on("click", (event) => {
|
|
47
|
+
if (!latest.current.readOnly) latest.current.onChange?.({
|
|
48
|
+
lat: event.latlng.lat,
|
|
49
|
+
lng: event.latlng.lng
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
map.current = {
|
|
53
|
+
leaflet,
|
|
54
|
+
map: instance,
|
|
55
|
+
marker: null
|
|
56
|
+
};
|
|
57
|
+
instance.setView(point ?? center, point !== null ? zoom : 2);
|
|
58
|
+
sync(point, false);
|
|
59
|
+
});
|
|
60
|
+
return () => {
|
|
61
|
+
cancelled = true;
|
|
62
|
+
map.current?.map.remove();
|
|
63
|
+
map.current = null;
|
|
64
|
+
};
|
|
65
|
+
}, [tiles.url]);
|
|
66
|
+
/** Puts the marker on the point, and the point in view. */
|
|
67
|
+
function sync(next, pan) {
|
|
68
|
+
const current = map.current;
|
|
69
|
+
if (current === null) return;
|
|
70
|
+
if (next === null) {
|
|
71
|
+
current.marker?.remove();
|
|
72
|
+
current.marker = null;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (current.marker === null) {
|
|
76
|
+
const marker = current.leaflet.marker(next, {
|
|
77
|
+
draggable: !latest.current.readOnly,
|
|
78
|
+
keyboard: false,
|
|
79
|
+
icon: current.leaflet.divIcon({
|
|
80
|
+
className: LocationField_module_default.marker,
|
|
81
|
+
html: `<span class="${LocationField_module_default.pin}"></span>`,
|
|
82
|
+
iconSize: [24, 24],
|
|
83
|
+
iconAnchor: [12, 29]
|
|
84
|
+
})
|
|
85
|
+
}).addTo(current.map);
|
|
86
|
+
marker.on("dragend", () => {
|
|
87
|
+
const position = marker.getLatLng();
|
|
88
|
+
latest.current.onChange?.({
|
|
89
|
+
lat: position.lat,
|
|
90
|
+
lng: position.lng
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
current.marker = marker;
|
|
94
|
+
} else current.marker.setLatLng(next);
|
|
95
|
+
if (pan && !current.map.getBounds().contains(next)) current.map.setView(next, Math.max(current.map.getZoom(), zoom));
|
|
96
|
+
}
|
|
97
|
+
const lat = point?.lat;
|
|
98
|
+
const lng = point?.lng;
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
sync(lat !== void 0 && lng !== void 0 ? {
|
|
101
|
+
lat,
|
|
102
|
+
lng
|
|
103
|
+
} : null, true);
|
|
104
|
+
}, [lat, lng]);
|
|
105
|
+
return /* @__PURE__ */ jsx("div", {
|
|
106
|
+
ref: container,
|
|
107
|
+
className: [LocationField_module_default.map, className].filter(Boolean).join(" "),
|
|
108
|
+
role: "application",
|
|
109
|
+
"aria-label": label
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
export { LocationMap };
|
|
114
|
+
|
|
115
|
+
//# sourceMappingURL=LocationMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocationMap.js","names":["styles"],"sources":["../../src/location/LocationMap.tsx"],"sourcesContent":["import type * as LeafletModule from 'leaflet';\nimport { useEffect, useRef } from 'react';\n\nimport styles from './LocationField.module.css';\nimport { LEAFLET_CSS } from './leafletCss';\nimport type { MapTiles } from './types';\n\ntype Leaflet = typeof LeafletModule;\ntype LeafletMap = LeafletModule.Map;\ntype LeafletMarker = LeafletModule.Marker;\n\nconst STYLE_ID = 'panneau-leaflet-css';\n\n/** Adds Leaflet's stylesheet to the document of the map, once. */\nfunction injectStyles(document: Document) {\n if (document.getElementById(STYLE_ID) === null) {\n const style = document.createElement('style');\n style.id = STYLE_ID;\n style.textContent = LEAFLET_CSS;\n document.head.append(style);\n }\n}\n\nexport interface Point {\n lat: number;\n lng: number;\n}\n\nexport interface LocationMapProps {\n point: Point | null;\n /** Called with the point clicked, or where the marker was dropped. */\n onChange?: (point: Point) => void;\n tiles: MapTiles;\n /** Where the map opens without a point. */\n center: Point;\n /** Zoom of the map on a point; the map opens wider without one. */\n zoom: number;\n readOnly?: boolean;\n /** Accessible name of the map. */\n label: string;\n className?: string;\n}\n\n/**\n * A Leaflet map with a marker on the point. Clicking the map or dragging the marker moves the\n * point. Leaflet and its stylesheet load when the map first shows.\n */\nexport function LocationMap({\n point,\n onChange,\n tiles,\n center,\n zoom,\n readOnly = false,\n label,\n className,\n}: LocationMapProps) {\n const container = useRef<HTMLDivElement>(null);\n const map = useRef<{ leaflet: Leaflet; map: LeafletMap; marker: LeafletMarker | null } | null>(\n null,\n );\n // The latest values, for the handlers of the map\n const latest = useRef({ onChange, readOnly });\n useEffect(() => {\n latest.current = { onChange, readOnly };\n });\n\n // Creates the map once Leaflet is loaded\n useEffect(() => {\n const element = container.current;\n if (element === null) {\n return undefined;\n }\n let cancelled = false;\n void import('leaflet').then((module) => {\n if (cancelled) {\n return;\n }\n const leaflet = ((module as { default?: Leaflet }).default ?? module) as Leaflet;\n injectStyles(element.ownerDocument);\n const instance = leaflet.map(element, { attributionControl: true });\n leaflet\n .tileLayer(tiles.url, {\n attribution: tiles.attribution,\n maxZoom: tiles.maxZoom ?? 19,\n })\n .addTo(instance);\n instance.on('click', (event) => {\n if (!latest.current.readOnly) {\n latest.current.onChange?.({ lat: event.latlng.lat, lng: event.latlng.lng });\n }\n });\n map.current = { leaflet, map: instance, marker: null };\n instance.setView(point ?? center, point !== null ? zoom : 2);\n sync(point, false);\n });\n return () => {\n cancelled = true;\n map.current?.map.remove();\n map.current = null;\n };\n // The map is made once; later changes go through the effect below\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [tiles.url]);\n\n /** Puts the marker on the point, and the point in view. */\n function sync(next: Point | null, pan: boolean) {\n const current = map.current;\n if (current === null) {\n return;\n }\n if (next === null) {\n current.marker?.remove();\n current.marker = null;\n return;\n }\n if (current.marker === null) {\n const marker = current.leaflet\n .marker(next, {\n draggable: !latest.current.readOnly,\n keyboard: false,\n icon: current.leaflet.divIcon({\n className: styles.marker,\n // Leaflet places the icon with `transform`: the pin turns inside it\n html: `<span class=\"${styles.pin}\"></span>`,\n iconSize: [24, 24],\n iconAnchor: [12, 29],\n }),\n })\n .addTo(current.map);\n marker.on('dragend', () => {\n const position = marker.getLatLng();\n latest.current.onChange?.({ lat: position.lat, lng: position.lng });\n });\n current.marker = marker;\n } else {\n current.marker.setLatLng(next);\n }\n if (pan && !current.map.getBounds().contains(next)) {\n current.map.setView(next, Math.max(current.map.getZoom(), zoom));\n }\n }\n\n const lat = point?.lat;\n const lng = point?.lng;\n useEffect(() => {\n sync(lat !== undefined && lng !== undefined ? { lat, lng } : null, true);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [lat, lng]);\n\n return (\n <div\n ref={container}\n className={[styles.map, className].filter(Boolean).join(' ')}\n role=\"application\"\n aria-label={label}\n />\n );\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { LocationField, LocationFieldEntry, type LocationFieldProps, type LocationValue, OPEN_STREET_MAP_TILES, isLocation, } from './LocationField';
|
|
2
|
+
export { LocationMap, type LocationMapProps, type Point } from './LocationMap';
|
|
3
|
+
export { createNominatimSource, type NominatimSourceOptions } from './nominatim';
|
|
4
|
+
export type { GeocodingResult, GeocodingSource, MapTiles, MapsConfig } from './types';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/location/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EACb,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,qBAAqB,EACrB,UAAU,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACjF,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { LocationMap } from "./LocationMap.js";
|
|
2
|
+
import { LocationField, LocationFieldEntry, OPEN_STREET_MAP_TILES, isLocation } from "./LocationField.js";
|
|
3
|
+
import { createNominatimSource } from "./nominatim.js";
|
|
4
|
+
export { LocationField, LocationFieldEntry, LocationMap, OPEN_STREET_MAP_TILES, createNominatimSource, isLocation };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const LEAFLET_CSS = ".leaflet-pane,\r\n.leaflet-tile,\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow,\r\n.leaflet-tile-container,\r\n.leaflet-pane > svg,\r\n.leaflet-pane > canvas,\r\n.leaflet-zoom-box,\r\n.leaflet-image-layer,\r\n.leaflet-layer {\r\n\tposition: absolute;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\t}\r\n.leaflet-container {\r\n\toverflow: hidden;\r\n\t}\r\n.leaflet-tile,\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow {\r\n\t-webkit-user-select: none;\r\n\t -moz-user-select: none;\r\n\t user-select: none;\r\n\t -webkit-user-drag: none;\r\n\t}\r\n.leaflet-tile::selection {\r\n\tbackground: transparent;\r\n}\r\n.leaflet-safari .leaflet-tile {\r\n\timage-rendering: -webkit-optimize-contrast;\r\n\t}\r\n.leaflet-safari .leaflet-tile-container {\r\n\twidth: 1600px;\r\n\theight: 1600px;\r\n\t-webkit-transform-origin: 0 0;\r\n\t}\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow {\r\n\tdisplay: block;\r\n\t}\r\n.leaflet-container .leaflet-overlay-pane svg {\r\n\tmax-width: none !important;\r\n\tmax-height: none !important;\r\n\t}\r\n.leaflet-container .leaflet-marker-pane img,\r\n.leaflet-container .leaflet-shadow-pane img,\r\n.leaflet-container .leaflet-tile-pane img,\r\n.leaflet-container img.leaflet-image-layer,\r\n.leaflet-container .leaflet-tile {\r\n\tmax-width: none !important;\r\n\tmax-height: none !important;\r\n\twidth: auto;\r\n\tpadding: 0;\r\n\t}\r\n.leaflet-container img.leaflet-tile {\r\n\tmix-blend-mode: plus-lighter;\r\n}\r\n.leaflet-container.leaflet-touch-zoom {\r\n\t-ms-touch-action: pan-x pan-y;\r\n\ttouch-action: pan-x pan-y;\r\n\t}\r\n.leaflet-container.leaflet-touch-drag {\r\n\t-ms-touch-action: pinch-zoom;\r\n\ttouch-action: none;\r\n\ttouch-action: pinch-zoom;\r\n}\r\n.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {\r\n\t-ms-touch-action: none;\r\n\ttouch-action: none;\r\n}\r\n.leaflet-container {\r\n\t-webkit-tap-highlight-color: transparent;\r\n}\r\n.leaflet-container a {\r\n\t-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);\r\n}\r\n.leaflet-tile {\r\n\tfilter: inherit;\r\n\tvisibility: hidden;\r\n\t}\r\n.leaflet-tile-loaded {\r\n\tvisibility: inherit;\r\n\t}\r\n.leaflet-zoom-box {\r\n\twidth: 0;\r\n\theight: 0;\r\n\t-moz-box-sizing: border-box;\r\n\t box-sizing: border-box;\r\n\tz-index: 800;\r\n\t}\r\n.leaflet-overlay-pane svg {\r\n\t-moz-user-select: none;\r\n\t}\r\n.leaflet-pane { z-index: 400; }\r\n.leaflet-tile-pane { z-index: 200; }\r\n.leaflet-overlay-pane { z-index: 400; }\r\n.leaflet-shadow-pane { z-index: 500; }\r\n.leaflet-marker-pane { z-index: 600; }\r\n.leaflet-tooltip-pane { z-index: 650; }\r\n.leaflet-popup-pane { z-index: 700; }\r\n.leaflet-map-pane canvas { z-index: 100; }\r\n.leaflet-map-pane svg { z-index: 200; }\r\n.leaflet-vml-shape {\r\n\twidth: 1px;\r\n\theight: 1px;\r\n\t}\r\n.lvml {\r\n\tbehavior: url(#default#VML);\r\n\tdisplay: inline-block;\r\n\tposition: absolute;\r\n\t}\r\n.leaflet-control {\r\n\tposition: relative;\r\n\tz-index: 800;\r\n\tpointer-events: visiblePainted; \r\n\tpointer-events: auto;\r\n\t}\r\n.leaflet-top,\r\n.leaflet-bottom {\r\n\tposition: absolute;\r\n\tz-index: 1000;\r\n\tpointer-events: none;\r\n\t}\r\n.leaflet-top {\r\n\ttop: 0;\r\n\t}\r\n.leaflet-right {\r\n\tright: 0;\r\n\t}\r\n.leaflet-bottom {\r\n\tbottom: 0;\r\n\t}\r\n.leaflet-left {\r\n\tleft: 0;\r\n\t}\r\n.leaflet-control {\r\n\tfloat: left;\r\n\tclear: both;\r\n\t}\r\n.leaflet-right .leaflet-control {\r\n\tfloat: right;\r\n\t}\r\n.leaflet-top .leaflet-control {\r\n\tmargin-top: 10px;\r\n\t}\r\n.leaflet-bottom .leaflet-control {\r\n\tmargin-bottom: 10px;\r\n\t}\r\n.leaflet-left .leaflet-control {\r\n\tmargin-left: 10px;\r\n\t}\r\n.leaflet-right .leaflet-control {\r\n\tmargin-right: 10px;\r\n\t}\r\n.leaflet-fade-anim .leaflet-popup {\r\n\topacity: 0;\r\n\t-webkit-transition: opacity 0.2s linear;\r\n\t -moz-transition: opacity 0.2s linear;\r\n\t transition: opacity 0.2s linear;\r\n\t}\r\n.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {\r\n\topacity: 1;\r\n\t}\r\n.leaflet-zoom-animated {\r\n\t-webkit-transform-origin: 0 0;\r\n\t -ms-transform-origin: 0 0;\r\n\t transform-origin: 0 0;\r\n\t}\r\nsvg.leaflet-zoom-animated {\r\n\twill-change: transform;\r\n}\r\n.leaflet-zoom-anim .leaflet-zoom-animated {\r\n\t-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);\r\n\t -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);\r\n\t transition: transform 0.25s cubic-bezier(0,0,0.25,1);\r\n\t}\r\n.leaflet-zoom-anim .leaflet-tile,\r\n.leaflet-pan-anim .leaflet-tile {\r\n\t-webkit-transition: none;\r\n\t -moz-transition: none;\r\n\t transition: none;\r\n\t}\r\n.leaflet-zoom-anim .leaflet-zoom-hide {\r\n\tvisibility: hidden;\r\n\t}\r\n.leaflet-interactive {\r\n\tcursor: pointer;\r\n\t}\r\n.leaflet-grab {\r\n\tcursor: -webkit-grab;\r\n\tcursor: -moz-grab;\r\n\tcursor: grab;\r\n\t}\r\n.leaflet-crosshair,\r\n.leaflet-crosshair .leaflet-interactive {\r\n\tcursor: crosshair;\r\n\t}\r\n.leaflet-popup-pane,\r\n.leaflet-control {\r\n\tcursor: auto;\r\n\t}\r\n.leaflet-dragging .leaflet-grab,\r\n.leaflet-dragging .leaflet-grab .leaflet-interactive,\r\n.leaflet-dragging .leaflet-marker-draggable {\r\n\tcursor: move;\r\n\tcursor: -webkit-grabbing;\r\n\tcursor: -moz-grabbing;\r\n\tcursor: grabbing;\r\n\t}\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow,\r\n.leaflet-image-layer,\r\n.leaflet-pane > svg path,\r\n.leaflet-tile-container {\r\n\tpointer-events: none;\r\n\t}\r\n.leaflet-marker-icon.leaflet-interactive,\r\n.leaflet-image-layer.leaflet-interactive,\r\n.leaflet-pane > svg path.leaflet-interactive,\r\nsvg.leaflet-image-layer.leaflet-interactive path {\r\n\tpointer-events: visiblePainted; \r\n\tpointer-events: auto;\r\n\t}\r\n.leaflet-container {\r\n\tbackground: #ddd;\r\n\toutline-offset: 1px;\r\n\t}\r\n.leaflet-container a {\r\n\tcolor: #0078A8;\r\n\t}\r\n.leaflet-zoom-box {\r\n\tborder: 2px dotted #38f;\r\n\tbackground: rgba(255,255,255,0.5);\r\n\t}\r\n.leaflet-container {\r\n\tfont-family: \"Helvetica Neue\", Arial, Helvetica, sans-serif;\r\n\tfont-size: 12px;\r\n\tfont-size: 0.75rem;\r\n\tline-height: 1.5;\r\n\t}\r\n.leaflet-bar {\r\n\tbox-shadow: 0 1px 5px rgba(0,0,0,0.65);\r\n\tborder-radius: 4px;\r\n\t}\r\n.leaflet-bar a {\r\n\tbackground-color: #fff;\r\n\tborder-bottom: 1px solid #ccc;\r\n\twidth: 26px;\r\n\theight: 26px;\r\n\tline-height: 26px;\r\n\tdisplay: block;\r\n\ttext-align: center;\r\n\ttext-decoration: none;\r\n\tcolor: black;\r\n\t}\r\n.leaflet-bar a,\r\n.leaflet-control-layers-toggle {\r\n\tbackground-position: 50% 50%;\r\n\tbackground-repeat: no-repeat;\r\n\tdisplay: block;\r\n\t}\r\n.leaflet-bar a:hover,\r\n.leaflet-bar a:focus {\r\n\tbackground-color: #f4f4f4;\r\n\t}\r\n.leaflet-bar a:first-child {\r\n\tborder-top-left-radius: 4px;\r\n\tborder-top-right-radius: 4px;\r\n\t}\r\n.leaflet-bar a:last-child {\r\n\tborder-bottom-left-radius: 4px;\r\n\tborder-bottom-right-radius: 4px;\r\n\tborder-bottom: none;\r\n\t}\r\n.leaflet-bar a.leaflet-disabled {\r\n\tcursor: default;\r\n\tbackground-color: #f4f4f4;\r\n\tcolor: #bbb;\r\n\t}\r\n.leaflet-touch .leaflet-bar a {\r\n\twidth: 30px;\r\n\theight: 30px;\r\n\tline-height: 30px;\r\n\t}\r\n.leaflet-touch .leaflet-bar a:first-child {\r\n\tborder-top-left-radius: 2px;\r\n\tborder-top-right-radius: 2px;\r\n\t}\r\n.leaflet-touch .leaflet-bar a:last-child {\r\n\tborder-bottom-left-radius: 2px;\r\n\tborder-bottom-right-radius: 2px;\r\n\t}\r\n.leaflet-control-zoom-in,\r\n.leaflet-control-zoom-out {\r\n\tfont: bold 18px 'Lucida Console', Monaco, monospace;\r\n\ttext-indent: 1px;\r\n\t}\r\n.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {\r\n\tfont-size: 22px;\r\n\t}\r\n.leaflet-control-layers {\r\n\tbox-shadow: 0 1px 5px rgba(0,0,0,0.4);\r\n\tbackground: #fff;\r\n\tborder-radius: 5px;\r\n\t}\r\n.leaflet-control-layers-toggle {\r\n\tbackground-image: url(images/layers.png);\r\n\twidth: 36px;\r\n\theight: 36px;\r\n\t}\r\n.leaflet-retina .leaflet-control-layers-toggle {\r\n\tbackground-image: url(images/layers-2x.png);\r\n\tbackground-size: 26px 26px;\r\n\t}\r\n.leaflet-touch .leaflet-control-layers-toggle {\r\n\twidth: 44px;\r\n\theight: 44px;\r\n\t}\r\n.leaflet-control-layers .leaflet-control-layers-list,\r\n.leaflet-control-layers-expanded .leaflet-control-layers-toggle {\r\n\tdisplay: none;\r\n\t}\r\n.leaflet-control-layers-expanded .leaflet-control-layers-list {\r\n\tdisplay: block;\r\n\tposition: relative;\r\n\t}\r\n.leaflet-control-layers-expanded {\r\n\tpadding: 6px 10px 6px 6px;\r\n\tcolor: #333;\r\n\tbackground: #fff;\r\n\t}\r\n.leaflet-control-layers-scrollbar {\r\n\toverflow-y: scroll;\r\n\toverflow-x: hidden;\r\n\tpadding-right: 5px;\r\n\t}\r\n.leaflet-control-layers-selector {\r\n\tmargin-top: 2px;\r\n\tposition: relative;\r\n\ttop: 1px;\r\n\t}\r\n.leaflet-control-layers label {\r\n\tdisplay: block;\r\n\tfont-size: 13px;\r\n\tfont-size: 1.08333em;\r\n\t}\r\n.leaflet-control-layers-separator {\r\n\theight: 0;\r\n\tborder-top: 1px solid #ddd;\r\n\tmargin: 5px -10px 5px -6px;\r\n\t}\r\n.leaflet-default-icon-path { \r\n\tbackground-image: url(images/marker-icon.png);\r\n\t}\r\n.leaflet-container .leaflet-control-attribution {\r\n\tbackground: #fff;\r\n\tbackground: rgba(255, 255, 255, 0.8);\r\n\tmargin: 0;\r\n\t}\r\n.leaflet-control-attribution,\r\n.leaflet-control-scale-line {\r\n\tpadding: 0 5px;\r\n\tcolor: #333;\r\n\tline-height: 1.4;\r\n\t}\r\n.leaflet-control-attribution a {\r\n\ttext-decoration: none;\r\n\t}\r\n.leaflet-control-attribution a:hover,\r\n.leaflet-control-attribution a:focus {\r\n\ttext-decoration: underline;\r\n\t}\r\n.leaflet-attribution-flag {\r\n\tdisplay: inline !important;\r\n\tvertical-align: baseline !important;\r\n\twidth: 1em;\r\n\theight: 0.6669em;\r\n\t}\r\n.leaflet-left .leaflet-control-scale {\r\n\tmargin-left: 5px;\r\n\t}\r\n.leaflet-bottom .leaflet-control-scale {\r\n\tmargin-bottom: 5px;\r\n\t}\r\n.leaflet-control-scale-line {\r\n\tborder: 2px solid #777;\r\n\tborder-top: none;\r\n\tline-height: 1.1;\r\n\tpadding: 2px 5px 1px;\r\n\twhite-space: nowrap;\r\n\t-moz-box-sizing: border-box;\r\n\t box-sizing: border-box;\r\n\tbackground: rgba(255, 255, 255, 0.8);\r\n\ttext-shadow: 1px 1px #fff;\r\n\t}\r\n.leaflet-control-scale-line:not(:first-child) {\r\n\tborder-top: 2px solid #777;\r\n\tborder-bottom: none;\r\n\tmargin-top: -2px;\r\n\t}\r\n.leaflet-control-scale-line:not(:first-child):not(:last-child) {\r\n\tborder-bottom: 2px solid #777;\r\n\t}\r\n.leaflet-touch .leaflet-control-attribution,\r\n.leaflet-touch .leaflet-control-layers,\r\n.leaflet-touch .leaflet-bar {\r\n\tbox-shadow: none;\r\n\t}\r\n.leaflet-touch .leaflet-control-layers,\r\n.leaflet-touch .leaflet-bar {\r\n\tborder: 2px solid rgba(0,0,0,0.2);\r\n\tbackground-clip: padding-box;\r\n\t}\r\n.leaflet-popup {\r\n\tposition: absolute;\r\n\ttext-align: center;\r\n\tmargin-bottom: 20px;\r\n\t}\r\n.leaflet-popup-content-wrapper {\r\n\tpadding: 1px;\r\n\ttext-align: left;\r\n\tborder-radius: 12px;\r\n\t}\r\n.leaflet-popup-content {\r\n\tmargin: 13px 24px 13px 20px;\r\n\tline-height: 1.3;\r\n\tfont-size: 13px;\r\n\tfont-size: 1.08333em;\r\n\tmin-height: 1px;\r\n\t}\r\n.leaflet-popup-content p {\r\n\tmargin: 17px 0;\r\n\tmargin: 1.3em 0;\r\n\t}\r\n.leaflet-popup-tip-container {\r\n\twidth: 40px;\r\n\theight: 20px;\r\n\tposition: absolute;\r\n\tleft: 50%;\r\n\tmargin-top: -1px;\r\n\tmargin-left: -20px;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\t}\r\n.leaflet-popup-tip {\r\n\twidth: 17px;\r\n\theight: 17px;\r\n\tpadding: 1px;\r\n\tmargin: -10px auto 0;\r\n\tpointer-events: auto;\r\n\t-webkit-transform: rotate(45deg);\r\n\t -moz-transform: rotate(45deg);\r\n\t -ms-transform: rotate(45deg);\r\n\t transform: rotate(45deg);\r\n\t}\r\n.leaflet-popup-content-wrapper,\r\n.leaflet-popup-tip {\r\n\tbackground: white;\r\n\tcolor: #333;\r\n\tbox-shadow: 0 3px 14px rgba(0,0,0,0.4);\r\n\t}\r\n.leaflet-container a.leaflet-popup-close-button {\r\n\tposition: absolute;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tborder: none;\r\n\ttext-align: center;\r\n\twidth: 24px;\r\n\theight: 24px;\r\n\tfont: 16px/24px Tahoma, Verdana, sans-serif;\r\n\tcolor: #757575;\r\n\ttext-decoration: none;\r\n\tbackground: transparent;\r\n\t}\r\n.leaflet-container a.leaflet-popup-close-button:hover,\r\n.leaflet-container a.leaflet-popup-close-button:focus {\r\n\tcolor: #585858;\r\n\t}\r\n.leaflet-popup-scrolled {\r\n\toverflow: auto;\r\n\t}\r\n.leaflet-oldie .leaflet-popup-content-wrapper {\r\n\t-ms-zoom: 1;\r\n\t}\r\n.leaflet-oldie .leaflet-popup-tip {\r\n\twidth: 24px;\r\n\tmargin: 0 auto;\r\n\t-ms-filter: \"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";\r\n\tfilter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);\r\n\t}\r\n.leaflet-oldie .leaflet-control-zoom,\r\n.leaflet-oldie .leaflet-control-layers,\r\n.leaflet-oldie .leaflet-popup-content-wrapper,\r\n.leaflet-oldie .leaflet-popup-tip {\r\n\tborder: 1px solid #999;\r\n\t}\r\n.leaflet-div-icon {\r\n\tbackground: #fff;\r\n\tborder: 1px solid #666;\r\n\t}\r\n.leaflet-tooltip {\r\n\tposition: absolute;\r\n\tpadding: 6px;\r\n\tbackground-color: #fff;\r\n\tborder: 1px solid #fff;\r\n\tborder-radius: 3px;\r\n\tcolor: #222;\r\n\twhite-space: nowrap;\r\n\t-webkit-user-select: none;\r\n\t-moz-user-select: none;\r\n\t-ms-user-select: none;\r\n\tuser-select: none;\r\n\tpointer-events: none;\r\n\tbox-shadow: 0 1px 3px rgba(0,0,0,0.4);\r\n\t}\r\n.leaflet-tooltip.leaflet-interactive {\r\n\tcursor: pointer;\r\n\tpointer-events: auto;\r\n\t}\r\n.leaflet-tooltip-top:before,\r\n.leaflet-tooltip-bottom:before,\r\n.leaflet-tooltip-left:before,\r\n.leaflet-tooltip-right:before {\r\n\tposition: absolute;\r\n\tpointer-events: none;\r\n\tborder: 6px solid transparent;\r\n\tbackground: transparent;\r\n\tcontent: \"\";\r\n\t}\r\n.leaflet-tooltip-bottom {\r\n\tmargin-top: 6px;\r\n}\r\n.leaflet-tooltip-top {\r\n\tmargin-top: -6px;\r\n}\r\n.leaflet-tooltip-bottom:before,\r\n.leaflet-tooltip-top:before {\r\n\tleft: 50%;\r\n\tmargin-left: -6px;\r\n\t}\r\n.leaflet-tooltip-top:before {\r\n\tbottom: 0;\r\n\tmargin-bottom: -12px;\r\n\tborder-top-color: #fff;\r\n\t}\r\n.leaflet-tooltip-bottom:before {\r\n\ttop: 0;\r\n\tmargin-top: -12px;\r\n\tmargin-left: -6px;\r\n\tborder-bottom-color: #fff;\r\n\t}\r\n.leaflet-tooltip-left {\r\n\tmargin-left: -6px;\r\n}\r\n.leaflet-tooltip-right {\r\n\tmargin-left: 6px;\r\n}\r\n.leaflet-tooltip-left:before,\r\n.leaflet-tooltip-right:before {\r\n\ttop: 50%;\r\n\tmargin-top: -6px;\r\n\t}\r\n.leaflet-tooltip-left:before {\r\n\tright: 0;\r\n\tmargin-right: -12px;\r\n\tborder-left-color: #fff;\r\n\t}\r\n.leaflet-tooltip-right:before {\r\n\tleft: 0;\r\n\tmargin-left: -12px;\r\n\tborder-right-color: #fff;\r\n\t}\r\n@media print {\r\n\t.leaflet-control {\r\n\t\t-webkit-print-color-adjust: exact;\r\n\t\tprint-color-adjust: exact;\r\n\t\t}\r\n\t}";
|
|
2
|
+
//# sourceMappingURL=leafletCss.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leafletCss.d.ts","sourceRoot":"","sources":["../../src/location/leafletCss.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,gqdACqod,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/location/leafletCss.ts
|
|
2
|
+
var LEAFLET_CSS = ".leaflet-pane,\r\n.leaflet-tile,\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow,\r\n.leaflet-tile-container,\r\n.leaflet-pane > svg,\r\n.leaflet-pane > canvas,\r\n.leaflet-zoom-box,\r\n.leaflet-image-layer,\r\n.leaflet-layer {\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n }\r\n.leaflet-container {\r\n overflow: hidden;\r\n }\r\n.leaflet-tile,\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow {\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n -webkit-user-drag: none;\r\n }\r\n.leaflet-tile::selection {\r\n background: transparent;\r\n}\r\n.leaflet-safari .leaflet-tile {\r\n image-rendering: -webkit-optimize-contrast;\r\n }\r\n.leaflet-safari .leaflet-tile-container {\r\n width: 1600px;\r\n height: 1600px;\r\n -webkit-transform-origin: 0 0;\r\n }\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow {\r\n display: block;\r\n }\r\n.leaflet-container .leaflet-overlay-pane svg {\r\n max-width: none !important;\r\n max-height: none !important;\r\n }\r\n.leaflet-container .leaflet-marker-pane img,\r\n.leaflet-container .leaflet-shadow-pane img,\r\n.leaflet-container .leaflet-tile-pane img,\r\n.leaflet-container img.leaflet-image-layer,\r\n.leaflet-container .leaflet-tile {\r\n max-width: none !important;\r\n max-height: none !important;\r\n width: auto;\r\n padding: 0;\r\n }\r\n.leaflet-container img.leaflet-tile {\r\n mix-blend-mode: plus-lighter;\r\n}\r\n.leaflet-container.leaflet-touch-zoom {\r\n -ms-touch-action: pan-x pan-y;\r\n touch-action: pan-x pan-y;\r\n }\r\n.leaflet-container.leaflet-touch-drag {\r\n -ms-touch-action: pinch-zoom;\r\n touch-action: none;\r\n touch-action: pinch-zoom;\r\n}\r\n.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {\r\n -ms-touch-action: none;\r\n touch-action: none;\r\n}\r\n.leaflet-container {\r\n -webkit-tap-highlight-color: transparent;\r\n}\r\n.leaflet-container a {\r\n -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);\r\n}\r\n.leaflet-tile {\r\n filter: inherit;\r\n visibility: hidden;\r\n }\r\n.leaflet-tile-loaded {\r\n visibility: inherit;\r\n }\r\n.leaflet-zoom-box {\r\n width: 0;\r\n height: 0;\r\n -moz-box-sizing: border-box;\r\n box-sizing: border-box;\r\n z-index: 800;\r\n }\r\n.leaflet-overlay-pane svg {\r\n -moz-user-select: none;\r\n }\r\n.leaflet-pane { z-index: 400; }\r\n.leaflet-tile-pane { z-index: 200; }\r\n.leaflet-overlay-pane { z-index: 400; }\r\n.leaflet-shadow-pane { z-index: 500; }\r\n.leaflet-marker-pane { z-index: 600; }\r\n.leaflet-tooltip-pane { z-index: 650; }\r\n.leaflet-popup-pane { z-index: 700; }\r\n.leaflet-map-pane canvas { z-index: 100; }\r\n.leaflet-map-pane svg { z-index: 200; }\r\n.leaflet-vml-shape {\r\n width: 1px;\r\n height: 1px;\r\n }\r\n.lvml {\r\n behavior: url(#default#VML);\r\n display: inline-block;\r\n position: absolute;\r\n }\r\n.leaflet-control {\r\n position: relative;\r\n z-index: 800;\r\n pointer-events: visiblePainted; \r\n pointer-events: auto;\r\n }\r\n.leaflet-top,\r\n.leaflet-bottom {\r\n position: absolute;\r\n z-index: 1000;\r\n pointer-events: none;\r\n }\r\n.leaflet-top {\r\n top: 0;\r\n }\r\n.leaflet-right {\r\n right: 0;\r\n }\r\n.leaflet-bottom {\r\n bottom: 0;\r\n }\r\n.leaflet-left {\r\n left: 0;\r\n }\r\n.leaflet-control {\r\n float: left;\r\n clear: both;\r\n }\r\n.leaflet-right .leaflet-control {\r\n float: right;\r\n }\r\n.leaflet-top .leaflet-control {\r\n margin-top: 10px;\r\n }\r\n.leaflet-bottom .leaflet-control {\r\n margin-bottom: 10px;\r\n }\r\n.leaflet-left .leaflet-control {\r\n margin-left: 10px;\r\n }\r\n.leaflet-right .leaflet-control {\r\n margin-right: 10px;\r\n }\r\n.leaflet-fade-anim .leaflet-popup {\r\n opacity: 0;\r\n -webkit-transition: opacity 0.2s linear;\r\n -moz-transition: opacity 0.2s linear;\r\n transition: opacity 0.2s linear;\r\n }\r\n.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {\r\n opacity: 1;\r\n }\r\n.leaflet-zoom-animated {\r\n -webkit-transform-origin: 0 0;\r\n -ms-transform-origin: 0 0;\r\n transform-origin: 0 0;\r\n }\r\nsvg.leaflet-zoom-animated {\r\n will-change: transform;\r\n}\r\n.leaflet-zoom-anim .leaflet-zoom-animated {\r\n -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);\r\n -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);\r\n transition: transform 0.25s cubic-bezier(0,0,0.25,1);\r\n }\r\n.leaflet-zoom-anim .leaflet-tile,\r\n.leaflet-pan-anim .leaflet-tile {\r\n -webkit-transition: none;\r\n -moz-transition: none;\r\n transition: none;\r\n }\r\n.leaflet-zoom-anim .leaflet-zoom-hide {\r\n visibility: hidden;\r\n }\r\n.leaflet-interactive {\r\n cursor: pointer;\r\n }\r\n.leaflet-grab {\r\n cursor: -webkit-grab;\r\n cursor: -moz-grab;\r\n cursor: grab;\r\n }\r\n.leaflet-crosshair,\r\n.leaflet-crosshair .leaflet-interactive {\r\n cursor: crosshair;\r\n }\r\n.leaflet-popup-pane,\r\n.leaflet-control {\r\n cursor: auto;\r\n }\r\n.leaflet-dragging .leaflet-grab,\r\n.leaflet-dragging .leaflet-grab .leaflet-interactive,\r\n.leaflet-dragging .leaflet-marker-draggable {\r\n cursor: move;\r\n cursor: -webkit-grabbing;\r\n cursor: -moz-grabbing;\r\n cursor: grabbing;\r\n }\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow,\r\n.leaflet-image-layer,\r\n.leaflet-pane > svg path,\r\n.leaflet-tile-container {\r\n pointer-events: none;\r\n }\r\n.leaflet-marker-icon.leaflet-interactive,\r\n.leaflet-image-layer.leaflet-interactive,\r\n.leaflet-pane > svg path.leaflet-interactive,\r\nsvg.leaflet-image-layer.leaflet-interactive path {\r\n pointer-events: visiblePainted; \r\n pointer-events: auto;\r\n }\r\n.leaflet-container {\r\n background: #ddd;\r\n outline-offset: 1px;\r\n }\r\n.leaflet-container a {\r\n color: #0078A8;\r\n }\r\n.leaflet-zoom-box {\r\n border: 2px dotted #38f;\r\n background: rgba(255,255,255,0.5);\r\n }\r\n.leaflet-container {\r\n font-family: \"Helvetica Neue\", Arial, Helvetica, sans-serif;\r\n font-size: 12px;\r\n font-size: 0.75rem;\r\n line-height: 1.5;\r\n }\r\n.leaflet-bar {\r\n box-shadow: 0 1px 5px rgba(0,0,0,0.65);\r\n border-radius: 4px;\r\n }\r\n.leaflet-bar a {\r\n background-color: #fff;\r\n border-bottom: 1px solid #ccc;\r\n width: 26px;\r\n height: 26px;\r\n line-height: 26px;\r\n display: block;\r\n text-align: center;\r\n text-decoration: none;\r\n color: black;\r\n }\r\n.leaflet-bar a,\r\n.leaflet-control-layers-toggle {\r\n background-position: 50% 50%;\r\n background-repeat: no-repeat;\r\n display: block;\r\n }\r\n.leaflet-bar a:hover,\r\n.leaflet-bar a:focus {\r\n background-color: #f4f4f4;\r\n }\r\n.leaflet-bar a:first-child {\r\n border-top-left-radius: 4px;\r\n border-top-right-radius: 4px;\r\n }\r\n.leaflet-bar a:last-child {\r\n border-bottom-left-radius: 4px;\r\n border-bottom-right-radius: 4px;\r\n border-bottom: none;\r\n }\r\n.leaflet-bar a.leaflet-disabled {\r\n cursor: default;\r\n background-color: #f4f4f4;\r\n color: #bbb;\r\n }\r\n.leaflet-touch .leaflet-bar a {\r\n width: 30px;\r\n height: 30px;\r\n line-height: 30px;\r\n }\r\n.leaflet-touch .leaflet-bar a:first-child {\r\n border-top-left-radius: 2px;\r\n border-top-right-radius: 2px;\r\n }\r\n.leaflet-touch .leaflet-bar a:last-child {\r\n border-bottom-left-radius: 2px;\r\n border-bottom-right-radius: 2px;\r\n }\r\n.leaflet-control-zoom-in,\r\n.leaflet-control-zoom-out {\r\n font: bold 18px 'Lucida Console', Monaco, monospace;\r\n text-indent: 1px;\r\n }\r\n.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {\r\n font-size: 22px;\r\n }\r\n.leaflet-control-layers {\r\n box-shadow: 0 1px 5px rgba(0,0,0,0.4);\r\n background: #fff;\r\n border-radius: 5px;\r\n }\r\n.leaflet-control-layers-toggle {\r\n background-image: url(images/layers.png);\r\n width: 36px;\r\n height: 36px;\r\n }\r\n.leaflet-retina .leaflet-control-layers-toggle {\r\n background-image: url(images/layers-2x.png);\r\n background-size: 26px 26px;\r\n }\r\n.leaflet-touch .leaflet-control-layers-toggle {\r\n width: 44px;\r\n height: 44px;\r\n }\r\n.leaflet-control-layers .leaflet-control-layers-list,\r\n.leaflet-control-layers-expanded .leaflet-control-layers-toggle {\r\n display: none;\r\n }\r\n.leaflet-control-layers-expanded .leaflet-control-layers-list {\r\n display: block;\r\n position: relative;\r\n }\r\n.leaflet-control-layers-expanded {\r\n padding: 6px 10px 6px 6px;\r\n color: #333;\r\n background: #fff;\r\n }\r\n.leaflet-control-layers-scrollbar {\r\n overflow-y: scroll;\r\n overflow-x: hidden;\r\n padding-right: 5px;\r\n }\r\n.leaflet-control-layers-selector {\r\n margin-top: 2px;\r\n position: relative;\r\n top: 1px;\r\n }\r\n.leaflet-control-layers label {\r\n display: block;\r\n font-size: 13px;\r\n font-size: 1.08333em;\r\n }\r\n.leaflet-control-layers-separator {\r\n height: 0;\r\n border-top: 1px solid #ddd;\r\n margin: 5px -10px 5px -6px;\r\n }\r\n.leaflet-default-icon-path { \r\n background-image: url(images/marker-icon.png);\r\n }\r\n.leaflet-container .leaflet-control-attribution {\r\n background: #fff;\r\n background: rgba(255, 255, 255, 0.8);\r\n margin: 0;\r\n }\r\n.leaflet-control-attribution,\r\n.leaflet-control-scale-line {\r\n padding: 0 5px;\r\n color: #333;\r\n line-height: 1.4;\r\n }\r\n.leaflet-control-attribution a {\r\n text-decoration: none;\r\n }\r\n.leaflet-control-attribution a:hover,\r\n.leaflet-control-attribution a:focus {\r\n text-decoration: underline;\r\n }\r\n.leaflet-attribution-flag {\r\n display: inline !important;\r\n vertical-align: baseline !important;\r\n width: 1em;\r\n height: 0.6669em;\r\n }\r\n.leaflet-left .leaflet-control-scale {\r\n margin-left: 5px;\r\n }\r\n.leaflet-bottom .leaflet-control-scale {\r\n margin-bottom: 5px;\r\n }\r\n.leaflet-control-scale-line {\r\n border: 2px solid #777;\r\n border-top: none;\r\n line-height: 1.1;\r\n padding: 2px 5px 1px;\r\n white-space: nowrap;\r\n -moz-box-sizing: border-box;\r\n box-sizing: border-box;\r\n background: rgba(255, 255, 255, 0.8);\r\n text-shadow: 1px 1px #fff;\r\n }\r\n.leaflet-control-scale-line:not(:first-child) {\r\n border-top: 2px solid #777;\r\n border-bottom: none;\r\n margin-top: -2px;\r\n }\r\n.leaflet-control-scale-line:not(:first-child):not(:last-child) {\r\n border-bottom: 2px solid #777;\r\n }\r\n.leaflet-touch .leaflet-control-attribution,\r\n.leaflet-touch .leaflet-control-layers,\r\n.leaflet-touch .leaflet-bar {\r\n box-shadow: none;\r\n }\r\n.leaflet-touch .leaflet-control-layers,\r\n.leaflet-touch .leaflet-bar {\r\n border: 2px solid rgba(0,0,0,0.2);\r\n background-clip: padding-box;\r\n }\r\n.leaflet-popup {\r\n position: absolute;\r\n text-align: center;\r\n margin-bottom: 20px;\r\n }\r\n.leaflet-popup-content-wrapper {\r\n padding: 1px;\r\n text-align: left;\r\n border-radius: 12px;\r\n }\r\n.leaflet-popup-content {\r\n margin: 13px 24px 13px 20px;\r\n line-height: 1.3;\r\n font-size: 13px;\r\n font-size: 1.08333em;\r\n min-height: 1px;\r\n }\r\n.leaflet-popup-content p {\r\n margin: 17px 0;\r\n margin: 1.3em 0;\r\n }\r\n.leaflet-popup-tip-container {\r\n width: 40px;\r\n height: 20px;\r\n position: absolute;\r\n left: 50%;\r\n margin-top: -1px;\r\n margin-left: -20px;\r\n overflow: hidden;\r\n pointer-events: none;\r\n }\r\n.leaflet-popup-tip {\r\n width: 17px;\r\n height: 17px;\r\n padding: 1px;\r\n margin: -10px auto 0;\r\n pointer-events: auto;\r\n -webkit-transform: rotate(45deg);\r\n -moz-transform: rotate(45deg);\r\n -ms-transform: rotate(45deg);\r\n transform: rotate(45deg);\r\n }\r\n.leaflet-popup-content-wrapper,\r\n.leaflet-popup-tip {\r\n background: white;\r\n color: #333;\r\n box-shadow: 0 3px 14px rgba(0,0,0,0.4);\r\n }\r\n.leaflet-container a.leaflet-popup-close-button {\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n border: none;\r\n text-align: center;\r\n width: 24px;\r\n height: 24px;\r\n font: 16px/24px Tahoma, Verdana, sans-serif;\r\n color: #757575;\r\n text-decoration: none;\r\n background: transparent;\r\n }\r\n.leaflet-container a.leaflet-popup-close-button:hover,\r\n.leaflet-container a.leaflet-popup-close-button:focus {\r\n color: #585858;\r\n }\r\n.leaflet-popup-scrolled {\r\n overflow: auto;\r\n }\r\n.leaflet-oldie .leaflet-popup-content-wrapper {\r\n -ms-zoom: 1;\r\n }\r\n.leaflet-oldie .leaflet-popup-tip {\r\n width: 24px;\r\n margin: 0 auto;\r\n -ms-filter: \"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";\r\n filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);\r\n }\r\n.leaflet-oldie .leaflet-control-zoom,\r\n.leaflet-oldie .leaflet-control-layers,\r\n.leaflet-oldie .leaflet-popup-content-wrapper,\r\n.leaflet-oldie .leaflet-popup-tip {\r\n border: 1px solid #999;\r\n }\r\n.leaflet-div-icon {\r\n background: #fff;\r\n border: 1px solid #666;\r\n }\r\n.leaflet-tooltip {\r\n position: absolute;\r\n padding: 6px;\r\n background-color: #fff;\r\n border: 1px solid #fff;\r\n border-radius: 3px;\r\n color: #222;\r\n white-space: nowrap;\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n -ms-user-select: none;\r\n user-select: none;\r\n pointer-events: none;\r\n box-shadow: 0 1px 3px rgba(0,0,0,0.4);\r\n }\r\n.leaflet-tooltip.leaflet-interactive {\r\n cursor: pointer;\r\n pointer-events: auto;\r\n }\r\n.leaflet-tooltip-top:before,\r\n.leaflet-tooltip-bottom:before,\r\n.leaflet-tooltip-left:before,\r\n.leaflet-tooltip-right:before {\r\n position: absolute;\r\n pointer-events: none;\r\n border: 6px solid transparent;\r\n background: transparent;\r\n content: \"\";\r\n }\r\n.leaflet-tooltip-bottom {\r\n margin-top: 6px;\r\n}\r\n.leaflet-tooltip-top {\r\n margin-top: -6px;\r\n}\r\n.leaflet-tooltip-bottom:before,\r\n.leaflet-tooltip-top:before {\r\n left: 50%;\r\n margin-left: -6px;\r\n }\r\n.leaflet-tooltip-top:before {\r\n bottom: 0;\r\n margin-bottom: -12px;\r\n border-top-color: #fff;\r\n }\r\n.leaflet-tooltip-bottom:before {\r\n top: 0;\r\n margin-top: -12px;\r\n margin-left: -6px;\r\n border-bottom-color: #fff;\r\n }\r\n.leaflet-tooltip-left {\r\n margin-left: -6px;\r\n}\r\n.leaflet-tooltip-right {\r\n margin-left: 6px;\r\n}\r\n.leaflet-tooltip-left:before,\r\n.leaflet-tooltip-right:before {\r\n top: 50%;\r\n margin-top: -6px;\r\n }\r\n.leaflet-tooltip-left:before {\r\n right: 0;\r\n margin-right: -12px;\r\n border-left-color: #fff;\r\n }\r\n.leaflet-tooltip-right:before {\r\n left: 0;\r\n margin-left: -12px;\r\n border-right-color: #fff;\r\n }\r\n@media print {\r\n .leaflet-control {\r\n -webkit-print-color-adjust: exact;\r\n print-color-adjust: exact;\r\n }\r\n }";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { LEAFLET_CSS };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=leafletCss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leafletCss.js","names":[],"sources":["../../src/location/leafletCss.ts"],"sourcesContent":["// The stylesheet of Leaflet 1.9.4 (BSD-2-Clause, (c) Volodymyr Agafonkin and CloudMade), without\n// its comments: Leaflet's own classes, injected once when a map first shows. Regenerate it from\n// leaflet/dist/leaflet.css when Leaflet is updated.\nexport const LEAFLET_CSS =\n '.leaflet-pane,\\r\\n.leaflet-tile,\\r\\n.leaflet-marker-icon,\\r\\n.leaflet-marker-shadow,\\r\\n.leaflet-tile-container,\\r\\n.leaflet-pane > svg,\\r\\n.leaflet-pane > canvas,\\r\\n.leaflet-zoom-box,\\r\\n.leaflet-image-layer,\\r\\n.leaflet-layer {\\r\\n\\tposition: absolute;\\r\\n\\tleft: 0;\\r\\n\\ttop: 0;\\r\\n\\t}\\r\\n.leaflet-container {\\r\\n\\toverflow: hidden;\\r\\n\\t}\\r\\n.leaflet-tile,\\r\\n.leaflet-marker-icon,\\r\\n.leaflet-marker-shadow {\\r\\n\\t-webkit-user-select: none;\\r\\n\\t -moz-user-select: none;\\r\\n\\t user-select: none;\\r\\n\\t -webkit-user-drag: none;\\r\\n\\t}\\r\\n.leaflet-tile::selection {\\r\\n\\tbackground: transparent;\\r\\n}\\r\\n.leaflet-safari .leaflet-tile {\\r\\n\\timage-rendering: -webkit-optimize-contrast;\\r\\n\\t}\\r\\n.leaflet-safari .leaflet-tile-container {\\r\\n\\twidth: 1600px;\\r\\n\\theight: 1600px;\\r\\n\\t-webkit-transform-origin: 0 0;\\r\\n\\t}\\r\\n.leaflet-marker-icon,\\r\\n.leaflet-marker-shadow {\\r\\n\\tdisplay: block;\\r\\n\\t}\\r\\n.leaflet-container .leaflet-overlay-pane svg {\\r\\n\\tmax-width: none !important;\\r\\n\\tmax-height: none !important;\\r\\n\\t}\\r\\n.leaflet-container .leaflet-marker-pane img,\\r\\n.leaflet-container .leaflet-shadow-pane img,\\r\\n.leaflet-container .leaflet-tile-pane img,\\r\\n.leaflet-container img.leaflet-image-layer,\\r\\n.leaflet-container .leaflet-tile {\\r\\n\\tmax-width: none !important;\\r\\n\\tmax-height: none !important;\\r\\n\\twidth: auto;\\r\\n\\tpadding: 0;\\r\\n\\t}\\r\\n.leaflet-container img.leaflet-tile {\\r\\n\\tmix-blend-mode: plus-lighter;\\r\\n}\\r\\n.leaflet-container.leaflet-touch-zoom {\\r\\n\\t-ms-touch-action: pan-x pan-y;\\r\\n\\ttouch-action: pan-x pan-y;\\r\\n\\t}\\r\\n.leaflet-container.leaflet-touch-drag {\\r\\n\\t-ms-touch-action: pinch-zoom;\\r\\n\\ttouch-action: none;\\r\\n\\ttouch-action: pinch-zoom;\\r\\n}\\r\\n.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {\\r\\n\\t-ms-touch-action: none;\\r\\n\\ttouch-action: none;\\r\\n}\\r\\n.leaflet-container {\\r\\n\\t-webkit-tap-highlight-color: transparent;\\r\\n}\\r\\n.leaflet-container a {\\r\\n\\t-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);\\r\\n}\\r\\n.leaflet-tile {\\r\\n\\tfilter: inherit;\\r\\n\\tvisibility: hidden;\\r\\n\\t}\\r\\n.leaflet-tile-loaded {\\r\\n\\tvisibility: inherit;\\r\\n\\t}\\r\\n.leaflet-zoom-box {\\r\\n\\twidth: 0;\\r\\n\\theight: 0;\\r\\n\\t-moz-box-sizing: border-box;\\r\\n\\t box-sizing: border-box;\\r\\n\\tz-index: 800;\\r\\n\\t}\\r\\n.leaflet-overlay-pane svg {\\r\\n\\t-moz-user-select: none;\\r\\n\\t}\\r\\n.leaflet-pane { z-index: 400; }\\r\\n.leaflet-tile-pane { z-index: 200; }\\r\\n.leaflet-overlay-pane { z-index: 400; }\\r\\n.leaflet-shadow-pane { z-index: 500; }\\r\\n.leaflet-marker-pane { z-index: 600; }\\r\\n.leaflet-tooltip-pane { z-index: 650; }\\r\\n.leaflet-popup-pane { z-index: 700; }\\r\\n.leaflet-map-pane canvas { z-index: 100; }\\r\\n.leaflet-map-pane svg { z-index: 200; }\\r\\n.leaflet-vml-shape {\\r\\n\\twidth: 1px;\\r\\n\\theight: 1px;\\r\\n\\t}\\r\\n.lvml {\\r\\n\\tbehavior: url(#default#VML);\\r\\n\\tdisplay: inline-block;\\r\\n\\tposition: absolute;\\r\\n\\t}\\r\\n.leaflet-control {\\r\\n\\tposition: relative;\\r\\n\\tz-index: 800;\\r\\n\\tpointer-events: visiblePainted; \\r\\n\\tpointer-events: auto;\\r\\n\\t}\\r\\n.leaflet-top,\\r\\n.leaflet-bottom {\\r\\n\\tposition: absolute;\\r\\n\\tz-index: 1000;\\r\\n\\tpointer-events: none;\\r\\n\\t}\\r\\n.leaflet-top {\\r\\n\\ttop: 0;\\r\\n\\t}\\r\\n.leaflet-right {\\r\\n\\tright: 0;\\r\\n\\t}\\r\\n.leaflet-bottom {\\r\\n\\tbottom: 0;\\r\\n\\t}\\r\\n.leaflet-left {\\r\\n\\tleft: 0;\\r\\n\\t}\\r\\n.leaflet-control {\\r\\n\\tfloat: left;\\r\\n\\tclear: both;\\r\\n\\t}\\r\\n.leaflet-right .leaflet-control {\\r\\n\\tfloat: right;\\r\\n\\t}\\r\\n.leaflet-top .leaflet-control {\\r\\n\\tmargin-top: 10px;\\r\\n\\t}\\r\\n.leaflet-bottom .leaflet-control {\\r\\n\\tmargin-bottom: 10px;\\r\\n\\t}\\r\\n.leaflet-left .leaflet-control {\\r\\n\\tmargin-left: 10px;\\r\\n\\t}\\r\\n.leaflet-right .leaflet-control {\\r\\n\\tmargin-right: 10px;\\r\\n\\t}\\r\\n.leaflet-fade-anim .leaflet-popup {\\r\\n\\topacity: 0;\\r\\n\\t-webkit-transition: opacity 0.2s linear;\\r\\n\\t -moz-transition: opacity 0.2s linear;\\r\\n\\t transition: opacity 0.2s linear;\\r\\n\\t}\\r\\n.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {\\r\\n\\topacity: 1;\\r\\n\\t}\\r\\n.leaflet-zoom-animated {\\r\\n\\t-webkit-transform-origin: 0 0;\\r\\n\\t -ms-transform-origin: 0 0;\\r\\n\\t transform-origin: 0 0;\\r\\n\\t}\\r\\nsvg.leaflet-zoom-animated {\\r\\n\\twill-change: transform;\\r\\n}\\r\\n.leaflet-zoom-anim .leaflet-zoom-animated {\\r\\n\\t-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);\\r\\n\\t -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);\\r\\n\\t transition: transform 0.25s cubic-bezier(0,0,0.25,1);\\r\\n\\t}\\r\\n.leaflet-zoom-anim .leaflet-tile,\\r\\n.leaflet-pan-anim .leaflet-tile {\\r\\n\\t-webkit-transition: none;\\r\\n\\t -moz-transition: none;\\r\\n\\t transition: none;\\r\\n\\t}\\r\\n.leaflet-zoom-anim .leaflet-zoom-hide {\\r\\n\\tvisibility: hidden;\\r\\n\\t}\\r\\n.leaflet-interactive {\\r\\n\\tcursor: pointer;\\r\\n\\t}\\r\\n.leaflet-grab {\\r\\n\\tcursor: -webkit-grab;\\r\\n\\tcursor: -moz-grab;\\r\\n\\tcursor: grab;\\r\\n\\t}\\r\\n.leaflet-crosshair,\\r\\n.leaflet-crosshair .leaflet-interactive {\\r\\n\\tcursor: crosshair;\\r\\n\\t}\\r\\n.leaflet-popup-pane,\\r\\n.leaflet-control {\\r\\n\\tcursor: auto;\\r\\n\\t}\\r\\n.leaflet-dragging .leaflet-grab,\\r\\n.leaflet-dragging .leaflet-grab .leaflet-interactive,\\r\\n.leaflet-dragging .leaflet-marker-draggable {\\r\\n\\tcursor: move;\\r\\n\\tcursor: -webkit-grabbing;\\r\\n\\tcursor: -moz-grabbing;\\r\\n\\tcursor: grabbing;\\r\\n\\t}\\r\\n.leaflet-marker-icon,\\r\\n.leaflet-marker-shadow,\\r\\n.leaflet-image-layer,\\r\\n.leaflet-pane > svg path,\\r\\n.leaflet-tile-container {\\r\\n\\tpointer-events: none;\\r\\n\\t}\\r\\n.leaflet-marker-icon.leaflet-interactive,\\r\\n.leaflet-image-layer.leaflet-interactive,\\r\\n.leaflet-pane > svg path.leaflet-interactive,\\r\\nsvg.leaflet-image-layer.leaflet-interactive path {\\r\\n\\tpointer-events: visiblePainted; \\r\\n\\tpointer-events: auto;\\r\\n\\t}\\r\\n.leaflet-container {\\r\\n\\tbackground: #ddd;\\r\\n\\toutline-offset: 1px;\\r\\n\\t}\\r\\n.leaflet-container a {\\r\\n\\tcolor: #0078A8;\\r\\n\\t}\\r\\n.leaflet-zoom-box {\\r\\n\\tborder: 2px dotted #38f;\\r\\n\\tbackground: rgba(255,255,255,0.5);\\r\\n\\t}\\r\\n.leaflet-container {\\r\\n\\tfont-family: \"Helvetica Neue\", Arial, Helvetica, sans-serif;\\r\\n\\tfont-size: 12px;\\r\\n\\tfont-size: 0.75rem;\\r\\n\\tline-height: 1.5;\\r\\n\\t}\\r\\n.leaflet-bar {\\r\\n\\tbox-shadow: 0 1px 5px rgba(0,0,0,0.65);\\r\\n\\tborder-radius: 4px;\\r\\n\\t}\\r\\n.leaflet-bar a {\\r\\n\\tbackground-color: #fff;\\r\\n\\tborder-bottom: 1px solid #ccc;\\r\\n\\twidth: 26px;\\r\\n\\theight: 26px;\\r\\n\\tline-height: 26px;\\r\\n\\tdisplay: block;\\r\\n\\ttext-align: center;\\r\\n\\ttext-decoration: none;\\r\\n\\tcolor: black;\\r\\n\\t}\\r\\n.leaflet-bar a,\\r\\n.leaflet-control-layers-toggle {\\r\\n\\tbackground-position: 50% 50%;\\r\\n\\tbackground-repeat: no-repeat;\\r\\n\\tdisplay: block;\\r\\n\\t}\\r\\n.leaflet-bar a:hover,\\r\\n.leaflet-bar a:focus {\\r\\n\\tbackground-color: #f4f4f4;\\r\\n\\t}\\r\\n.leaflet-bar a:first-child {\\r\\n\\tborder-top-left-radius: 4px;\\r\\n\\tborder-top-right-radius: 4px;\\r\\n\\t}\\r\\n.leaflet-bar a:last-child {\\r\\n\\tborder-bottom-left-radius: 4px;\\r\\n\\tborder-bottom-right-radius: 4px;\\r\\n\\tborder-bottom: none;\\r\\n\\t}\\r\\n.leaflet-bar a.leaflet-disabled {\\r\\n\\tcursor: default;\\r\\n\\tbackground-color: #f4f4f4;\\r\\n\\tcolor: #bbb;\\r\\n\\t}\\r\\n.leaflet-touch .leaflet-bar a {\\r\\n\\twidth: 30px;\\r\\n\\theight: 30px;\\r\\n\\tline-height: 30px;\\r\\n\\t}\\r\\n.leaflet-touch .leaflet-bar a:first-child {\\r\\n\\tborder-top-left-radius: 2px;\\r\\n\\tborder-top-right-radius: 2px;\\r\\n\\t}\\r\\n.leaflet-touch .leaflet-bar a:last-child {\\r\\n\\tborder-bottom-left-radius: 2px;\\r\\n\\tborder-bottom-right-radius: 2px;\\r\\n\\t}\\r\\n.leaflet-control-zoom-in,\\r\\n.leaflet-control-zoom-out {\\r\\n\\tfont: bold 18px \\'Lucida Console\\', Monaco, monospace;\\r\\n\\ttext-indent: 1px;\\r\\n\\t}\\r\\n.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {\\r\\n\\tfont-size: 22px;\\r\\n\\t}\\r\\n.leaflet-control-layers {\\r\\n\\tbox-shadow: 0 1px 5px rgba(0,0,0,0.4);\\r\\n\\tbackground: #fff;\\r\\n\\tborder-radius: 5px;\\r\\n\\t}\\r\\n.leaflet-control-layers-toggle {\\r\\n\\tbackground-image: url(images/layers.png);\\r\\n\\twidth: 36px;\\r\\n\\theight: 36px;\\r\\n\\t}\\r\\n.leaflet-retina .leaflet-control-layers-toggle {\\r\\n\\tbackground-image: url(images/layers-2x.png);\\r\\n\\tbackground-size: 26px 26px;\\r\\n\\t}\\r\\n.leaflet-touch .leaflet-control-layers-toggle {\\r\\n\\twidth: 44px;\\r\\n\\theight: 44px;\\r\\n\\t}\\r\\n.leaflet-control-layers .leaflet-control-layers-list,\\r\\n.leaflet-control-layers-expanded .leaflet-control-layers-toggle {\\r\\n\\tdisplay: none;\\r\\n\\t}\\r\\n.leaflet-control-layers-expanded .leaflet-control-layers-list {\\r\\n\\tdisplay: block;\\r\\n\\tposition: relative;\\r\\n\\t}\\r\\n.leaflet-control-layers-expanded {\\r\\n\\tpadding: 6px 10px 6px 6px;\\r\\n\\tcolor: #333;\\r\\n\\tbackground: #fff;\\r\\n\\t}\\r\\n.leaflet-control-layers-scrollbar {\\r\\n\\toverflow-y: scroll;\\r\\n\\toverflow-x: hidden;\\r\\n\\tpadding-right: 5px;\\r\\n\\t}\\r\\n.leaflet-control-layers-selector {\\r\\n\\tmargin-top: 2px;\\r\\n\\tposition: relative;\\r\\n\\ttop: 1px;\\r\\n\\t}\\r\\n.leaflet-control-layers label {\\r\\n\\tdisplay: block;\\r\\n\\tfont-size: 13px;\\r\\n\\tfont-size: 1.08333em;\\r\\n\\t}\\r\\n.leaflet-control-layers-separator {\\r\\n\\theight: 0;\\r\\n\\tborder-top: 1px solid #ddd;\\r\\n\\tmargin: 5px -10px 5px -6px;\\r\\n\\t}\\r\\n.leaflet-default-icon-path { \\r\\n\\tbackground-image: url(images/marker-icon.png);\\r\\n\\t}\\r\\n.leaflet-container .leaflet-control-attribution {\\r\\n\\tbackground: #fff;\\r\\n\\tbackground: rgba(255, 255, 255, 0.8);\\r\\n\\tmargin: 0;\\r\\n\\t}\\r\\n.leaflet-control-attribution,\\r\\n.leaflet-control-scale-line {\\r\\n\\tpadding: 0 5px;\\r\\n\\tcolor: #333;\\r\\n\\tline-height: 1.4;\\r\\n\\t}\\r\\n.leaflet-control-attribution a {\\r\\n\\ttext-decoration: none;\\r\\n\\t}\\r\\n.leaflet-control-attribution a:hover,\\r\\n.leaflet-control-attribution a:focus {\\r\\n\\ttext-decoration: underline;\\r\\n\\t}\\r\\n.leaflet-attribution-flag {\\r\\n\\tdisplay: inline !important;\\r\\n\\tvertical-align: baseline !important;\\r\\n\\twidth: 1em;\\r\\n\\theight: 0.6669em;\\r\\n\\t}\\r\\n.leaflet-left .leaflet-control-scale {\\r\\n\\tmargin-left: 5px;\\r\\n\\t}\\r\\n.leaflet-bottom .leaflet-control-scale {\\r\\n\\tmargin-bottom: 5px;\\r\\n\\t}\\r\\n.leaflet-control-scale-line {\\r\\n\\tborder: 2px solid #777;\\r\\n\\tborder-top: none;\\r\\n\\tline-height: 1.1;\\r\\n\\tpadding: 2px 5px 1px;\\r\\n\\twhite-space: nowrap;\\r\\n\\t-moz-box-sizing: border-box;\\r\\n\\t box-sizing: border-box;\\r\\n\\tbackground: rgba(255, 255, 255, 0.8);\\r\\n\\ttext-shadow: 1px 1px #fff;\\r\\n\\t}\\r\\n.leaflet-control-scale-line:not(:first-child) {\\r\\n\\tborder-top: 2px solid #777;\\r\\n\\tborder-bottom: none;\\r\\n\\tmargin-top: -2px;\\r\\n\\t}\\r\\n.leaflet-control-scale-line:not(:first-child):not(:last-child) {\\r\\n\\tborder-bottom: 2px solid #777;\\r\\n\\t}\\r\\n.leaflet-touch .leaflet-control-attribution,\\r\\n.leaflet-touch .leaflet-control-layers,\\r\\n.leaflet-touch .leaflet-bar {\\r\\n\\tbox-shadow: none;\\r\\n\\t}\\r\\n.leaflet-touch .leaflet-control-layers,\\r\\n.leaflet-touch .leaflet-bar {\\r\\n\\tborder: 2px solid rgba(0,0,0,0.2);\\r\\n\\tbackground-clip: padding-box;\\r\\n\\t}\\r\\n.leaflet-popup {\\r\\n\\tposition: absolute;\\r\\n\\ttext-align: center;\\r\\n\\tmargin-bottom: 20px;\\r\\n\\t}\\r\\n.leaflet-popup-content-wrapper {\\r\\n\\tpadding: 1px;\\r\\n\\ttext-align: left;\\r\\n\\tborder-radius: 12px;\\r\\n\\t}\\r\\n.leaflet-popup-content {\\r\\n\\tmargin: 13px 24px 13px 20px;\\r\\n\\tline-height: 1.3;\\r\\n\\tfont-size: 13px;\\r\\n\\tfont-size: 1.08333em;\\r\\n\\tmin-height: 1px;\\r\\n\\t}\\r\\n.leaflet-popup-content p {\\r\\n\\tmargin: 17px 0;\\r\\n\\tmargin: 1.3em 0;\\r\\n\\t}\\r\\n.leaflet-popup-tip-container {\\r\\n\\twidth: 40px;\\r\\n\\theight: 20px;\\r\\n\\tposition: absolute;\\r\\n\\tleft: 50%;\\r\\n\\tmargin-top: -1px;\\r\\n\\tmargin-left: -20px;\\r\\n\\toverflow: hidden;\\r\\n\\tpointer-events: none;\\r\\n\\t}\\r\\n.leaflet-popup-tip {\\r\\n\\twidth: 17px;\\r\\n\\theight: 17px;\\r\\n\\tpadding: 1px;\\r\\n\\tmargin: -10px auto 0;\\r\\n\\tpointer-events: auto;\\r\\n\\t-webkit-transform: rotate(45deg);\\r\\n\\t -moz-transform: rotate(45deg);\\r\\n\\t -ms-transform: rotate(45deg);\\r\\n\\t transform: rotate(45deg);\\r\\n\\t}\\r\\n.leaflet-popup-content-wrapper,\\r\\n.leaflet-popup-tip {\\r\\n\\tbackground: white;\\r\\n\\tcolor: #333;\\r\\n\\tbox-shadow: 0 3px 14px rgba(0,0,0,0.4);\\r\\n\\t}\\r\\n.leaflet-container a.leaflet-popup-close-button {\\r\\n\\tposition: absolute;\\r\\n\\ttop: 0;\\r\\n\\tright: 0;\\r\\n\\tborder: none;\\r\\n\\ttext-align: center;\\r\\n\\twidth: 24px;\\r\\n\\theight: 24px;\\r\\n\\tfont: 16px/24px Tahoma, Verdana, sans-serif;\\r\\n\\tcolor: #757575;\\r\\n\\ttext-decoration: none;\\r\\n\\tbackground: transparent;\\r\\n\\t}\\r\\n.leaflet-container a.leaflet-popup-close-button:hover,\\r\\n.leaflet-container a.leaflet-popup-close-button:focus {\\r\\n\\tcolor: #585858;\\r\\n\\t}\\r\\n.leaflet-popup-scrolled {\\r\\n\\toverflow: auto;\\r\\n\\t}\\r\\n.leaflet-oldie .leaflet-popup-content-wrapper {\\r\\n\\t-ms-zoom: 1;\\r\\n\\t}\\r\\n.leaflet-oldie .leaflet-popup-tip {\\r\\n\\twidth: 24px;\\r\\n\\tmargin: 0 auto;\\r\\n\\t-ms-filter: \"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";\\r\\n\\tfilter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);\\r\\n\\t}\\r\\n.leaflet-oldie .leaflet-control-zoom,\\r\\n.leaflet-oldie .leaflet-control-layers,\\r\\n.leaflet-oldie .leaflet-popup-content-wrapper,\\r\\n.leaflet-oldie .leaflet-popup-tip {\\r\\n\\tborder: 1px solid #999;\\r\\n\\t}\\r\\n.leaflet-div-icon {\\r\\n\\tbackground: #fff;\\r\\n\\tborder: 1px solid #666;\\r\\n\\t}\\r\\n.leaflet-tooltip {\\r\\n\\tposition: absolute;\\r\\n\\tpadding: 6px;\\r\\n\\tbackground-color: #fff;\\r\\n\\tborder: 1px solid #fff;\\r\\n\\tborder-radius: 3px;\\r\\n\\tcolor: #222;\\r\\n\\twhite-space: nowrap;\\r\\n\\t-webkit-user-select: none;\\r\\n\\t-moz-user-select: none;\\r\\n\\t-ms-user-select: none;\\r\\n\\tuser-select: none;\\r\\n\\tpointer-events: none;\\r\\n\\tbox-shadow: 0 1px 3px rgba(0,0,0,0.4);\\r\\n\\t}\\r\\n.leaflet-tooltip.leaflet-interactive {\\r\\n\\tcursor: pointer;\\r\\n\\tpointer-events: auto;\\r\\n\\t}\\r\\n.leaflet-tooltip-top:before,\\r\\n.leaflet-tooltip-bottom:before,\\r\\n.leaflet-tooltip-left:before,\\r\\n.leaflet-tooltip-right:before {\\r\\n\\tposition: absolute;\\r\\n\\tpointer-events: none;\\r\\n\\tborder: 6px solid transparent;\\r\\n\\tbackground: transparent;\\r\\n\\tcontent: \"\";\\r\\n\\t}\\r\\n.leaflet-tooltip-bottom {\\r\\n\\tmargin-top: 6px;\\r\\n}\\r\\n.leaflet-tooltip-top {\\r\\n\\tmargin-top: -6px;\\r\\n}\\r\\n.leaflet-tooltip-bottom:before,\\r\\n.leaflet-tooltip-top:before {\\r\\n\\tleft: 50%;\\r\\n\\tmargin-left: -6px;\\r\\n\\t}\\r\\n.leaflet-tooltip-top:before {\\r\\n\\tbottom: 0;\\r\\n\\tmargin-bottom: -12px;\\r\\n\\tborder-top-color: #fff;\\r\\n\\t}\\r\\n.leaflet-tooltip-bottom:before {\\r\\n\\ttop: 0;\\r\\n\\tmargin-top: -12px;\\r\\n\\tmargin-left: -6px;\\r\\n\\tborder-bottom-color: #fff;\\r\\n\\t}\\r\\n.leaflet-tooltip-left {\\r\\n\\tmargin-left: -6px;\\r\\n}\\r\\n.leaflet-tooltip-right {\\r\\n\\tmargin-left: 6px;\\r\\n}\\r\\n.leaflet-tooltip-left:before,\\r\\n.leaflet-tooltip-right:before {\\r\\n\\ttop: 50%;\\r\\n\\tmargin-top: -6px;\\r\\n\\t}\\r\\n.leaflet-tooltip-left:before {\\r\\n\\tright: 0;\\r\\n\\tmargin-right: -12px;\\r\\n\\tborder-left-color: #fff;\\r\\n\\t}\\r\\n.leaflet-tooltip-right:before {\\r\\n\\tleft: 0;\\r\\n\\tmargin-left: -12px;\\r\\n\\tborder-right-color: #fff;\\r\\n\\t}\\r\\n@media print {\\r\\n\\t.leaflet-control {\\r\\n\\t\\t-webkit-print-color-adjust: exact;\\r\\n\\t\\tprint-color-adjust: exact;\\r\\n\\t\\t}\\r\\n\\t}';\n"],"mappings":";AAGA,IAAa,cACT"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { GeocodingSource } from './types';
|
|
2
|
+
export interface NominatimSourceOptions {
|
|
3
|
+
/** The Nominatim server. Defaults to OpenStreetMap's, whose policy allows one request a second. */
|
|
4
|
+
endpoint?: string;
|
|
5
|
+
/** An email, which OpenStreetMap's server asks of apps that send many requests. */
|
|
6
|
+
email?: string;
|
|
7
|
+
/** Limits the search to these countries (`['ca']`). */
|
|
8
|
+
countryCodes?: readonly string[];
|
|
9
|
+
/** Most results of a search. Defaults to 5. */
|
|
10
|
+
limit?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* An address search on Nominatim, OpenStreetMap's geocoder. Fine for an admin panel: its public
|
|
14
|
+
* server allows one request a second and no heavy use. For more, run a server or use a service.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createNominatimSource({ endpoint, email, countryCodes, limit, }?: NominatimSourceOptions): GeocodingSource;
|
|
17
|
+
//# sourceMappingURL=nominatim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nominatim.d.ts","sourceRoot":"","sources":["../../src/location/nominatim.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,eAAe,EAAE,MAAM,SAAS,CAAC;AAEhE,MAAM,WAAW,sBAAsB;IACnC,mGAAmG;IACnG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAiBD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EAClC,QAAgD,EAChD,KAAK,EACL,YAAY,EACZ,KAAS,GACZ,GAAE,sBAA2B,GAAG,eAAe,CAgD/C"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//#region src/location/nominatim.ts
|
|
2
|
+
function toResult(place) {
|
|
3
|
+
const lat = Number(place.lat);
|
|
4
|
+
const lng = Number(place.lon);
|
|
5
|
+
if (typeof place.display_name !== "string" || Number.isNaN(lat) || Number.isNaN(lng)) return null;
|
|
6
|
+
return {
|
|
7
|
+
label: place.display_name,
|
|
8
|
+
lat,
|
|
9
|
+
lng
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* An address search on Nominatim, OpenStreetMap's geocoder. Fine for an admin panel: its public
|
|
14
|
+
* server allows one request a second and no heavy use. For more, run a server or use a service.
|
|
15
|
+
*/
|
|
16
|
+
function createNominatimSource({ endpoint = "https://nominatim.openstreetmap.org", email, countryCodes, limit = 5 } = {}) {
|
|
17
|
+
const base = endpoint.replace(/\/$/, "");
|
|
18
|
+
const request = async (path, params, { signal, locale }) => {
|
|
19
|
+
const query = new URLSearchParams({
|
|
20
|
+
format: "jsonv2",
|
|
21
|
+
...params
|
|
22
|
+
});
|
|
23
|
+
if (email !== void 0) query.set("email", email);
|
|
24
|
+
if (locale !== void 0) query.set("accept-language", locale);
|
|
25
|
+
const response = await fetch(`${base}${path}?${query}`, { signal });
|
|
26
|
+
if (!response.ok) throw new Error(`Nominatim answered ${response.status}.`);
|
|
27
|
+
return response.json();
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
async search(text, options) {
|
|
31
|
+
const places = await request("/search", {
|
|
32
|
+
q: text,
|
|
33
|
+
limit: String(limit),
|
|
34
|
+
...countryCodes !== void 0 && countryCodes.length > 0 ? { countrycodes: countryCodes.join(",") } : {}
|
|
35
|
+
}, options);
|
|
36
|
+
return Array.isArray(places) ? places.flatMap((place) => toResult(place) ?? []) : [];
|
|
37
|
+
},
|
|
38
|
+
async reverse({ lat, lng }, options) {
|
|
39
|
+
const place = await request("/reverse", {
|
|
40
|
+
lat: String(lat),
|
|
41
|
+
lon: String(lng)
|
|
42
|
+
}, options);
|
|
43
|
+
return place !== null && typeof place === "object" ? toResult(place) : null;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { createNominatimSource };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=nominatim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nominatim.js","names":[],"sources":["../../src/location/nominatim.ts"],"sourcesContent":["import type { GeocodingResult, GeocodingSource } from './types';\n\nexport interface NominatimSourceOptions {\n /** The Nominatim server. Defaults to OpenStreetMap's, whose policy allows one request a second. */\n endpoint?: string;\n /** An email, which OpenStreetMap's server asks of apps that send many requests. */\n email?: string;\n /** Limits the search to these countries (`['ca']`). */\n countryCodes?: readonly string[];\n /** Most results of a search. Defaults to 5. */\n limit?: number;\n}\n\ninterface NominatimPlace {\n display_name?: unknown;\n lat?: unknown;\n lon?: unknown;\n}\n\nfunction toResult(place: NominatimPlace): GeocodingResult | null {\n const lat = Number(place.lat);\n const lng = Number(place.lon);\n if (typeof place.display_name !== 'string' || Number.isNaN(lat) || Number.isNaN(lng)) {\n return null;\n }\n return { label: place.display_name, lat, lng };\n}\n\n/**\n * An address search on Nominatim, OpenStreetMap's geocoder. Fine for an admin panel: its public\n * server allows one request a second and no heavy use. For more, run a server or use a service.\n */\nexport function createNominatimSource({\n endpoint = 'https://nominatim.openstreetmap.org',\n email,\n countryCodes,\n limit = 5,\n}: NominatimSourceOptions = {}): GeocodingSource {\n const base = endpoint.replace(/\\/$/, '');\n const request = async (\n path: string,\n params: Record<string, string>,\n { signal, locale }: { signal: AbortSignal; locale?: string },\n ): Promise<unknown> => {\n const query = new URLSearchParams({ format: 'jsonv2', ...params });\n if (email !== undefined) {\n query.set('email', email);\n }\n if (locale !== undefined) {\n query.set('accept-language', locale);\n }\n const response = await fetch(`${base}${path}?${query}`, { signal });\n if (!response.ok) {\n throw new Error(`Nominatim answered ${response.status}.`);\n }\n return response.json();\n };\n return {\n async search(text, options) {\n const places = await request(\n '/search',\n {\n q: text,\n limit: String(limit),\n ...(countryCodes !== undefined && countryCodes.length > 0\n ? { countrycodes: countryCodes.join(',') }\n : {}),\n },\n options,\n );\n return Array.isArray(places)\n ? places.flatMap((place: NominatimPlace) => toResult(place) ?? [])\n : [];\n },\n async reverse({ lat, lng }, options) {\n const place = await request(\n '/reverse',\n { lat: String(lat), lon: String(lng) },\n options,\n );\n return place !== null && typeof place === 'object'\n ? toResult(place as NominatimPlace)\n : null;\n },\n };\n}\n"],"mappings":";AAmBA,SAAS,SAAS,OAA+C;CAC7D,MAAM,MAAM,OAAO,MAAM,GAAG;CAC5B,MAAM,MAAM,OAAO,MAAM,GAAG;CAC5B,IAAI,OAAO,MAAM,iBAAiB,YAAY,OAAO,MAAM,GAAG,KAAK,OAAO,MAAM,GAAG,GAC/E,OAAO;CAEX,OAAO;EAAE,OAAO,MAAM;EAAc;EAAK;CAAI;AACjD;;;;;AAMA,SAAgB,sBAAsB,EAClC,WAAW,uCACX,OACA,cACA,QAAQ,MACgB,CAAC,GAAoB;CAC7C,MAAM,OAAO,SAAS,QAAQ,OAAO,EAAE;CACvC,MAAM,UAAU,OACZ,MACA,QACA,EAAE,QAAQ,aACS;EACnB,MAAM,QAAQ,IAAI,gBAAgB;GAAE,QAAQ;GAAU,GAAG;EAAO,CAAC;EACjE,IAAI,UAAU,KAAA,GACV,MAAM,IAAI,SAAS,KAAK;EAE5B,IAAI,WAAW,KAAA,GACX,MAAM,IAAI,mBAAmB,MAAM;EAEvC,MAAM,WAAW,MAAM,MAAM,GAAG,OAAO,KAAI,GAAI,SAAS,EAAE,OAAO,CAAC;EAClE,IAAI,CAAC,SAAS,IACV,MAAM,IAAI,MAAM,sBAAsB,SAAS,OAAM,EAAG;EAE5D,OAAO,SAAS,KAAK;CACzB;CACA,OAAO;EACH,MAAM,OAAO,MAAM,SAAS;GACxB,MAAM,SAAS,MAAM,QACjB,WACA;IACI,GAAG;IACH,OAAO,OAAO,KAAK;IACnB,GAAI,iBAAiB,KAAA,KAAa,aAAa,SAAS,IAClD,EAAE,cAAc,aAAa,KAAK,GAAG,EAAE,IACvC,CAAC;GACX,GACA,OACJ;GACA,OAAO,MAAM,QAAQ,MAAM,IACrB,OAAO,SAAS,UAA0B,SAAS,KAAK,KAAK,CAAA,CAAE,IAC/D,CAAA;EACV;EACA,MAAM,QAAQ,EAAE,KAAK,OAAO,SAAS;GACjC,MAAM,QAAQ,MAAM,QAChB,YACA;IAAE,KAAK,OAAO,GAAG;IAAG,KAAK,OAAO,GAAG;GAAE,GACrC,OACJ;GACA,OAAO,UAAU,QAAQ,OAAO,UAAU,WACpC,SAAS,KAAuB,IAChC;EACV;CACJ;AACJ"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** A place an address search found: what it shows, and its point. */
|
|
2
|
+
export interface GeocodingResult {
|
|
3
|
+
label: string;
|
|
4
|
+
lat: number;
|
|
5
|
+
lng: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Where `location` fields search addresses (decision 0033). Projects bring their own: a service
|
|
9
|
+
* with a key, their backend, or `createNominatimSource()` for small volumes.
|
|
10
|
+
*/
|
|
11
|
+
export interface GeocodingSource {
|
|
12
|
+
/** The places that match an address or a name, best first. */
|
|
13
|
+
search(query: string, options: {
|
|
14
|
+
signal: AbortSignal;
|
|
15
|
+
locale?: string;
|
|
16
|
+
}): Promise<GeocodingResult[]>;
|
|
17
|
+
/** The address of a point, to fill it in when the point is placed on the map. Optional. */
|
|
18
|
+
reverse?(point: {
|
|
19
|
+
lat: number;
|
|
20
|
+
lng: number;
|
|
21
|
+
}, options: {
|
|
22
|
+
signal: AbortSignal;
|
|
23
|
+
locale?: string;
|
|
24
|
+
}): Promise<GeocodingResult | null>;
|
|
25
|
+
}
|
|
26
|
+
/** Raster tiles of the maps of `location` fields. */
|
|
27
|
+
export interface MapTiles {
|
|
28
|
+
/** URL template of the tiles: `https://tile.openstreetmap.org/{z}/{x}/{y}.png`. */
|
|
29
|
+
url: string;
|
|
30
|
+
/** The credit the tiles ask for, as HTML. */
|
|
31
|
+
attribution: string;
|
|
32
|
+
/** Highest zoom of the tiles. Defaults to 19. */
|
|
33
|
+
maxZoom?: number;
|
|
34
|
+
}
|
|
35
|
+
/** The tiles and the address search of the maps of `location` fields. */
|
|
36
|
+
export interface MapsConfig {
|
|
37
|
+
tiles?: MapTiles;
|
|
38
|
+
geocoding?: GeocodingSource;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/location/types.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,8DAA8D;IAC9D,MAAM,CACF,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAClD,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IAC9B,2FAA2F;IAC3F,OAAO,CAAC,CACJ,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EACnC,OAAO,EAAE;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAClD,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;CACtC;AAED,qDAAqD;AACrD,MAAM,WAAW,QAAQ;IACrB,mFAAmF;IACnF,GAAG,EAAE,MAAM,CAAC;IACZ,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,yEAAyE;AACzE,MAAM,WAAW,UAAU;IACvB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,SAAS,CAAC,EAAE,eAAe,CAAC;CAC/B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
3
|
+
export interface RangeFieldProps extends FieldProps<number> {
|
|
4
|
+
/** The start of the slider. Defaults to 0. */
|
|
5
|
+
min?: number;
|
|
6
|
+
/** The end of the slider. Defaults to 100. */
|
|
7
|
+
max?: number;
|
|
8
|
+
/** Step of the slider and of the arrow keys. Defaults to 1. */
|
|
9
|
+
step?: number;
|
|
10
|
+
/** Format of the number shown, for the locale. */
|
|
11
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
12
|
+
/** Content after the number: a unit. */
|
|
13
|
+
suffix?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/** A number on a slider. It is `null` until the slider is moved. */
|
|
16
|
+
export declare function RangeField({ value, onChange, onBlur, min, max, disabled, readOnly, required, autoFocus: _autoFocus, id: _id, ...props }: RangeFieldProps): import("react").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* The `range` type: its ends from the `min` and `max` rules (0 and 100 without them), and
|
|
19
|
+
* settings `step`, `decimals` and `suffix`, as for `number`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function RangeFieldEntry(props: FieldEntryProps): import("react").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=RangeField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeField.d.ts","sourceRoot":"","sources":["../../src/range/RangeField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEnE,MAAM,WAAW,eAAgB,SAAQ,UAAU,CAAC,MAAM,CAAC;IACvD,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,aAAa,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC;IACzC,wCAAwC;IACxC,MAAM,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,oEAAoE;AACpE,wBAAgB,UAAU,CAAC,EACvB,KAAK,EACL,QAAQ,EACR,MAAM,EACN,GAAO,EACP,GAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EAAE,UAAU,EACrB,EAAE,EAAE,GAAG,EACP,GAAG,KAAK,EACX,EAAE,eAAe,+BAajB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,+BAsBrD"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { getFieldProps, getRuleNumber, getSetting, isNumber, isString } from "../shared/entry.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { Slider } from "@panneau/ui";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/range/RangeField.tsx
|
|
6
|
+
/** A number on a slider. It is `null` until the slider is moved. */
|
|
7
|
+
function RangeField({ value, onChange, onBlur, min = 0, max = 100, disabled, readOnly, required, autoFocus: _autoFocus, id: _id, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Slider, {
|
|
9
|
+
...props,
|
|
10
|
+
value: value ?? null,
|
|
11
|
+
onChange: (next) => onChange?.(next),
|
|
12
|
+
onChangeEnd: () => onBlur?.(),
|
|
13
|
+
minValue: min,
|
|
14
|
+
maxValue: max,
|
|
15
|
+
isDisabled: disabled === true || readOnly === true,
|
|
16
|
+
isRequired: required
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The `range` type: its ends from the `min` and `max` rules (0 and 100 without them), and
|
|
21
|
+
* settings `step`, `decimals` and `suffix`, as for `number`.
|
|
22
|
+
*/
|
|
23
|
+
function RangeFieldEntry(props) {
|
|
24
|
+
const $ = c(33);
|
|
25
|
+
const { field } = props;
|
|
26
|
+
let t0;
|
|
27
|
+
if ($[0] !== field) {
|
|
28
|
+
t0 = getRuleNumber(field, "min");
|
|
29
|
+
$[0] = field;
|
|
30
|
+
$[1] = t0;
|
|
31
|
+
} else t0 = $[1];
|
|
32
|
+
const min = t0;
|
|
33
|
+
let t1;
|
|
34
|
+
if ($[2] !== field) {
|
|
35
|
+
t1 = getRuleNumber(field, "max");
|
|
36
|
+
$[2] = field;
|
|
37
|
+
$[3] = t1;
|
|
38
|
+
} else t1 = $[3];
|
|
39
|
+
const max = t1;
|
|
40
|
+
let t2;
|
|
41
|
+
if ($[4] !== field) {
|
|
42
|
+
t2 = getSetting(field, "step", isNumber);
|
|
43
|
+
$[4] = field;
|
|
44
|
+
$[5] = t2;
|
|
45
|
+
} else t2 = $[5];
|
|
46
|
+
const step = t2;
|
|
47
|
+
let t3;
|
|
48
|
+
if ($[6] !== field) {
|
|
49
|
+
t3 = getSetting(field, "decimals", isNumber);
|
|
50
|
+
$[6] = field;
|
|
51
|
+
$[7] = t3;
|
|
52
|
+
} else t3 = $[7];
|
|
53
|
+
const decimals = t3;
|
|
54
|
+
let t4;
|
|
55
|
+
if ($[8] !== field) {
|
|
56
|
+
t4 = getSetting(field, "suffix", isString);
|
|
57
|
+
$[8] = field;
|
|
58
|
+
$[9] = t4;
|
|
59
|
+
} else t4 = $[9];
|
|
60
|
+
const suffix = t4;
|
|
61
|
+
let t5;
|
|
62
|
+
if ($[10] !== props) {
|
|
63
|
+
t5 = getFieldProps(props);
|
|
64
|
+
$[10] = props;
|
|
65
|
+
$[11] = t5;
|
|
66
|
+
} else t5 = $[11];
|
|
67
|
+
let fieldProps;
|
|
68
|
+
if ($[12] !== t5) {
|
|
69
|
+
const { placeholder: _placeholder, ...t6 } = t5;
|
|
70
|
+
fieldProps = t6;
|
|
71
|
+
$[12] = t5;
|
|
72
|
+
$[13] = fieldProps;
|
|
73
|
+
} else fieldProps = $[13];
|
|
74
|
+
const t6 = isNumber(props.value) ? props.value : null;
|
|
75
|
+
let t7;
|
|
76
|
+
if ($[14] !== min) {
|
|
77
|
+
t7 = min !== void 0 ? { min } : {};
|
|
78
|
+
$[14] = min;
|
|
79
|
+
$[15] = t7;
|
|
80
|
+
} else t7 = $[15];
|
|
81
|
+
let t8;
|
|
82
|
+
if ($[16] !== max) {
|
|
83
|
+
t8 = max !== void 0 ? { max } : {};
|
|
84
|
+
$[16] = max;
|
|
85
|
+
$[17] = t8;
|
|
86
|
+
} else t8 = $[17];
|
|
87
|
+
let t9;
|
|
88
|
+
if ($[18] !== step) {
|
|
89
|
+
t9 = step !== void 0 ? { step } : {};
|
|
90
|
+
$[18] = step;
|
|
91
|
+
$[19] = t9;
|
|
92
|
+
} else t9 = $[19];
|
|
93
|
+
let t10;
|
|
94
|
+
if ($[20] !== decimals) {
|
|
95
|
+
t10 = decimals !== void 0 ? { formatOptions: { maximumFractionDigits: decimals } } : {};
|
|
96
|
+
$[20] = decimals;
|
|
97
|
+
$[21] = t10;
|
|
98
|
+
} else t10 = $[21];
|
|
99
|
+
let t11;
|
|
100
|
+
if ($[22] !== suffix) {
|
|
101
|
+
t11 = suffix !== void 0 ? { suffix } : {};
|
|
102
|
+
$[22] = suffix;
|
|
103
|
+
$[23] = t11;
|
|
104
|
+
} else t11 = $[23];
|
|
105
|
+
let t12;
|
|
106
|
+
if ($[24] !== fieldProps || $[25] !== props.onChange || $[26] !== t10 || $[27] !== t11 || $[28] !== t6 || $[29] !== t7 || $[30] !== t8 || $[31] !== t9) {
|
|
107
|
+
t12 = /* @__PURE__ */ jsx(RangeField, {
|
|
108
|
+
...fieldProps,
|
|
109
|
+
value: t6,
|
|
110
|
+
onChange: props.onChange,
|
|
111
|
+
...t7,
|
|
112
|
+
...t8,
|
|
113
|
+
...t9,
|
|
114
|
+
...t10,
|
|
115
|
+
...t11
|
|
116
|
+
});
|
|
117
|
+
$[24] = fieldProps;
|
|
118
|
+
$[25] = props.onChange;
|
|
119
|
+
$[26] = t10;
|
|
120
|
+
$[27] = t11;
|
|
121
|
+
$[28] = t6;
|
|
122
|
+
$[29] = t7;
|
|
123
|
+
$[30] = t8;
|
|
124
|
+
$[31] = t9;
|
|
125
|
+
$[32] = t12;
|
|
126
|
+
} else t12 = $[32];
|
|
127
|
+
return t12;
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
export { RangeField, RangeFieldEntry };
|
|
131
|
+
|
|
132
|
+
//# sourceMappingURL=RangeField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeField.js","names":["_c"],"sources":["../../src/range/RangeField.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { Slider } from '@panneau/ui';\n\nimport { getFieldProps, getRuleNumber, getSetting, isNumber, isString } from '../shared/entry';\nimport type { FieldEntryProps, FieldProps } from '../shared/types';\n\nexport interface RangeFieldProps extends FieldProps<number> {\n /** The start of the slider. Defaults to 0. */\n min?: number;\n /** The end of the slider. Defaults to 100. */\n max?: number;\n /** Step of the slider and of the arrow keys. Defaults to 1. */\n step?: number;\n /** Format of the number shown, for the locale. */\n formatOptions?: Intl.NumberFormatOptions;\n /** Content after the number: a unit. */\n suffix?: ReactNode;\n}\n\n/** A number on a slider. It is `null` until the slider is moved. */\nexport function RangeField({\n value,\n onChange,\n onBlur,\n min = 0,\n max = 100,\n disabled,\n readOnly,\n required,\n autoFocus: _autoFocus,\n id: _id,\n ...props\n}: RangeFieldProps) {\n return (\n <Slider\n {...props}\n value={value ?? null}\n onChange={(next) => onChange?.(next)}\n onChangeEnd={() => onBlur?.()}\n minValue={min}\n maxValue={max}\n isDisabled={disabled === true || readOnly === true}\n isRequired={required}\n />\n );\n}\n\n/**\n * The `range` type: its ends from the `min` and `max` rules (0 and 100 without them), and\n * settings `step`, `decimals` and `suffix`, as for `number`.\n */\nexport function RangeFieldEntry(props: FieldEntryProps) {\n const { field } = props;\n const min = getRuleNumber(field, 'min');\n const max = getRuleNumber(field, 'max');\n const step = getSetting(field, 'step', isNumber);\n const decimals = getSetting(field, 'decimals', isNumber);\n const suffix = getSetting(field, 'suffix', isString);\n const { placeholder: _placeholder, ...fieldProps } = getFieldProps(props);\n return (\n <RangeField\n {...fieldProps}\n value={isNumber(props.value) ? props.value : null}\n onChange={props.onChange}\n {...(min !== undefined ? { min } : {})}\n {...(max !== undefined ? { max } : {})}\n {...(step !== undefined ? { step } : {})}\n {...(decimals !== undefined\n ? { formatOptions: { maximumFractionDigits: decimals } }\n : {})}\n {...(suffix !== undefined ? { suffix } : {})}\n />\n );\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/range/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RangeField, RangeFieldEntry } from "./RangeField.js";
|
package/dist/shared/builtIn.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { FieldEntry } from './types';
|
|
|
3
3
|
* The entries of the built-in field types. `richtext` and `media` come with their plugins
|
|
4
4
|
* (`@panneau/editor` and `@panneau/media`): without them, `DefinitionField` renders a placeholder.
|
|
5
5
|
* `file` uploads through the upload source of the fields context, or gives the files themselves.
|
|
6
|
+
* `embed` and `location` use its embed source and its maps; `location` loads Leaflet when shown.
|
|
6
7
|
*/
|
|
7
8
|
export declare const builtInFields: Readonly<Record<string, FieldEntry>>;
|
|
8
9
|
/**
|