leaflet-html 0.3.3 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +11 -1
- package/.github/workflows/master.yml +0 -15
- package/.github/workflows/npm-publish.yml +0 -37
- package/.prettierignore +0 -2
- package/.prettierrc +0 -1
- package/docs/config.toml +0 -16
- package/docs/content/_index.md +0 -89
- package/docs/content/articles/_index.md +0 -5
- package/docs/content/articles/basic.md +0 -110
- package/docs/content/articles/htmx.md +0 -84
- package/docs/content/articles/icons.md +0 -47
- package/docs/content/articles/style.md +0 -14
- package/docs/public/icons/leaf-green.png +0 -0
- package/docs/public/icons/leaf-orange.png +0 -0
- package/docs/public/icons/leaf-red.png +0 -0
- package/docs/public/icons/leaf-shadow.png +0 -0
- package/docs/static/htmx/clicked.html +0 -1
- package/docs/static/htmx/marker.html +0 -3
- package/docs/static/htmx/tile-esri.html +0 -3
- package/docs/static/htmx/tile-osm.html +0 -4
- package/docs/static/htmx/tile-voyager.html +0 -4
- package/docs/static/icons/leaf-green.png +0 -0
- package/docs/static/icons/leaf-orange.png +0 -0
- package/docs/static/icons/leaf-red.png +0 -0
- package/docs/static/icons/leaf-shadow.png +0 -0
- package/docs/static/style.css +0 -48
- package/docs/templates/article-page.html +0 -8
- package/docs/templates/article.html +0 -12
- package/docs/templates/base.html +0 -43
- package/docs/templates/index.html +0 -6
- package/docs/templates/shortcodes/url.html +0 -1
- package/example/geojson/index.html +0 -44
- package/example/index.html +0 -113
- package/example/overlays/index.html +0 -78
- package/src/events.js +0 -3
- package/src/index.js +0 -33
- package/src/l-base-layers.js +0 -16
- package/src/l-control-layers.js +0 -39
- package/src/l-geojson.js +0 -27
- package/src/l-icon.js +0 -124
- package/src/l-image-overlay.js +0 -54
- package/src/l-lat-lng-bounds.js +0 -21
- package/src/l-layer-group.js +0 -51
- package/src/l-layer.js +0 -8
- package/src/l-map.js +0 -56
- package/src/l-marker.js +0 -95
- package/src/l-overlay-layers.js +0 -16
- package/src/l-popup.js +0 -22
- package/src/l-tile-layer.js +0 -32
- package/src/l-video-overlay.js +0 -34
- package/vite.config.js +0 -7
package/package.json
CHANGED
@@ -1,12 +1,22 @@
|
|
1
1
|
{
|
2
2
|
"name": "leaflet-html",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.3.
|
4
|
+
"version": "0.3.5",
|
5
5
|
"description": "Leaflet expressed in HTML",
|
6
|
+
"keywords": [
|
7
|
+
"leaflet",
|
8
|
+
"hda",
|
9
|
+
"html",
|
10
|
+
"hypermedia",
|
11
|
+
"maps"
|
12
|
+
],
|
6
13
|
"source": "src/index.js",
|
7
14
|
"main": "./dist/leaflet-html.cjs",
|
8
15
|
"module": "./dist/leaflet-html.js",
|
9
16
|
"author": "andrewgryan",
|
17
|
+
"files": [
|
18
|
+
"dist"
|
19
|
+
],
|
10
20
|
"repository": {
|
11
21
|
"type": "git",
|
12
22
|
"url": "git+https://github.com/andrewgryan/leaflet-html.git"
|
@@ -1,15 +0,0 @@
|
|
1
|
-
on: push
|
2
|
-
name: Build and deploy GH Pages
|
3
|
-
jobs:
|
4
|
-
build:
|
5
|
-
runs-on: ubuntu-latest
|
6
|
-
if: github.ref == 'refs/heads/master'
|
7
|
-
steps:
|
8
|
-
- name: checkout
|
9
|
-
uses: actions/checkout@v4
|
10
|
-
- name: build_and_deploy
|
11
|
-
uses: shalzz/zola-deploy-action@v0.17.2
|
12
|
-
env:
|
13
|
-
BUILD_DIR: docs
|
14
|
-
PAGES_BRANCH: gh-pages
|
15
|
-
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
@@ -1,37 +0,0 @@
|
|
1
|
-
name: npm-publish
|
2
|
-
on:
|
3
|
-
push:
|
4
|
-
branches:
|
5
|
-
- master
|
6
|
-
jobs:
|
7
|
-
npm-publish:
|
8
|
-
name: npm-publish
|
9
|
-
runs-on: ubuntu-latest
|
10
|
-
steps:
|
11
|
-
- name: Checkout repository
|
12
|
-
uses: actions/checkout@v4
|
13
|
-
- name: Set Node.js
|
14
|
-
uses: actions/setup-node@v4
|
15
|
-
with:
|
16
|
-
node-version: 21
|
17
|
-
- name: Install
|
18
|
-
uses: borales/actions-yarn@v4
|
19
|
-
with:
|
20
|
-
cmd: install
|
21
|
-
- name: Build
|
22
|
-
uses: borales/actions-yarn@v4
|
23
|
-
with:
|
24
|
-
cmd: build
|
25
|
-
- name: Publish if version has been updated
|
26
|
-
uses: pascalgn/npm-publish-action@1.3.9
|
27
|
-
with:
|
28
|
-
tag_name: "v%s"
|
29
|
-
tag_message: "v%s"
|
30
|
-
create_tag: "true"
|
31
|
-
commit_pattern: "^Release (\\S+)"
|
32
|
-
workspace: "."
|
33
|
-
publish_command: "yarn"
|
34
|
-
publish_args: "--non-interactive"
|
35
|
-
env:
|
36
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
37
|
-
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
package/.prettierignore
DELETED
package/.prettierrc
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{}
|
package/docs/config.toml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# The URL the site will be built for
|
2
|
-
base_url = "https://andrewgryan.github.io/leaflet-html"
|
3
|
-
|
4
|
-
# Whether to automatically compile all Sass files in the sass directory
|
5
|
-
compile_sass = false
|
6
|
-
|
7
|
-
# Whether to build a search index to be used later on by a JavaScript library
|
8
|
-
build_search_index = false
|
9
|
-
|
10
|
-
[markdown]
|
11
|
-
# Whether to do syntax highlighting
|
12
|
-
# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola
|
13
|
-
highlight_code = true
|
14
|
-
|
15
|
-
[extra]
|
16
|
-
# Put all your custom variables here
|
package/docs/content/_index.md
DELETED
@@ -1,89 +0,0 @@
|
|
1
|
-
+++
|
2
|
-
+++
|
3
|
-
# Leaflet HTML
|
4
|
-
|
5
|
-
[LeafletJS](https://leafletjs.com/) is a library geared towards map based visualisations.
|
6
|
-
Leaflet HTML expresses that JavaScript API in HTML.
|
7
|
-
|
8
|
-
## How-to guides
|
9
|
-
|
10
|
-
[Articles](@/articles/_index.md) have been written to make adopting Leaflet HTML simpler.
|
11
|
-
These articles follow the Leaflet tutorials closely and add a few `leaflet-html` specific
|
12
|
-
tips and tricks.
|
13
|
-
|
14
|
-
## Design principles
|
15
|
-
|
16
|
-
Leaflet HTML tries to model Leaflet's API as closely as possible to avoid confusion and to ease onboarding.
|
17
|
-
Naming conventions are followed where possible.
|
18
|
-
The hierarchy in the JS API is replicated by nesting HTML elements.
|
19
|
-
|
20
|
-
## Example
|
21
|
-
|
22
|
-
The following is a live running example of Leaflet HTML.
|
23
|
-
|
24
|
-
<l-map center="[39.61, -105.02]" zoom="10">
|
25
|
-
<l-control-layers>
|
26
|
-
<l-base-layers>
|
27
|
-
<l-tile-layer
|
28
|
-
name="CartoDB_Voyager"
|
29
|
-
url-template="https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png"
|
30
|
-
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>'
|
31
|
-
max-zoom="20"
|
32
|
-
subdomains="abcd"
|
33
|
-
show
|
34
|
-
></l-tile-layer>
|
35
|
-
</l-base-layers>
|
36
|
-
<l-overlay-layers>
|
37
|
-
<l-layer-group name="Cities">
|
38
|
-
<l-marker lat-lng="[39.61, -105.02]">
|
39
|
-
<l-popup content="This is Littleton, CO."></l-popup>
|
40
|
-
</l-marker>
|
41
|
-
<l-marker lat-lng="[39.74, -104.99]">
|
42
|
-
<l-popup content="This is Denver, CO."></l-popup>
|
43
|
-
</l-marker>
|
44
|
-
<l-marker lat-lng="[39.73, -104.8]">
|
45
|
-
<l-popup content="This is Aurora, CO."></l-popup>
|
46
|
-
</l-marker>
|
47
|
-
<l-marker lat-lng="[39.77, -105.23]">
|
48
|
-
<l-popup content="This is Golden, CO."></l-popup>
|
49
|
-
</l-marker>
|
50
|
-
</l-layer-group>
|
51
|
-
</l-overlay-layers>
|
52
|
-
</l-control-layers>
|
53
|
-
</l-map>
|
54
|
-
|
55
|
-
The above application is represented in HTML using the following syntax.
|
56
|
-
|
57
|
-
```html
|
58
|
-
<l-map center="[39.61, -105.02]" zoom="10">
|
59
|
-
<l-control-layers>
|
60
|
-
<l-base-layers>
|
61
|
-
<l-tile-layer
|
62
|
-
name="CartoDB_Voyager"
|
63
|
-
url-template="https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png"
|
64
|
-
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>'
|
65
|
-
max-zoom="20"
|
66
|
-
subdomains="abcd"
|
67
|
-
></l-tile-layer>
|
68
|
-
</l-base-layers>
|
69
|
-
<l-overlay-layers>
|
70
|
-
<l-layer-group name="Cities">
|
71
|
-
<l-marker lat-lng="[39.61, -105.02]">
|
72
|
-
<l-popup content="This is Littleton, CO."></l-popup>
|
73
|
-
</l-marker>
|
74
|
-
<l-marker lat-lng="[39.74, -104.99]">
|
75
|
-
<l-popup content="This is Denver, CO."></l-popup>
|
76
|
-
</l-marker>
|
77
|
-
<l-marker lat-lng="[39.73, -104.8]">
|
78
|
-
<l-popup content="This is Aurora, CO."></l-popup>
|
79
|
-
</l-marker>
|
80
|
-
<l-marker lat-lng="[39.77, -105.23]">
|
81
|
-
<l-popup content="This is Golden, CO."></l-popup>
|
82
|
-
</l-marker>
|
83
|
-
</l-layer-group>
|
84
|
-
</l-overlay-layers>
|
85
|
-
</l-control-layers>
|
86
|
-
</l-map>
|
87
|
-
```
|
88
|
-
|
89
|
-
The above example is a taste of the syntax and capabilities of wrapping Leaflet in HTML tags.
|
@@ -1,110 +0,0 @@
|
|
1
|
-
+++
|
2
|
-
title = "Basic usage"
|
3
|
-
+++
|
4
|
-
|
5
|
-
The minimal `leaflet-html` app is a basemap centered and zoomed on a location.
|
6
|
-
|
7
|
-
```html
|
8
|
-
<l-map center="[53, 0]" zoom="4">
|
9
|
-
<l-tile-layer
|
10
|
-
url-template="https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png"
|
11
|
-
></l-tile-layer>
|
12
|
-
</l-map>
|
13
|
-
```
|
14
|
-
|
15
|
-
<l-map center="[53, 0]" zoom="4">
|
16
|
-
<l-tile-layer
|
17
|
-
url-template="https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png"
|
18
|
-
></l-tile-layer>
|
19
|
-
</l-map>
|
20
|
-
|
21
|
-
To add the above widget to a HTML document both JS and CSS tags need to be included in the `<head>` of the page.
|
22
|
-
|
23
|
-
## Assets
|
24
|
-
|
25
|
-
Basic HTML recommended settings, e.g. `charset`, `lang`, and `viewport` to help with cross device support.
|
26
|
-
Can be placed in the `<head>` tag, along with CSS and JS assets.
|
27
|
-
|
28
|
-
```html
|
29
|
-
<head lang="en">
|
30
|
-
<meta charset="utf-8" />
|
31
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
32
|
-
</head>
|
33
|
-
```
|
34
|
-
|
35
|
-
### Leaflet
|
36
|
-
|
37
|
-
Leaflet is an external dependency of `leaflet-html`, as such,
|
38
|
-
the standard Leaflet assets should be included.
|
39
|
-
|
40
|
-
```html
|
41
|
-
<head>
|
42
|
-
...
|
43
|
-
<link
|
44
|
-
rel="stylesheet"
|
45
|
-
href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
|
46
|
-
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
|
47
|
-
crossorigin=""
|
48
|
-
/>
|
49
|
-
...
|
50
|
-
</head>
|
51
|
-
```
|
52
|
-
|
53
|
-
### Leaflet-HTML
|
54
|
-
|
55
|
-
Leaflet-HTML is available via **npm** and **unpkg**.
|
56
|
-
To get started quickly, use the CDN version available on **unpkg**.
|
57
|
-
|
58
|
-
```html
|
59
|
-
<script type="importmap">
|
60
|
-
{
|
61
|
-
"imports": {
|
62
|
-
"leaflet": "https://unpkg.com/leaflet@1.9.4/dist/leaflet-src.esm.js",
|
63
|
-
"leaflet-html": "https://unpkg.com/leaflet-html@latest/dist/leaflet-html.js"
|
64
|
-
}
|
65
|
-
}
|
66
|
-
</script>
|
67
|
-
```
|
68
|
-
|
69
|
-
```html
|
70
|
-
<script type="module">
|
71
|
-
import "leaflet-html";
|
72
|
-
</script>
|
73
|
-
```
|
74
|
-
|
75
|
-
The `@latest` keyword should keep your site up to date during development.
|
76
|
-
|
77
|
-
## Minimal style
|
78
|
-
|
79
|
-
By default Custom elements are `display: inline`,
|
80
|
-
meaning they are unaffected by `height`.
|
81
|
-
Add the following ruleset to your stylesheet to enable map size.
|
82
|
-
|
83
|
-
```css
|
84
|
-
l-map {
|
85
|
-
display: block;
|
86
|
-
}
|
87
|
-
```
|
88
|
-
|
89
|
-
It's not always necessary to set `block` directly on an `l-map` tag.
|
90
|
-
For example, a parent with `display: grid`, will size the `l-map` tag appropriately.
|
91
|
-
|
92
|
-
### Z-index
|
93
|
-
|
94
|
-
Leaflet has fairly strong `z-index` settings that are not easy to override.
|
95
|
-
The easiest way to get around them is to start a new stacking context using `isolation: isolate`.
|
96
|
-
|
97
|
-
### Sensible defaults
|
98
|
-
|
99
|
-
Without knowing anything specific about your application the following settings should be a good starting place.
|
100
|
-
|
101
|
-
```css
|
102
|
-
l-map {
|
103
|
-
display: block;
|
104
|
-
block-size: 40ch;
|
105
|
-
isolation: isolate;
|
106
|
-
z-index: 1;
|
107
|
-
}
|
108
|
-
```
|
109
|
-
|
110
|
-
This allows overlaying your own UI elements and gives full control over size and position of each map on the page.
|
@@ -1,84 +0,0 @@
|
|
1
|
-
+++
|
2
|
-
title = "Working with HTMX"
|
3
|
-
+++
|
4
|
-
|
5
|
-
To add HTMX to a project.
|
6
|
-
Add a script tag to pull the library into your page.
|
7
|
-
|
8
|
-
```html
|
9
|
-
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
|
10
|
-
<!-- have a button POST a click via AJAX -->
|
11
|
-
<button hx-get="/clicked" hx-swap="outerHTML">
|
12
|
-
Click Me
|
13
|
-
</button>
|
14
|
-
```
|
15
|
-
|
16
|
-
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
|
17
|
-
<button hx-get={{ url(path="htmx/clicked.html") }} hx-swap="outerHTML">
|
18
|
-
Click Me
|
19
|
-
</button>
|
20
|
-
|
21
|
-
## Use with Leaflet-HTML
|
22
|
-
|
23
|
-
The principles that govern HTMX development also hold for Leaflet-HTML.
|
24
|
-
A button that requests HTML to replace part of the document should update the map.
|
25
|
-
|
26
|
-
```html
|
27
|
-
<!-- Initial map -->
|
28
|
-
<l-map center="[55,-5]" zoom="4">
|
29
|
-
<l-tile-layer
|
30
|
-
url-template="https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png"
|
31
|
-
></l-tile-layer>
|
32
|
-
</l-map>
|
33
|
-
|
34
|
-
<!-- Tiles -->
|
35
|
-
<button hx-get="/tile-osm.html" hx-target="l-tile-layer" hx-swap="outerHTML">
|
36
|
-
OSM
|
37
|
-
</button>
|
38
|
-
<button hx-get="/tile-voyager.html" hx-target="l-tile-layer" hx-swap="outerHTML">
|
39
|
-
Voyager
|
40
|
-
</button>
|
41
|
-
<button hx-get="/tile-esri.html" hx-target="l-tile-layer" hx-swap="outerHTML">
|
42
|
-
ESRI
|
43
|
-
</button>
|
44
|
-
|
45
|
-
<!-- Marker -->
|
46
|
-
<button hx-get="/marker.html" hx-target="l-map" hx-swap="beforeend">
|
47
|
-
Add marker
|
48
|
-
</button>
|
49
|
-
<button hx-get="/marker.html" hx-target="l-marker" hx-swap="delete">
|
50
|
-
Delete marker
|
51
|
-
</button>
|
52
|
-
```
|
53
|
-
|
54
|
-
<l-map center="[55,-5]" zoom="4">
|
55
|
-
<l-tile-layer
|
56
|
-
url-template="https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png"
|
57
|
-
></l-tile-layer>
|
58
|
-
</l-map>
|
59
|
-
|
60
|
-
<button hx-get={{ url(path='htmx/tile-osm.html') }} hx-target="l-tile-layer" hx-swap="outerHTML">
|
61
|
-
OSM
|
62
|
-
</button>
|
63
|
-
<button hx-get={{ url(path='htmx/tile-voyager.html') }} hx-target="l-tile-layer" hx-swap="outerHTML">
|
64
|
-
Voyager
|
65
|
-
</button>
|
66
|
-
<button hx-get={{ url(path='htmx/tile-esri.html') }} hx-target="l-tile-layer" hx-swap="outerHTML">
|
67
|
-
ESRI
|
68
|
-
</button>
|
69
|
-
<button hx-get={{ url(path='htmx/marker.html') }} hx-target="l-map" hx-swap="beforeend">
|
70
|
-
Add marker
|
71
|
-
</button>
|
72
|
-
<button hx-get={{ url(path='htmx/marker.html')}} hx-target="l-marker" hx-swap="delete">
|
73
|
-
Delete marker
|
74
|
-
</button>
|
75
|
-
|
76
|
-
The above approach works by triggering the change handlers in the `<l-tile-layer>` custom element.
|
77
|
-
The additional HTML tags generated by Leaflet are also inside the `<l-map>` tag.
|
78
|
-
Care should be taken to not `hx-swap` the tags governed by Leaflet.
|
79
|
-
|
80
|
-
All Leaflet-HTML tags, e.g. `<l-marker>`, `<l-icon>`, etc. can be swapped however you like.
|
81
|
-
It is just the contents of `<l-map>` that needs careful consideration.
|
82
|
-
|
83
|
-
A more elegant mechanism in the future will make it clear which part of the document is controlled by Leaflet.
|
84
|
-
|
@@ -1,47 +0,0 @@
|
|
1
|
-
+++
|
2
|
-
title = "Custom icons"
|
3
|
-
+++
|
4
|
-
|
5
|
-
There are two ways to add an icon to a marker.
|
6
|
-
One is to specify a `icon` attribute containing a JSON string of `L.Icon` options.
|
7
|
-
|
8
|
-
```html
|
9
|
-
<l-marker
|
10
|
-
lat-lng="[51.5, -0.09]"
|
11
|
-
icon='{"iconUrl": "icons/leaf-green.png"}'
|
12
|
-
></l-marker>
|
13
|
-
```
|
14
|
-
|
15
|
-
The other way is to create a separate HTML tag to configure the icon.
|
16
|
-
This is a more HTML centered approach.
|
17
|
-
The above JSON approach may be suitable in cases where the icon data is available in a data structure.
|
18
|
-
|
19
|
-
```html
|
20
|
-
<l-marker lat-lng="[51.5, -0.09]"><l-icon
|
21
|
-
icon-url="/icons/leaf-green.png"
|
22
|
-
shadow-url="/icons/leaf-shadow.png"
|
23
|
-
icon-size="[38, 95]"
|
24
|
-
shadow-size="[50, 64]"
|
25
|
-
icon-anchor="[22, 94]"
|
26
|
-
shadow-anchor="[4, 62]"
|
27
|
-
popup-anchor="[-3, -76]"
|
28
|
-
></l-icon>
|
29
|
-
```
|
30
|
-
|
31
|
-
Both are supported, choose whichever is most convenient.
|
32
|
-
|
33
|
-
<l-map center="[51.5, -0.09]" zoom="12">
|
34
|
-
<l-tile-layer
|
35
|
-
url-template="https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png"
|
36
|
-
></l-tile-layer>
|
37
|
-
<l-marker lat-lng="[51.5, -0.09]"><l-icon
|
38
|
-
icon-url={{ url(path='icons/leaf-green.png') }}
|
39
|
-
shadow-url={{ url(path='icons/leaf-shadow.png') }}
|
40
|
-
icon-size="[38, 95]"
|
41
|
-
shadow-size="[50, 64]"
|
42
|
-
icon-anchor="[22, 94]"
|
43
|
-
shadow-anchor="[4, 62]"
|
44
|
-
popup-anchor="[-3, -76]"
|
45
|
-
></l-icon>
|
46
|
-
</l-marker>
|
47
|
-
</l-map>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
+++
|
2
|
-
title = "Styling leaflet objects"
|
3
|
-
+++
|
4
|
-
|
5
|
-
## Naming convention
|
6
|
-
Leaflet styles objects using the `style` keyword option.
|
7
|
-
Leaflet HTML, on the other hand, needs to support inline style and leaflet style.
|
8
|
-
Therefore, the keyword `l-style` is used to style the underlying leaflet objects.
|
9
|
-
|
10
|
-
## Example
|
11
|
-
|
12
|
-
```html
|
13
|
-
<l-marker l-style='{"color": "hotpink"}'></l-marker>
|
14
|
-
```
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
<h2>Hello, HTMX!</h2>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
package/docs/static/style.css
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
@import "https://unpkg.com/open-props";
|
2
|
-
|
3
|
-
l-map {
|
4
|
-
display: block;
|
5
|
-
block-size: 40ch;
|
6
|
-
isolation: isolate;
|
7
|
-
z-index: 1;
|
8
|
-
}
|
9
|
-
|
10
|
-
body {
|
11
|
-
font-family: system-ui;
|
12
|
-
line-height: 1.6;
|
13
|
-
margin: 0;
|
14
|
-
min-height: 100vh;
|
15
|
-
display: grid;
|
16
|
-
grid-template-columns: 1fr;
|
17
|
-
}
|
18
|
-
|
19
|
-
h1, h2, h3 {
|
20
|
-
font-weight: 100;
|
21
|
-
}
|
22
|
-
|
23
|
-
pre {
|
24
|
-
padding-inline: 0.75rem;
|
25
|
-
padding-block: 0.5rem;
|
26
|
-
border-radius: 0.2rem;
|
27
|
-
overflow-x: auto;
|
28
|
-
}
|
29
|
-
|
30
|
-
main {
|
31
|
-
inline-size: min(90%, 80ch);
|
32
|
-
margin-inline: auto;
|
33
|
-
max-inline-size: 100vw;
|
34
|
-
}
|
35
|
-
|
36
|
-
footer {
|
37
|
-
margin-block-start: auto;
|
38
|
-
min-height: 15ch;
|
39
|
-
background-color: var(--gray-9);
|
40
|
-
padding: var(--size-3);
|
41
|
-
|
42
|
-
& .logo {
|
43
|
-
color: var(--gray-2);
|
44
|
-
font-size: var(--font-size-0);
|
45
|
-
letter-spacing: var(--font-letterspacing-5);
|
46
|
-
}
|
47
|
-
}
|
48
|
-
|
@@ -1,12 +0,0 @@
|
|
1
|
-
{% extends "base.html" %}
|
2
|
-
|
3
|
-
{% block content %}
|
4
|
-
<main>
|
5
|
-
<h1>{{section.title}}</h1>
|
6
|
-
<ul>
|
7
|
-
{% for page in section.pages %}
|
8
|
-
<li><a href="{{ page.permalink | safe }}">{{ page.title }}</a></li>
|
9
|
-
{% endfor %}
|
10
|
-
</ul>
|
11
|
-
</main>
|
12
|
-
{% endblock content %}
|
package/docs/templates/base.html
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
{% if config.base_url == "https://andrewgryan.github.io/leaflet-html" %}
|
2
|
-
{% set js_url = "https://unpkg.com/leaflet-html@latest/dist/leaflet-html.js" %}
|
3
|
-
{% else %}
|
4
|
-
{% set js_url = "/leaflet-html.js" %}
|
5
|
-
{% endif %}
|
6
|
-
<!DOCTYPE html>
|
7
|
-
<html>
|
8
|
-
<head lang="en">
|
9
|
-
<meta charset="utf-8" />
|
10
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
11
|
-
<style>
|
12
|
-
</style>
|
13
|
-
<link rel="stylesheet" href="/style.css" />
|
14
|
-
<link rel="stylesheet" href="/leaflet-html/style.css" />
|
15
|
-
<link
|
16
|
-
rel="stylesheet"
|
17
|
-
href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
|
18
|
-
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
|
19
|
-
crossorigin=""
|
20
|
-
/>
|
21
|
-
<script type="importmap">
|
22
|
-
{
|
23
|
-
"imports": {
|
24
|
-
"leaflet": "https://unpkg.com/leaflet@1.9.4/dist/leaflet-src.esm.js",
|
25
|
-
"leaflet-html": "{{ js_url | safe }}"
|
26
|
-
}
|
27
|
-
}
|
28
|
-
</script>
|
29
|
-
<script type="module">
|
30
|
-
import "leaflet-html";
|
31
|
-
</script>
|
32
|
-
</head>
|
33
|
-
<body>
|
34
|
-
<nav>
|
35
|
-
<a href="{{ get_url(path='@/_index.md') }}">Home</a>
|
36
|
-
<a href="{{ get_url(path='@/articles/_index.md') }}">Articles</a>
|
37
|
-
</nav>
|
38
|
-
{% block content %}{% endblock %}
|
39
|
-
<footer>
|
40
|
-
<div class="logo">Leaflet-HTML</div>
|
41
|
-
</footer>
|
42
|
-
</body>
|
43
|
-
</html>
|
@@ -1 +0,0 @@
|
|
1
|
-
{{ get_url(path=path) }}
|
@@ -1,44 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head lang="en">
|
4
|
-
<meta charset="utf-8" />
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
6
|
-
<title>GeoJSON</title>
|
7
|
-
<link
|
8
|
-
rel="stylesheet"
|
9
|
-
href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
|
10
|
-
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
|
11
|
-
crossorigin=""
|
12
|
-
/>
|
13
|
-
<script type="importmap">
|
14
|
-
{
|
15
|
-
"imports": {
|
16
|
-
"leaflet": "https://unpkg.com/leaflet@1.9.4/dist/leaflet-src.esm.js"
|
17
|
-
}
|
18
|
-
}
|
19
|
-
</script>
|
20
|
-
<script type="module" src="/src/index.js"></script>
|
21
|
-
<style>
|
22
|
-
* {
|
23
|
-
margin: 0;
|
24
|
-
}
|
25
|
-
l-map {
|
26
|
-
display: block;
|
27
|
-
height: 100vh;
|
28
|
-
}
|
29
|
-
</style>
|
30
|
-
</head>
|
31
|
-
<body>
|
32
|
-
<l-map center="[55,0]" zoom="5">
|
33
|
-
<l-tile-layer
|
34
|
-
url-template="https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png"
|
35
|
-
></l-tile-layer>
|
36
|
-
<l-geojson id="feature" geojson='{"type":"Feature","properties":{"name":"Coors Field","amenity":"Baseball Stadium","popupContent":"This is where the Rockies play!"},"geometry":{"type":"Point","coordinates":[-104.99404,39.75621]}}'></l-geojson>
|
37
|
-
</l-map>
|
38
|
-
<script>
|
39
|
-
document.getElementById("feature").addEventListener("map:addTo", (ev) => {
|
40
|
-
console.log({ message: "Hello, World!", ev })
|
41
|
-
})
|
42
|
-
</script>
|
43
|
-
</body>
|
44
|
-
</html>
|