Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert map card to Lit/TS #2826

Merged
merged 2 commits into from
Feb 25, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
"@gfx/zopfli": "^1.0.9",
"@types/chai": "^4.1.7",
"@types/codemirror": "^0.0.71",
"@types/leaflet": "^1.4.3",
"@types/memoize-one": "^4.1.0",
"@types/mocha": "^5.2.5",
"babel-eslint": "^10",
Expand Down
11 changes: 8 additions & 3 deletions src/common/dom/setup-leaflet-map.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { Map } from "leaflet";

// Sets up a Leaflet map on the provided DOM element
export const setupLeafletMap = async (mapElement) => {
export type LeafletModuleType = typeof import("leaflet");

export const setupLeafletMap = async (
mapElement
): Promise<[Map, LeafletModuleType]> => {
// tslint:disable-next-line
const Leaflet = (await import(/* webpackChunkName: "leaflet" */ "leaflet"))
.default;
const Leaflet = (await import(/* webpackChunkName: "leaflet" */ "leaflet")) as LeafletModuleType;
Leaflet.Icon.Default.imagePath = "/static/images/leaflet";

const map = Leaflet.map(mapElement);
Expand Down
369 changes: 0 additions & 369 deletions src/panels/lovelace/cards/hui-map-card.js

This file was deleted.