mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Fix Leaflet import (#5802)
This commit is contained in:
parent
966c0bc06c
commit
05ac275780
@ -1,4 +1,4 @@
|
|||||||
import { Map } from "leaflet";
|
import type { Map } from "leaflet";
|
||||||
|
|
||||||
// Sets up a Leaflet map on the provided DOM element
|
// Sets up a Leaflet map on the provided DOM element
|
||||||
export type LeafletModuleType = typeof import("leaflet");
|
export type LeafletModuleType = typeof import("leaflet");
|
||||||
@ -13,9 +13,9 @@ export const setupLeafletMap = async (
|
|||||||
throw new Error("Cannot setup Leaflet map on disconnected element");
|
throw new Error("Cannot setup Leaflet map on disconnected element");
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
const Leaflet = (await import(
|
const Leaflet = ((await import(
|
||||||
/* webpackChunkName: "leaflet" */ "leaflet"
|
/* webpackChunkName: "leaflet" */ "leaflet"
|
||||||
)) as LeafletModuleType;
|
)) as any).default as LeafletModuleType;
|
||||||
Leaflet.Icon.Default.imagePath = "/static/images/leaflet/images/";
|
Leaflet.Icon.Default.imagePath = "/static/images/leaflet/images/";
|
||||||
|
|
||||||
if (draw) {
|
if (draw) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user