Fix Leaflet import (#5802)

This commit is contained in:
Paulus Schoutsen 2020-05-07 13:04:29 -07:00 committed by GitHub
parent 966c0bc06c
commit 05ac275780
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {