leaflet-html 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/leaflet-html.cjs +1 -1
- package/dist/leaflet-html.cjs.map +1 -1
- package/dist/leaflet-html.js +1 -1
- package/dist/leaflet-html.js.map +1 -1
- package/dist/leaflet-html.modern.js +1 -1
- package/dist/leaflet-html.modern.js.map +1 -1
- package/dist/leaflet-html.umd.js +1 -1
- package/dist/leaflet-html.umd.js.map +1 -1
- package/docs/content/articles/basic.md +8 -13
- package/docs/content/articles/icons.md +19 -7
- package/docs/static/style.css +45 -0
- package/docs/templates/base.html +10 -38
- package/example/geojson/index.html +1 -6
- package/example/index.html +1 -6
- package/example/overlays/index.html +1 -6
- package/package.json +1 -1
- package/src/l-base-layers.js +1 -0
- package/src/l-control-layers.js +9 -4
- package/src/l-geojson.js +15 -10
- package/src/l-image-overlay.js +12 -2
- package/src/l-lat-lng-bounds.js +1 -0
- package/src/l-layer-group.js +12 -4
- package/src/l-map.js +7 -2
- package/src/l-overlay-layers.js +1 -0
- package/src/l-popup.js +1 -0
- package/src/l-tile-layer.js +11 -3
- package/src/l-video-overlay.js +3 -1
package/src/l-tile-layer.js
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
// @ts-check
|
2
|
+
import { tileLayer } from "leaflet";
|
1
3
|
import { mapAddTo } from "./events.js";
|
2
4
|
|
3
5
|
class LTileLayer extends HTMLElement {
|
@@ -8,9 +10,15 @@ class LTileLayer extends HTMLElement {
|
|
8
10
|
connectedCallback() {
|
9
11
|
const name = this.getAttribute("name");
|
10
12
|
const urlTemplate = this.getAttribute("url-template");
|
11
|
-
|
12
|
-
|
13
|
-
|
13
|
+
if (urlTemplate === null) {
|
14
|
+
return;
|
15
|
+
}
|
16
|
+
const options = {};
|
17
|
+
const key = "attribution";
|
18
|
+
if (this.hasAttribute(key)) {
|
19
|
+
options[key] = this.getAttribute(key);
|
20
|
+
}
|
21
|
+
const layer = tileLayer(urlTemplate, options);
|
14
22
|
const event = new CustomEvent(mapAddTo, {
|
15
23
|
detail: { name, layer },
|
16
24
|
bubbles: true,
|
package/src/l-video-overlay.js
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
// @ts-check
|
2
|
+
import { videoOverlay } from "leaflet";
|
1
3
|
import { mapAddTo } from "./events.js";
|
2
4
|
|
3
5
|
class LVideoOverlay extends HTMLElement {
|
@@ -15,7 +17,7 @@ class LVideoOverlay extends HTMLElement {
|
|
15
17
|
muted: true,
|
16
18
|
playsInline: true,
|
17
19
|
};
|
18
|
-
const layer =
|
20
|
+
const layer = videoOverlay(url, bounds, options);
|
19
21
|
this.dispatchEvent(
|
20
22
|
new CustomEvent(mapAddTo, {
|
21
23
|
cancelable: true,
|