Skip to content

Commit fa29846

Browse files
committed
version 0.0.1
0 parents  commit fa29846

18 files changed

+6109
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
npm-debug.log

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# leaflet-ui
2+
Leaflet maps bundle for common user interface customizations
3+
4+
_For a working example see [demo](https://raruto.github.io/examples/leaflet-ui/leaflet-ui.html)_
5+
6+
---
7+
8+
## How to use
9+
10+
1. **include CSS & JavaScript**
11+
```html
12+
<head>
13+
...
14+
<style> html, body, #map { height: 100%; width: 100%; padding: 0; margin: 0; } </style>
15+
<!-- Leaflet (JS/CSS) -->
16+
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css">
17+
<script src="https://unpkg.com/leaflet@1.3.4/dist/leaflet.js"></script>
18+
<!-- Leaflet-UI -->
19+
<link rel="stylesheet" href="https://unpkg.com/leaflet-ui@latest/dist/leaflet-ui.css">
20+
<script src="https://unpkg.com/leaflet-ui@latest/dist/leaflet-ui.js"></script>
21+
...
22+
</head>
23+
```
24+
2. **choose a div container used for the slippy map**
25+
```html
26+
<body>
27+
...
28+
<div id="map"></div>
29+
...
30+
</body>
31+
```
32+
3. **create your first simple “leaflet-ui” slippy map**
33+
```html
34+
<script>
35+
var map = L.map('map', {
36+
center: [41.4583, 12.7059],
37+
zoom: 5,
38+
// Optional customizations
39+
mapTypeId: 'topo',
40+
mapTypeIds: ['osm', 'terrain', 'satellite', 'topo'],
41+
gestureHandling: true,
42+
zoomControl: true,
43+
pegmanControl: true,
44+
locateControl: true,
45+
fullscreenControl: true,
46+
layersControl: true,
47+
disableDefaultUI: false,
48+
});
49+
map.once('idle',function(){ /* Waiting for map init */});
50+
</script>
51+
```
52+
53+
---
54+
55+
**Compatibile with:** leaflet@1.3.4
56+
57+
---
58+
59+
**Contributors:** [Raruto](https://github.com/Raruto/leaflet-ui)

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-slate

build/rollup.config.js

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import {
2+
terser
3+
} from "rollup-plugin-terser";
4+
import resolve from 'rollup-plugin-node-resolve';
5+
import commonJS from 'rollup-plugin-commonjs';
6+
import postcss from 'rollup-plugin-postcss';
7+
import postcssImport from 'postcss-import';
8+
import postcssCopy from 'postcss-copy';
9+
10+
let plugin = require('../package.json');
11+
12+
let input = plugin.module;
13+
let output = {
14+
file: "dist/" + plugin.name + "-src.js",
15+
format: "umd",
16+
sourcemap: true,
17+
name: plugin.name,
18+
// globals: {
19+
// 'jszip': 'JSZip',
20+
// 'geojson-vt': 'geojsonvt',
21+
// '@tmcw/togeojson': 'toGeoJSON',
22+
// }
23+
};
24+
25+
// let external = ['jszip', 'geojson-vt', '@tmcw/togeojson', 'leaflet-pointable'];
26+
let plugins = [
27+
resolve(),
28+
commonJS({
29+
include: '../node_modules/**'
30+
})
31+
];
32+
33+
export default [{
34+
input: input,
35+
output: output,
36+
plugins: plugins,
37+
// external: external,
38+
},
39+
{
40+
input: input,
41+
output: Object.assign({}, output, {
42+
file: "dist/" + plugin.name + ".js"
43+
}),
44+
plugins: plugins.concat(terser()),
45+
// external: external
46+
},
47+
{
48+
input: 'src/leaflet-ui.css',
49+
output: {
50+
file: 'dist/leaflet-ui.css',
51+
format: 'es'
52+
},
53+
plugins: [
54+
postcss({
55+
extract: true,
56+
inject: false,
57+
minimize: true,
58+
plugins: [
59+
postcssImport({}),
60+
postcssCopy({
61+
basePath: 'node_modules',
62+
dest: "dist",
63+
template: "images/[path][name].[ext]",
64+
})
65+
// postcss_url(),
66+
// postcss_url({
67+
// url: "copy",
68+
// basePath: path.resolve("."),
69+
// assetPath: "resources"
70+
// })
71+
]
72+
})
73+
]
74+
},
75+
];
48.2 KB
Loading
2.43 KB
Loading
4.6 KB
Loading
215 Bytes
Loading
139 Bytes
Loading

0 commit comments

Comments
 (0)