@sjvair/monitor-map 3.0.1 → 3.0.3
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/dist/lib/LoadScreen.js +15 -15
- package/dist/lib/{src/MapView.js → MainMapView.js} +2 -2
- package/dist/lib/MapLegend.js +13 -0
- package/dist/lib/MonitorDetailPanel.js +169 -0
- package/dist/lib/MonitorMapLayout.js +91 -0
- package/dist/lib/_virtual/_rolldown/runtime.js +11 -0
- package/dist/lib/assets/logos/airgradient-blue.js +4 -0
- package/dist/lib/assets/logos/airnow-compact.js +4 -0
- package/dist/lib/assets/logos/carb-compact.js +4 -0
- package/dist/lib/assets/logos/purpleair-compact.js +4 -0
- package/dist/lib/assets/logos/sjvair.js +4 -0
- package/dist/lib/collocation-sites/CollocationTooltip.js +1 -1
- package/dist/lib/collocation-sites/collocations-map-integration.svelte.js +20 -20
- package/dist/lib/components/DataBox.js +1 -1
- package/dist/lib/components/DisplayOption.js +1 -1
- package/dist/lib/components/MapLayersDisplayOptions.js +47 -31
- package/dist/lib/components/SegmentedControl.js +4 -4
- package/dist/lib/components/ToggleSwitch.js +1 -1
- package/dist/lib/components/ui/button/button.js +4 -4
- package/dist/lib/components/ui/range-calendar/range-calendar-caption.js +57 -54
- package/dist/lib/components/ui/range-calendar/range-calendar-cell.js +19 -18
- package/dist/lib/components/ui/range-calendar/range-calendar-day.js +19 -18
- package/dist/lib/components/ui/range-calendar/range-calendar-grid-body.js +17 -16
- package/dist/lib/components/ui/range-calendar/range-calendar-grid-head.js +17 -16
- package/dist/lib/components/ui/range-calendar/range-calendar-grid-row.js +19 -18
- package/dist/lib/components/ui/range-calendar/range-calendar-grid.js +19 -18
- package/dist/lib/components/ui/range-calendar/range-calendar-head-cell.js +19 -18
- package/dist/lib/components/ui/range-calendar/range-calendar-header.js +19 -18
- package/dist/lib/components/ui/range-calendar/range-calendar-month-select.js +31 -31
- package/dist/lib/components/ui/range-calendar/range-calendar-month.js +19 -19
- package/dist/lib/components/ui/range-calendar/range-calendar-months.js +19 -19
- package/dist/lib/components/ui/range-calendar/range-calendar-nav.js +19 -19
- package/dist/lib/components/ui/range-calendar/range-calendar-next-button.js +27 -26
- package/dist/lib/components/ui/range-calendar/range-calendar-prev-button.js +27 -26
- package/dist/lib/components/ui/range-calendar/range-calendar-year-select.js +29 -29
- package/dist/lib/components/ui/range-calendar/range-calendar.js +154 -154
- package/dist/lib/data-chart/DataChart.js +76 -76
- package/dist/lib/ev-stations/components/EvStationClusterTooltip.js +16 -0
- package/dist/lib/ev-stations/components/EvStationTooltip.js +120 -0
- package/dist/lib/ev-stations/components/EvStationsDisplayOptions.js +41 -0
- package/dist/lib/ev-stations/data-maps.js +4 -0
- package/dist/lib/ev-stations/ev-station-icons.js +32 -0
- package/dist/lib/ev-stations/ev-stations-cluster-renderer.js +118 -0
- package/dist/lib/ev-stations/ev-stations-map-integration.svelte.js +181 -0
- package/dist/lib/ev-stations/ev-stations.svelte.js +33 -0
- package/dist/lib/ev-stations/zip-codes.js +136 -0
- package/dist/lib/hms/components/HMSFireLegend.js +35 -0
- package/dist/lib/hms/hms.svelte.js +12 -12
- package/dist/lib/index.js +19 -17
- package/dist/lib/map/Map.js +1 -1
- package/dist/lib/map/MapStyleDisplayOptions.js +16 -16
- package/dist/lib/map/Menu.js +23 -24
- package/dist/lib/map/integrations/map-display-option.svelte.js +3 -2
- package/dist/lib/map/integrations/map-icon-manager.js +4 -1
- package/dist/lib/map/utils.js +16 -13
- package/dist/lib/monitors/components/MonitorClusterTooltip.js +4 -4
- package/dist/lib/monitors/components/MonitorMarkersLegend.js +35 -0
- package/dist/lib/monitors/components/MonitorSubscriptionManager.js +1 -1
- package/dist/lib/monitors/components/MonitorTooltip.js +1 -1
- package/dist/lib/monitors/components/MonitorWidgetModal.js +1 -1
- package/dist/lib/monitors/components/MonitorsDisplayOptions.js +48 -39
- package/dist/lib/monitors/monitors-icon-manager.svelte.js +24 -17
- package/dist/lib/monitors/monitors-map-integration.svelte.js +65 -59
- package/dist/lib/monitors/monitors.svelte.js +38 -42
- package/dist/lib/router-context.js +13 -0
- package/dist/lib/routes.js +10 -0
- package/dist/lib/search/Search.js +124 -0
- package/dist/lib/search/service.js +90 -0
- package/dist/lib/sjvair-air.webp +0 -0
- package/dist/lib/sjvair-air2.webp +0 -0
- package/dist/lib/sjvair-icon.avif +0 -0
- package/dist/lib/sjvair-icon.png +0 -0
- package/dist/lib/sjvair-icon2.avif +0 -0
- package/dist/lib/sjvair-icon2.png +0 -0
- package/dist/lib/sjvair-sjv.avif +0 -0
- package/dist/lib/sjvair-sjv.webp +0 -0
- package/dist/lib/sjvair-sjv2.avif +0 -0
- package/dist/lib/sjvair-sjv2.webp +0 -0
- package/dist/lib/utils.js +9 -3
- package/package.json +37 -36
- package/src/lib/LoadScreen.svelte +5 -5
- package/src/lib/MainMapView.svelte +1 -0
- package/src/lib/MapLegend.svelte +15 -0
- package/src/lib/MonitorDetailPanel.svelte +152 -0
- package/src/lib/MonitorMapLayout.svelte +193 -0
- package/src/lib/components/MapLayersDisplayOptions.svelte +27 -10
- package/src/lib/ev-stations/components/EvStationsDisplayOptions.svelte +14 -2
- package/src/lib/ev-stations/ev-stations-map-integration.svelte.ts +4 -4
- package/src/lib/hms/components/HMSFireLegend.svelte +21 -0
- package/src/lib/index.ts +34 -0
- package/src/lib/map/Map.svelte +1 -0
- package/src/lib/map/Menu.svelte +4 -7
- package/src/lib/map/integrations/map-display-option.svelte.ts +5 -1
- package/src/lib/map/integrations/map-icon-manager.ts +7 -3
- package/src/lib/monitors/components/MonitorsDisplayOptions.svelte +4 -1
- package/src/lib/monitors/monitors-icon-manager.svelte.ts +3 -1
- package/src/lib/monitors/monitors-map-integration.svelte.ts +9 -9
- package/src/lib/monitors/monitors.svelte.ts +1 -3
- package/src/lib/router-context.ts +48 -0
- package/src/lib/routes.ts +8 -0
- package/src/lib/search/Search.svelte +189 -0
- package/src/lib/search/service.ts +101 -0
- package/src/lib/utils.ts +11 -0
- package/dist/lib/assets/icons/adjustment-horizontal.js +0 -4
- package/dist/lib/node_modules/@internationalized/date/dist/private/CalendarDate.js +0 -122
- package/dist/lib/node_modules/@internationalized/date/dist/private/DateFormatter.js +0 -84
- package/dist/lib/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js +0 -91
- package/dist/lib/node_modules/@internationalized/date/dist/private/conversion.js +0 -104
- package/dist/lib/node_modules/@internationalized/date/dist/private/manipulation.js +0 -159
- package/dist/lib/node_modules/@internationalized/date/dist/private/queries.js +0 -32
- package/dist/lib/node_modules/@internationalized/date/dist/private/string.js +0 -37
- package/dist/lib/node_modules/@internationalized/date/dist/private/utils.js +0 -6
- package/dist/lib/node_modules/clsx/dist/clsx.js +0 -16
- package/dist/lib/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -1723
- package/dist/lib/node_modules/tailwind-variants/dist/chunk-LQJYWU4O.js +0 -70
- package/dist/lib/node_modules/tailwind-variants/dist/chunk-RZF76H2U.js +0 -166
- package/dist/lib/node_modules/tailwind-variants/dist/index.js +0 -19
- package/dist/lib/node_modules/uplot/dist/uPlot.esm.js +0 -2147
- package/dist/lib/src/MonitorDetailPanel.js +0 -169
- package/dist/lib/src/router.js +0 -9
- package/dist/monitor-map/MonitorDetailPanel.css +0 -1
- package/dist/monitor-map/assets/MonitorDetailPanel-DmN3xPui.js +0 -15
- package/dist/monitor-map/assets/validate-routes-CgbRa8fT.js +0 -1
- package/dist/monitor-map/inter-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/monitor-map/inter-cyrillic-wght-normal.woff2 +0 -0
- package/dist/monitor-map/inter-greek-ext-wght-normal.woff2 +0 -0
- package/dist/monitor-map/inter-greek-wght-normal.woff2 +0 -0
- package/dist/monitor-map/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/monitor-map/inter-latin-wght-normal.woff2 +0 -0
- package/dist/monitor-map/inter-vietnamese-wght-normal.woff2 +0 -0
- package/dist/monitor-map/lungs.svg +0 -99
- package/dist/monitor-map/sjvair-air.avif +0 -0
- package/dist/monitor-map/sjvair-air.png +0 -0
- package/dist/monitor-map/sjvair-air.webp +0 -0
- package/dist/monitor-map/sjvair-air2.avif +0 -0
- package/dist/monitor-map/sjvair-air2.png +0 -0
- package/dist/monitor-map/sjvair-air2.webp +0 -0
- package/dist/monitor-map/sjvair-icon.avif +0 -0
- package/dist/monitor-map/sjvair-icon.png +0 -0
- package/dist/monitor-map/sjvair-icon.webp +0 -0
- package/dist/monitor-map/sjvair-icon2.avif +0 -0
- package/dist/monitor-map/sjvair-icon2.png +0 -0
- package/dist/monitor-map/sjvair-icon2.webp +0 -0
- package/dist/monitor-map/sjvair-sjv.avif +0 -0
- package/dist/monitor-map/sjvair-sjv.png +0 -0
- package/dist/monitor-map/sjvair-sjv.webp +0 -0
- package/dist/monitor-map/sjvair-sjv2.avif +0 -0
- package/dist/monitor-map/sjvair-sjv2.png +0 -0
- package/dist/monitor-map/sjvair-sjv2.webp +0 -0
- package/dist/monitor-map/sjvairMonitorMap.css +0 -1
- package/dist/monitor-map/sjvairMonitorMap.js +0 -4042
package/dist/lib/map/utils.js
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { mount as e, unmount as t } from "svelte";
|
|
2
|
+
import { MapStyle as n, Popup as r } from "@maptiler/sdk";
|
|
3
3
|
//#region src/lib/map/utils.ts
|
|
4
4
|
var i = (() => {
|
|
5
|
-
let
|
|
6
|
-
for (let
|
|
7
|
-
let
|
|
8
|
-
(!o || a > o.version) &&
|
|
5
|
+
let e = /* @__PURE__ */ new Map();
|
|
6
|
+
for (let t of Object.values(n)) {
|
|
7
|
+
let n = t.getId(), r = n.match(/^(.+?)_V(\d+)$/i), i = r ? r[1] : n, a = r ? parseInt(r[2], 10) : 0, o = e.get(i);
|
|
8
|
+
(!o || a > o.version) && e.set(i, {
|
|
9
9
|
version: a,
|
|
10
|
-
style:
|
|
10
|
+
style: t
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
-
return Array.from(
|
|
13
|
+
return Array.from(e.values()).map((e) => e.style).sort((e, t) => e.getName().localeCompare(t.getName()));
|
|
14
14
|
})();
|
|
15
15
|
function a(e) {
|
|
16
16
|
return typeof e == "object" && !!e && "type" in e && e.type === "geojson";
|
|
17
17
|
}
|
|
18
|
-
function o(
|
|
19
|
-
let s = document.createElement("div"), c = n
|
|
18
|
+
function o(n, i, a, o = !1) {
|
|
19
|
+
let s = document.createElement("div"), c = e(n, {
|
|
20
20
|
target: s,
|
|
21
21
|
props: i
|
|
22
|
-
}), l = new
|
|
22
|
+
}), l = new r({
|
|
23
23
|
closeButton: o,
|
|
24
24
|
closeOnClick: !1,
|
|
25
25
|
maxWidth: "none"
|
|
26
26
|
}).setLngLat(a).setDOMContent(s);
|
|
27
|
-
return l.on("close", () =>
|
|
27
|
+
return l.on("close", () => t(c)), l;
|
|
28
|
+
}
|
|
29
|
+
function s(e, t, n) {
|
|
30
|
+
return o(e, t, n, !0);
|
|
28
31
|
}
|
|
29
32
|
//#endregion
|
|
30
|
-
export { i as MAP_STYLE_OPTIONS, a as isGeoJSONSource, o as mountPopup };
|
|
33
|
+
export { i as MAP_STYLE_OPTIONS, a as isGeoJSONSource, s as mountClickPopup, o as mountPopup };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { mapManager as e } from "../../map/map.svelte.js";
|
|
2
|
+
import { monitorsManager as t } from "../monitors.svelte.js";
|
|
3
3
|
import { getCurrentLevel as n } from "../monitor-utils.js";
|
|
4
4
|
import r from "../../components/DataBox.js";
|
|
5
|
-
import * as i from "svelte/internal/client";
|
|
6
5
|
import "svelte/internal/disclose-version";
|
|
6
|
+
import * as i from "svelte/internal/client";
|
|
7
7
|
import "@maptiler/sdk";
|
|
8
8
|
import { area as a } from "@turf/area";
|
|
9
9
|
import { convertArea as o } from "@turf/helpers";
|
|
@@ -13,7 +13,7 @@ function l(l, u) {
|
|
|
13
13
|
i.push(u, !0);
|
|
14
14
|
let d = i.state(void 0);
|
|
15
15
|
i.user_effect(() => {
|
|
16
|
-
let r =
|
|
16
|
+
let r = e.map.getSource(u.feature.source), s = t.latest, c = t.meta;
|
|
17
17
|
r.getClusterLeaves(u.feature.properties.cluster_id, u.feature.properties.point_count, 0).then((e) => {
|
|
18
18
|
if (!e.length || !c || !s) return;
|
|
19
19
|
let t = e.map((e) => s?.get(e.properties.id)), r = t[0];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { monitorsManager as e } from "../monitors.svelte.js";
|
|
2
|
+
import "svelte/internal/disclose-version";
|
|
3
|
+
import * as t from "svelte/internal/client";
|
|
4
|
+
//#region src/lib/monitors/components/MonitorMarkersLegend.svelte
|
|
5
|
+
var n = t.from_html("<div class=\"w-1/5 shrink-0 h-[0.5em] border-l border-black last:relative last:right-px\"><span> </span></div>"), r = t.from_html("<div class=\"min-w-50 flex flex-col bg-white rounded shadow py-[0.5em] px-[1.5em]\"><p class=\"text-center whitespace-nowrap font-semibold\"> </p> <div class=\"map-legend-bar inline-block h-[1.5em] svelte-6hvosy\"> </div> <div class=\"flex mb-[1.5em]\"><div class=\"w-1/5 shrink-0 h-[0.5em] border-l border-black\"><span class=\"relative top-[0.5em] right-[0.3em]\">0</span></div> <!></div></div>"), i = {
|
|
6
|
+
hash: "svelte-6hvosy",
|
|
7
|
+
code: ".map-legend-bar.svelte-6hvosy {background:linear-gradient(\n 90deg,\n #00e400 0%,\n #ffff00 20%,\n #ff7e00 40%,\n #ff0000 60%,\n #8f3f97 80%,\n #7e0023 100%\n );}"
|
|
8
|
+
};
|
|
9
|
+
function a(a, o) {
|
|
10
|
+
t.push(o, !0), t.append_styles(a, i);
|
|
11
|
+
let s = t.derived(() => e.pollutant === "pm25" ? "PM 2.5" : "Ozone"), c = t.derived(() => e.pollutant === "pm25" ? [
|
|
12
|
+
12,
|
|
13
|
+
35,
|
|
14
|
+
55,
|
|
15
|
+
150,
|
|
16
|
+
250
|
|
17
|
+
] : [
|
|
18
|
+
55,
|
|
19
|
+
71,
|
|
20
|
+
86,
|
|
21
|
+
106,
|
|
22
|
+
201
|
|
23
|
+
]);
|
|
24
|
+
var l = r(), u = t.child(l), d = t.child(u);
|
|
25
|
+
t.reset(u);
|
|
26
|
+
var f = t.sibling(u, 4), p = t.sibling(t.child(f), 2);
|
|
27
|
+
t.each(p, 17, () => t.get(c), t.index, (e, r, i) => {
|
|
28
|
+
var a = n(), o = t.child(a);
|
|
29
|
+
t.set_class(o, 1, `relative top-[0.5em] ${i >= 3 ? "right-[0.8em]" : "right-[0.5em]"}`);
|
|
30
|
+
var s = t.child(o, !0);
|
|
31
|
+
t.reset(o), t.reset(a), t.template_effect(() => t.set_text(s, t.get(r))), t.append(e, a);
|
|
32
|
+
}), t.reset(f), t.reset(l), t.template_effect(() => t.set_text(d, `${t.get(s) ?? ""} Concentration`)), t.append(a, l), t.pop();
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { a as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { monitorsManager as e } from "../monitors.svelte.js";
|
|
2
|
-
import * as t from "svelte/internal/client";
|
|
3
2
|
import "svelte/internal/disclose-version";
|
|
3
|
+
import * as t from "svelte/internal/client";
|
|
4
4
|
import { BellCheckIcon as n, BellOffIcon as r, ChevronDownIcon as i } from "@lucide/svelte";
|
|
5
5
|
import { getSubscriptions as a, subscribe as o, unsubscribe as s } from "@sjvair/sdk/account";
|
|
6
6
|
//#region src/lib/monitors/components/MonitorSubscriptionManager.svelte
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { monitorsManager as e } from "../monitors.svelte.js";
|
|
2
2
|
import { getCurrentLevel as t } from "../monitor-utils.js";
|
|
3
3
|
import n from "../../components/DataBox.js";
|
|
4
|
-
import * as r from "svelte/internal/client";
|
|
5
4
|
import "svelte/internal/disclose-version";
|
|
5
|
+
import * as r from "svelte/internal/client";
|
|
6
6
|
import { format as i, formatDistanceToNow as a } from "date-fns";
|
|
7
7
|
//#region src/lib/monitors/components/MonitorTooltip.svelte
|
|
8
8
|
var o = r.from_html("<div class=\"flex gap-2\"><!> <div class=\"flex flex-col\"><p> </p> <h1 class=\"text-lg font-bold underline\"> </h1> <div class=\"mt-auto\"><p class=\"text-base leading-none\">Last updated</p> <p class=\"text-base leading-none\"> </p></div></div></div>");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { portal as e } from "../../actions.js";
|
|
2
|
-
import * as t from "svelte/internal/client";
|
|
3
2
|
import "svelte/internal/disclose-version";
|
|
3
|
+
import * as t from "svelte/internal/client";
|
|
4
4
|
import { SquareX as n } from "@lucide/svelte";
|
|
5
5
|
import { origin as r } from "@sjvair/sdk/http";
|
|
6
6
|
//#region src/lib/monitors/components/MonitorWidgetModal.svelte
|
|
@@ -1,67 +1,76 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import n from "../../components/
|
|
4
|
-
import r from "
|
|
5
|
-
import i from "
|
|
6
|
-
import * as a from "svelte/internal/client";
|
|
1
|
+
import e from "../../components/DisplayOption.js";
|
|
2
|
+
import t from "../../components/SegmentedControl.js";
|
|
3
|
+
import n from "../../components/ToggleSwitch.js";
|
|
4
|
+
import { monitorsManager as r } from "../monitors.svelte.js";
|
|
5
|
+
import { monitorsMapIntegration as i } from "../monitors-map-integration.svelte.js";
|
|
7
6
|
import "svelte/internal/disclose-version";
|
|
7
|
+
import * as a from "svelte/internal/client";
|
|
8
8
|
//#region src/lib/monitors/components/MonitorsDisplayOptions.svelte
|
|
9
|
-
var o = a.from_html("<label class=\"cursor-pointer whitespace-nowrap select-none\"><input type=\"checkbox\"/> </label>"),
|
|
10
|
-
function
|
|
11
|
-
a.push(
|
|
12
|
-
let
|
|
9
|
+
var o = a.from_html("<img class=\"w-3\"/>"), s = a.from_html("<label class=\"flex gap-1 cursor-pointer whitespace-nowrap select-none\"><input type=\"checkbox\"/> <!> </label>"), c = a.from_html("<p class=\"text-lg font-bold underline\">Air Monitors</p> <div class=\"mb-2 w-full text-xs\"><div class=\"w-fit\"><!></div> <!></div> <!>", 1);
|
|
10
|
+
function l(l, u) {
|
|
11
|
+
a.push(u, !0);
|
|
12
|
+
let d = [{
|
|
13
13
|
label: "PM 2.5",
|
|
14
14
|
value: "pm25"
|
|
15
15
|
}, {
|
|
16
16
|
label: "Ozone",
|
|
17
17
|
value: "o3"
|
|
18
|
-
}],
|
|
18
|
+
}], f = a.derived(() => r.pollutant && r.pollutant === "pm25" ? Object.entries(i.displayOptions) : Object.entries(i.displayOptions).filter(([e, t]) => e === "inactive" || r.meta?.asIter.monitors.some((e) => e.label === t.label && r.pollutant && r.pollutant in e.entries)));
|
|
19
19
|
a.user_effect(() => {
|
|
20
|
-
|
|
21
|
-
}),
|
|
22
|
-
children: (
|
|
23
|
-
var
|
|
24
|
-
|
|
20
|
+
r.list = [], r.latest = null, r.update();
|
|
21
|
+
}), e(l, {
|
|
22
|
+
children: (e, l) => {
|
|
23
|
+
var u = c(), p = a.sibling(a.first_child(u), 2), m = a.child(p);
|
|
24
|
+
n(a.child(m), {
|
|
25
25
|
id: "monitor-clusters",
|
|
26
26
|
label: "Marker Clusters",
|
|
27
27
|
get value() {
|
|
28
|
-
return
|
|
28
|
+
return i.clustered;
|
|
29
29
|
},
|
|
30
30
|
set value(e) {
|
|
31
|
-
|
|
31
|
+
i.clustered = e;
|
|
32
32
|
}
|
|
33
|
-
}), a.reset(
|
|
34
|
-
var
|
|
35
|
-
|
|
33
|
+
}), a.reset(m);
|
|
34
|
+
var h = a.sibling(m, 2), g = (e) => {
|
|
35
|
+
t(e, {
|
|
36
36
|
segmentLabel: "Pollutant:",
|
|
37
37
|
get options() {
|
|
38
|
-
return
|
|
38
|
+
return d;
|
|
39
39
|
},
|
|
40
40
|
get group() {
|
|
41
|
-
return
|
|
41
|
+
return r.pollutant;
|
|
42
42
|
},
|
|
43
|
-
set group(
|
|
44
|
-
|
|
43
|
+
set group(e) {
|
|
44
|
+
r.pollutant = e;
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
|
-
a.if(
|
|
49
|
-
|
|
50
|
-
}), a.reset(
|
|
51
|
-
var
|
|
52
|
-
a.each(
|
|
48
|
+
a.if(h, (e) => {
|
|
49
|
+
r.pollutant && e(g);
|
|
50
|
+
}), a.reset(p);
|
|
51
|
+
var _ = a.sibling(p, 2);
|
|
52
|
+
a.each(_, 17, () => a.get(f), ([e, t]) => t.label, (e, t) => {
|
|
53
53
|
var n = a.derived(() => a.to_array(a.get(t), 2));
|
|
54
|
-
let r = () => a.get(n)[0], i = () => a.get(n)[1],
|
|
55
|
-
var
|
|
56
|
-
a.remove_input_defaults(
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
a.
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
let r = () => a.get(n)[0], i = () => a.get(n)[1], c = a.derived(() => `${r()}-monitor-display-option`);
|
|
55
|
+
var l = s(), u = a.child(l);
|
|
56
|
+
a.remove_input_defaults(u);
|
|
57
|
+
var d = a.sibling(u, 2), f = (e) => {
|
|
58
|
+
var t = o();
|
|
59
|
+
a.template_effect(() => {
|
|
60
|
+
a.set_attribute(t, "src", i().icon.image.src), a.set_attribute(t, "alt", i().icon.image.alt);
|
|
61
|
+
}), a.append(e, t);
|
|
62
|
+
};
|
|
63
|
+
a.if(d, (e) => {
|
|
64
|
+
i().icon && e(f);
|
|
65
|
+
});
|
|
66
|
+
var p = a.sibling(d);
|
|
67
|
+
a.reset(l), a.template_effect(() => {
|
|
68
|
+
a.set_attribute(l, "for", a.get(c)), a.set_attribute(u, "id", a.get(c)), a.set_attribute(u, "name", i().label), a.set_text(p, ` ${i().label ?? ""}`);
|
|
69
|
+
}), a.bind_checked(u, () => i().value, (e) => i().value = e), a.append(e, l);
|
|
70
|
+
}), a.append(e, u);
|
|
62
71
|
},
|
|
63
72
|
$$slots: { default: !0 }
|
|
64
73
|
}), a.pop();
|
|
65
74
|
}
|
|
66
75
|
//#endregion
|
|
67
|
-
export {
|
|
76
|
+
export { l as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { mapManager as e } from "../map/map.svelte.js";
|
|
2
|
+
import { monitorsManager as t } from "./monitors.svelte.js";
|
|
3
3
|
import { asDataURI as n, circle as r, square as i, triangle as a } from "../map/icons.js";
|
|
4
4
|
import { MapIconManager as o } from "../map/integrations/map-icon-manager.js";
|
|
5
5
|
import * as s from "svelte/internal/client";
|
|
@@ -8,8 +8,8 @@ var c = {
|
|
|
8
8
|
circle: r,
|
|
9
9
|
square: i,
|
|
10
10
|
triangle: a
|
|
11
|
-
}, l = 2, u = "#969696";
|
|
12
|
-
function
|
|
11
|
+
}, l = 2, u = "#969696", d = "#48c78e";
|
|
12
|
+
function f(e, t) {
|
|
13
13
|
let n = `${e.location}-${e.is_active ? t.name : "default"}`;
|
|
14
14
|
switch (e.type) {
|
|
15
15
|
case "airgradient": return `${n}-circle`;
|
|
@@ -20,28 +20,35 @@ function d(e, t) {
|
|
|
20
20
|
default: throw Error(`Map icon for ${e.device} has not been set`);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
var
|
|
23
|
+
var p = class extends o {
|
|
24
24
|
get iconSize() {
|
|
25
25
|
return 24;
|
|
26
26
|
}
|
|
27
27
|
constructor() {
|
|
28
28
|
super(), s.effect_root(() => {
|
|
29
29
|
s.user_effect(() => {
|
|
30
|
-
if (
|
|
31
|
-
let r = [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
if (t.levels) {
|
|
31
|
+
let r = [
|
|
32
|
+
...t.levels,
|
|
33
|
+
{
|
|
34
|
+
name: "default",
|
|
35
|
+
color: u
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "display",
|
|
39
|
+
color: d
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
for (let t of ["inside", "outside"]) for (let [i, a] of Object.entries(c)) for (let o of r) {
|
|
36
43
|
let r = [
|
|
37
44
|
this.idPrefix,
|
|
38
|
-
|
|
45
|
+
t,
|
|
39
46
|
o.name,
|
|
40
47
|
i
|
|
41
|
-
].filter(Boolean).join("-"), s = n(this.transformSvg(a(o.color, l,
|
|
48
|
+
].filter(Boolean).join("-"), s = n(this.transformSvg(a(o.color, l, t === "inside" ? "#000000" : void 0)));
|
|
42
49
|
if (this.icons.has(r)) {
|
|
43
|
-
let
|
|
44
|
-
|
|
50
|
+
let t = this.icons.get(r);
|
|
51
|
+
t.image.src !== s && (t.image.src = s, e.map?.hasImage(r) && this.updateImage(t, e.map));
|
|
45
52
|
continue;
|
|
46
53
|
} else {
|
|
47
54
|
let e = new Image();
|
|
@@ -52,7 +59,7 @@ var f = class extends o {
|
|
|
52
59
|
});
|
|
53
60
|
});
|
|
54
61
|
}
|
|
55
|
-
},
|
|
62
|
+
}, m = class extends p {
|
|
56
63
|
get idPrefix() {
|
|
57
64
|
return "";
|
|
58
65
|
}
|
|
@@ -61,4 +68,4 @@ var f = class extends o {
|
|
|
61
68
|
}
|
|
62
69
|
};
|
|
63
70
|
//#endregion
|
|
64
|
-
export {
|
|
71
|
+
export { p as MonitorShapeIconManager, m as MonitorsIconManager, f as getIconId };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { mapManager as e } from "../map/map.svelte.js";
|
|
2
|
+
import { monitorsManager as t } from "./monitors.svelte.js";
|
|
3
3
|
import { clickManager as n } from "../map/integrations/click-manager.js";
|
|
4
4
|
import { MapIconLayerIntegration as r } from "../map/integrations/map-geojson-integration.svelte.js";
|
|
5
5
|
import { MonitorsIconManager as i, getIconId as a } from "./monitors-icon-manager.svelte.js";
|
|
@@ -67,66 +67,72 @@ var m = {
|
|
|
67
67
|
icons = new i();
|
|
68
68
|
tooltipManager = new o();
|
|
69
69
|
renderer = new u(this);
|
|
70
|
-
|
|
71
|
-
purpleair: new s("PurpleAir", !0),
|
|
72
|
-
sjvair: new s("SJVAir non-FEM", !0),
|
|
73
|
-
aqview: new s("AQview", !0),
|
|
74
|
-
bam1022: new s("SJVAir FEM", !0),
|
|
75
|
-
airnow: new s("AirNow", !0),
|
|
76
|
-
inactive: new s("Inactive", !1),
|
|
77
|
-
inside: new s("Inside", !1)
|
|
78
|
-
};
|
|
70
|
+
#n = f.derived(() => ({
|
|
71
|
+
purpleair: new s("PurpleAir", !0, this.icons.get("outside-display-square")),
|
|
72
|
+
sjvair: new s("SJVAir non-FEM", !0, this.icons.get("outside-display-circle")),
|
|
73
|
+
aqview: new s("AQview", !0, this.icons.get("outside-display-triangle")),
|
|
74
|
+
bam1022: new s("SJVAir FEM", !0, this.icons.get("outside-display-triangle")),
|
|
75
|
+
airnow: new s("AirNow", !0, this.icons.get("outside-display-triangle")),
|
|
76
|
+
inactive: new s("Inactive", !1, this.icons.get("outside-default-square")),
|
|
77
|
+
inside: new s("Inside", !1, this.icons.get("inside-display-square"))
|
|
78
|
+
}));
|
|
79
|
+
get displayOptions() {
|
|
80
|
+
return f.get(this.#n);
|
|
81
|
+
}
|
|
82
|
+
set displayOptions(e) {
|
|
83
|
+
f.set(this.#n, e);
|
|
84
|
+
}
|
|
79
85
|
onMonitorClick = null;
|
|
80
|
-
#
|
|
86
|
+
#r = f.state(null);
|
|
81
87
|
get selectedMonitorId() {
|
|
82
|
-
return f.get(this.#
|
|
88
|
+
return f.get(this.#r);
|
|
83
89
|
}
|
|
84
90
|
set selectedMonitorId(e) {
|
|
85
|
-
f.set(this.#
|
|
91
|
+
f.set(this.#r, e, !0);
|
|
86
92
|
}
|
|
87
|
-
handleMonitorClick = (
|
|
93
|
+
handleMonitorClick = (t) => {
|
|
88
94
|
if (!this.onMonitorClick) return;
|
|
89
|
-
let n = [...
|
|
95
|
+
let n = [...t].sort((e, t) => (t.properties?.order ?? 0) - (e.properties?.order ?? 0))[0];
|
|
90
96
|
if (!n?.properties?.id || (this.selectedMonitorId = n.properties.id, this.onMonitorClick(this.selectedMonitorId), n.geometry.type !== "Point")) return;
|
|
91
97
|
let r = n.geometry.coordinates;
|
|
92
|
-
|
|
98
|
+
e.map?.easeTo({
|
|
93
99
|
center: r,
|
|
94
|
-
zoom: Math.max(
|
|
100
|
+
zoom: Math.max(e.map.getZoom(), 12)
|
|
95
101
|
});
|
|
96
102
|
};
|
|
97
|
-
#
|
|
98
|
-
if (!
|
|
99
|
-
let
|
|
100
|
-
return Array.from(
|
|
103
|
+
#i = f.derived(() => {
|
|
104
|
+
if (!t.meta || !t.latest || !t.pollutant) return [];
|
|
105
|
+
let e = t.meta.entryType(t.pollutant).asIter.levels;
|
|
106
|
+
return Array.from(t.latest.values().map((t) => {
|
|
101
107
|
let n = {
|
|
102
108
|
type: "Feature",
|
|
103
109
|
properties: {
|
|
104
110
|
icon: "outside-default-square",
|
|
105
|
-
id:
|
|
106
|
-
is_active:
|
|
107
|
-
is_sjvair:
|
|
108
|
-
location:
|
|
109
|
-
name:
|
|
110
|
-
order: l(
|
|
111
|
-
type:
|
|
112
|
-
value:
|
|
111
|
+
id: t.id,
|
|
112
|
+
is_active: t.is_active,
|
|
113
|
+
is_sjvair: t.is_sjvair,
|
|
114
|
+
location: t.location,
|
|
115
|
+
name: t.name,
|
|
116
|
+
order: l(t),
|
|
117
|
+
type: t.type,
|
|
118
|
+
value: t.latest.value
|
|
113
119
|
},
|
|
114
|
-
geometry:
|
|
120
|
+
geometry: t.position
|
|
115
121
|
};
|
|
116
|
-
if (
|
|
117
|
-
let r = c(
|
|
118
|
-
r && (n.properties.icon = a(
|
|
122
|
+
if (e) {
|
|
123
|
+
let r = c(t.latest.value, e);
|
|
124
|
+
r && (n.properties.icon = a(t, r));
|
|
119
125
|
}
|
|
120
126
|
return n;
|
|
121
127
|
}));
|
|
122
128
|
});
|
|
123
129
|
get features() {
|
|
124
|
-
return f.get(this.#
|
|
130
|
+
return f.get(this.#i);
|
|
125
131
|
}
|
|
126
132
|
set features(e) {
|
|
127
|
-
f.set(this.#
|
|
133
|
+
f.set(this.#i, e);
|
|
128
134
|
}
|
|
129
|
-
#
|
|
135
|
+
#a = f.derived(() => {
|
|
130
136
|
let e = ["any"], t = ["any", [
|
|
131
137
|
"==",
|
|
132
138
|
["get", "location"],
|
|
@@ -152,12 +158,12 @@ var m = {
|
|
|
152
158
|
];
|
|
153
159
|
});
|
|
154
160
|
get filters() {
|
|
155
|
-
return f.get(this.#
|
|
161
|
+
return f.get(this.#a);
|
|
156
162
|
}
|
|
157
163
|
set filters(e) {
|
|
158
|
-
f.set(this.#
|
|
164
|
+
f.set(this.#a, e);
|
|
159
165
|
}
|
|
160
|
-
#
|
|
166
|
+
#o = f.derived(() => {
|
|
161
167
|
let e = this.displayOptions, t = {};
|
|
162
168
|
for (let n of this.features) {
|
|
163
169
|
let r = n.properties;
|
|
@@ -174,17 +180,17 @@ var m = {
|
|
|
174
180
|
return t;
|
|
175
181
|
});
|
|
176
182
|
get featuresByType() {
|
|
177
|
-
return f.get(this.#
|
|
183
|
+
return f.get(this.#o);
|
|
178
184
|
}
|
|
179
185
|
set featuresByType(e) {
|
|
180
|
-
f.set(this.#
|
|
186
|
+
f.set(this.#o, e);
|
|
181
187
|
}
|
|
182
|
-
#
|
|
188
|
+
#s = f.derived(() => !t.meta || !t.pollutant ? [] : t.meta.entryType(t.pollutant).asIter.levels ?? []);
|
|
183
189
|
get clusterIconThresholds() {
|
|
184
|
-
return f.get(this.#
|
|
190
|
+
return f.get(this.#s);
|
|
185
191
|
}
|
|
186
192
|
set clusterIconThresholds(e) {
|
|
187
|
-
f.set(this.#
|
|
193
|
+
f.set(this.#s, e);
|
|
188
194
|
}
|
|
189
195
|
get mapLayer() {
|
|
190
196
|
return {
|
|
@@ -219,27 +225,27 @@ var m = {
|
|
|
219
225
|
constructor() {
|
|
220
226
|
super(), f.effect_root(() => {
|
|
221
227
|
f.user_effect(() => {
|
|
222
|
-
let
|
|
223
|
-
|
|
228
|
+
let t = this.filters;
|
|
229
|
+
e.map && (this.clustered ? this.renderer.syncFilter() : e.map.getLayer(this.referenceId) && e.map.setFilter(this.referenceId, t));
|
|
224
230
|
}), f.user_effect(() => {
|
|
225
|
-
let
|
|
226
|
-
!
|
|
231
|
+
let t = this.features;
|
|
232
|
+
!e.map || this.clustered || e.setDataSource(this.referenceId, t);
|
|
227
233
|
}), f.user_effect(() => {
|
|
228
|
-
this.featuresByType, !(!
|
|
234
|
+
this.featuresByType, !(!e.map || !this.clustered) && this.renderer.syncFeatures();
|
|
229
235
|
}), f.user_effect(() => {
|
|
230
|
-
let
|
|
231
|
-
!
|
|
236
|
+
let t = this.clusterIconThresholds;
|
|
237
|
+
!e.map || !this.clustered || !t.length || this.renderer.syncThresholds();
|
|
232
238
|
}), f.user_effect(() => {
|
|
233
239
|
this.clustered;
|
|
234
|
-
let
|
|
235
|
-
!p(() =>
|
|
240
|
+
let t = Object.keys(this.featuresByType).length > 0;
|
|
241
|
+
!p(() => e.map) || !t || p(() => this.apply());
|
|
236
242
|
}), f.user_effect(() => {
|
|
237
|
-
this.selectedMonitorId,
|
|
243
|
+
this.selectedMonitorId, e.map && p(() => this.applySelectedState());
|
|
238
244
|
});
|
|
239
245
|
});
|
|
240
246
|
}
|
|
241
247
|
apply() {
|
|
242
|
-
|
|
248
|
+
e.map && (this.tooltipManager.has(this.referenceId) || this.tooltipManager.register(this.referenceId, d), this.clustered ? (e.map.getLayer(this.referenceId) && e.map.removeLayer(this.referenceId), e.map.getSource(this.referenceId) && e.map.removeSource(this.referenceId), n.unregister([this.referenceId]), this.tooltipManager.disable(), this.renderer.remove(), this.icons.loadIcons().then(() => {
|
|
243
249
|
this.renderer.apply(this.handleMonitorClick), this.tooltipManager.enable(), this.applySelectedState();
|
|
244
250
|
})) : (this.tooltipManager.disable(), this.renderer.remove(), this.tooltipManager.enable(), n.unregister([this.referenceId]), super.apply(), this.icons.loadIcons().then(() => {
|
|
245
251
|
n.register([this.referenceId], this.handleMonitorClick), this.applySelectedState();
|
|
@@ -249,15 +255,15 @@ var m = {
|
|
|
249
255
|
n.unregister([this.referenceId]), this.renderer.remove(), super.remove();
|
|
250
256
|
}
|
|
251
257
|
applySelectedState() {
|
|
252
|
-
if (!
|
|
253
|
-
let
|
|
258
|
+
if (!e.map) return;
|
|
259
|
+
let t = this.clustered ? this.renderer.unclusteredLayerIds : [this.referenceId], n = this.selectedMonitorId ? [
|
|
254
260
|
"match",
|
|
255
261
|
["get", "id"],
|
|
256
262
|
this.selectedMonitorId,
|
|
257
263
|
1.3,
|
|
258
264
|
1
|
|
259
265
|
] : 1;
|
|
260
|
-
for (let r of
|
|
266
|
+
for (let r of t) e.map.getLayer(r) && e.map.setLayoutProperty(r, "icon-size", n);
|
|
261
267
|
}
|
|
262
268
|
}();
|
|
263
269
|
//#endregion
|