Skip to content

Commit

Permalink
chore: update deps, fix format, use npm
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Oct 29, 2024
1 parent 49e108e commit 20c6f18
Show file tree
Hide file tree
Showing 11 changed files with 876 additions and 3,859 deletions.
5 changes: 1 addition & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ module.exports = function (grunt) {
},
rollup: {
options: {
plugins: [
require("@rollup/plugin-node-resolve").nodeResolve(),
require("@rollup/plugin-commonjs")()
]
plugins: [require("@rollup/plugin-node-resolve").nodeResolve(), require("@rollup/plugin-commonjs")()]
},
build_es: {
options: {
Expand Down
11 changes: 4 additions & 7 deletions demo_esm/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<title>Leaflet Locate Control ES Module Example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css"
/>
<!-- the module needs to resolve "leaflet" to the es module version of leaflet 1.9.4
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css" />
<!-- the module needs to resolve "leaflet" to the es module version of leaflet 1.9.4
use import maps, see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#importing_modules_using_import_maps -->
<script type="importmap">
{
Expand All @@ -23,6 +20,6 @@
<script type="module" src="script.js"></script>
</head>
<body>
<div id="map" style="width: 100%; height: 100vh;"></div>
<div id="map" style="width: 100%; height: 100vh"></div>
</body>
</html>
14 changes: 6 additions & 8 deletions demo_esm/script.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Map, TileLayer } from 'leaflet';
import { LocateControl } from '../dist/L.Control.Locate.esm.js';
import { Map, TileLayer } from "leaflet";
import { LocateControl } from "../dist/L.Control.Locate.esm.js";

const osmUrl = "https://tile.openstreetmap.org/{z}/{x}/{y}.png";
const osmAttrib = 'Map data © <a href="http://osm.org/copyright">OpenStreetMap</a> contributors';
Expand All @@ -15,10 +15,8 @@ let map = new Map("map", {
zoomControl: true
});


let lc = new LocateControl({
strings: {
title: "Show me where I am, yo!"
}
})
.addTo(map);
strings: {
title: "Show me where I am, yo!"
}
}).addTo(map);
2 changes: 1 addition & 1 deletion dist/L.Control.Locate.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/L.Control.Locate.mapbox.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/L.Control.Locate.mapbox.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/L.Control.Locate.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 20c6f18

Please sign in to comment.