File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Leaflet
2
2
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
+
3
7
``` js echo
4
8
import * as L from " npm:leaflet" ;
5
9
```
6
10
11
+ To create a map, follow the [ tutorial] ( https://leafletjs.com/examples/quick-start/ ) :
12
+
7
13
``` js echo
8
14
const div = Object .assign (display (document .createElement (" div" )), {style: " height: 400px;" });
9
15
const map = L .map (div).setView ([51.505 , - 0.09 ], 13 );
10
16
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. " );
12
18
```
You can’t perform that action at this time.
0 commit comments