Skip to content

Commit eb01855

Browse files
committed
L
1 parent b016ad7 commit eb01855

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/lib/leaflet.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
# Leaflet
22

3+
[Leaflet](https://leafletjs.com/) is an open-source JavaScript library for mobile-friendly interactive maps.
4+
5+
Available by default as `L` in Observable markdown, you can also import it explicitly:
6+
37
```js echo
48
import * as L from "npm:leaflet";
59
```
610

11+
To create a map, follow the [tutorial](https://leafletjs.com/examples/quick-start/):
12+
713
```js echo
814
const div = Object.assign(display(document.createElement("div")), {style: "height: 400px;"});
915
const map = L.map(div).setView([51.505, -0.09], 13);
1016
L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(map);
11-
L.marker([51.5, -0.09]).addTo(map).bindPopup("A pretty CSS popup.<br> Easily customizable.").openPopup();
17+
L.marker([51.5, -0.09]).addTo(map).bindPopup("A nice popup<br> indicating a point of interest.");
1218
```

0 commit comments

Comments
 (0)