@versatiles/style 3.4.1 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.MD +13 -10
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/lib/decorator.test.js +0 -1
- package/dist/lib/shortbread/layers.js +0 -1
- package/dist/lib/style_builder.js +0 -1
- package/dist/lib/style_builder.test.js +0 -1
- package/dist/{styles → style}/graybeard.js +0 -1
- package/package.json +15 -13
- /package/dist/{styles → style}/colorful.d.ts +0 -0
- /package/dist/{styles → style}/colorful.js +0 -0
- /package/dist/{styles → style}/graybeard.d.ts +0 -0
- /package/dist/{styles → style}/neutrino.d.ts +0 -0
- /package/dist/{styles → style}/neutrino.js +0 -0
package/README.MD
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
[](https://codecov.io/gh/versatiles-org/versatiles-style)
|
|
2
|
+
[](https://github.com/versatiles-org/versatiles-style/actions/workflows/ci.yml)
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
# VersaTiles Style
|
|
5
|
+
|
|
6
|
+
Programatically generates StyleJSON for MapLibre.
|
|
4
7
|
|
|
5
8
|

|
|
6
9
|
|
|
@@ -12,21 +15,21 @@ Programatically generates Shortbread StyleJSON for MapLibre.
|
|
|
12
15
|
|
|
13
16
|
## Download
|
|
14
17
|
|
|
15
|
-
You can download the latest StyleJSONs from the [latest release](https://github.com/versatiles-org/versatiles-
|
|
18
|
+
You can download the latest StyleJSONs from the [latest release](https://github.com/versatiles-org/versatiles-style/releases/latest/).
|
|
16
19
|
We provide each style with and without labels, and also in multiple languages.
|
|
17
20
|
|
|
18
21
|
Be aware that styles already include `tiles.versatiles.org` as source for tiles, fonts (glyphs) and icons (sprites). So you might want to update the URLs in the JSON.
|
|
19
22
|
|
|
20
23
|
## as Node.js module
|
|
21
24
|
|
|
22
|
-
Install `versatiles-
|
|
25
|
+
Install `versatiles-style` via NPM:
|
|
23
26
|
```bash
|
|
24
|
-
npm install versatiles-
|
|
27
|
+
npm install versatiles-style
|
|
25
28
|
```
|
|
26
29
|
|
|
27
30
|
Use it in Node.js:
|
|
28
31
|
```javascript
|
|
29
|
-
import { colorful } from 'versatiles-
|
|
32
|
+
import { colorful } from 'versatiles-style';
|
|
30
33
|
let style = colorful({language:'de'});
|
|
31
34
|
writeFileSync('style.json', JSON.stringify(style));
|
|
32
35
|
```
|
|
@@ -35,19 +38,19 @@ writeFileSync('style.json', JSON.stringify(style));
|
|
|
35
38
|
|
|
36
39
|
Download latest release:
|
|
37
40
|
```bash
|
|
38
|
-
wget "https://github.com/versatiles-org/versatiles-
|
|
41
|
+
wget "https://github.com/versatiles-org/versatiles-style/releases/latest/download/versatiles-style.js"
|
|
39
42
|
```
|
|
40
43
|
|
|
41
44
|
Use it in:
|
|
42
45
|
```html
|
|
43
46
|
<div id="map"></div>
|
|
44
47
|
<script src="maplibre-gl.js"></script>
|
|
45
|
-
<script src="versatiles-
|
|
48
|
+
<script src="versatiles-style.js"></script>
|
|
46
49
|
<script>
|
|
47
50
|
const baseUrl = new URL('/', window.location.href).href;
|
|
48
51
|
const map = new maplibregl.Map({
|
|
49
52
|
container: 'map',
|
|
50
|
-
style:
|
|
53
|
+
style: versatiles_style.colorful({
|
|
51
54
|
glyphsUrl: baseUrl + 'fonts/{fontstack}/{range}.pbf',
|
|
52
55
|
spriteUrl: baseUrl + 'sprites/sprites',
|
|
53
56
|
tilesUrl: [baseUrl + 'tiles/{z}/{x}/{y}'],
|
|
@@ -62,7 +65,7 @@ Use it in:
|
|
|
62
65
|
|
|
63
66
|
## Add/edit styles
|
|
64
67
|
|
|
65
|
-
* style definitions in `src/
|
|
68
|
+
* style definitions in `src/style/*.js`
|
|
66
69
|
* shortbread layer definition in `src/lib/shortbread_layers.js`
|
|
67
70
|
* style template in `src/lib/shortbread_template.json`
|
|
68
71
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { MaplibreStyle } from './lib/style_builder.js';
|
|
2
|
-
export { default as Colorful } from './
|
|
3
|
-
export { default as Graybeard } from './
|
|
4
|
-
export { default as Neutrino } from './
|
|
2
|
+
export { default as Colorful } from './style/colorful.js';
|
|
3
|
+
export { default as Graybeard } from './style/graybeard.js';
|
|
4
|
+
export { default as Neutrino } from './style/neutrino.js';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as Colorful } from './
|
|
2
|
-
export { default as Graybeard } from './
|
|
3
|
-
export { default as Neutrino } from './
|
|
1
|
+
export { default as Colorful } from './style/colorful.js';
|
|
2
|
+
export { default as Graybeard } from './style/graybeard.js';
|
|
3
|
+
export { default as Neutrino } from './style/neutrino.js';
|
|
@@ -108,7 +108,6 @@ export default function getLayers(option) {
|
|
|
108
108
|
},
|
|
109
109
|
// tunnel-, street-, bridges-bridge
|
|
110
110
|
...['tunnel', 'street', 'bridge'].flatMap((c) => {
|
|
111
|
-
// eslint-disable-next-line @typescript-eslint/init-declarations
|
|
112
111
|
let filter, prefix;
|
|
113
112
|
const results = [];
|
|
114
113
|
switch (c) {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versatiles/style",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"description": "Generate StyleJSON for MapLibre",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"
|
|
8
|
+
"check": "npm run lint && npm run build && npm run test",
|
|
9
9
|
"build": "npm run build-browser && npm run build-node && npm run build-styles",
|
|
10
10
|
"build-browser": "rollup -c=rollup.config.js",
|
|
11
11
|
"build-node": "rm -rf dist && tsc -p tsconfig.node.json",
|
|
@@ -15,18 +15,19 @@
|
|
|
15
15
|
"test": "npm run test-node && npm run test-coverage && npm run test-browser",
|
|
16
16
|
"test-browser": "npm run build-browser && echo 'add browser test'",
|
|
17
17
|
"test-coverage": "NODE_OPTIONS=--experimental-vm-modules jest -c=jest.config.coverage.ts",
|
|
18
|
-
"test-node": "npm run build-node && NODE_OPTIONS=--experimental-vm-modules jest -c=jest.config.node.ts"
|
|
18
|
+
"test-node": "npm run build-node && NODE_OPTIONS=--experimental-vm-modules jest -c=jest.config.node.ts",
|
|
19
|
+
"upgrade": "npm-check-updates -u && rm -f package-lock.json && rm -rf node_modules; npm i"
|
|
19
20
|
},
|
|
20
21
|
"repository": {
|
|
21
22
|
"type": "git",
|
|
22
|
-
"url": "git+https://github.com/versatiles-org/versatiles-
|
|
23
|
+
"url": "git+https://github.com/versatiles-org/versatiles-style.git"
|
|
23
24
|
},
|
|
24
25
|
"author": "yetzt <versatiles@yetzt.me>, Michael Kreil <versatiles@michael-kreil.de>",
|
|
25
26
|
"license": "MIT",
|
|
26
27
|
"type": "module",
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@types/color": "^3.0.
|
|
29
|
-
"@types/mapbox-gl": "^2.7.
|
|
29
|
+
"@types/color": "^3.0.6",
|
|
30
|
+
"@types/mapbox-gl": "^2.7.18",
|
|
30
31
|
"brace-expansion": "^3.0.0",
|
|
31
32
|
"color": "^4.2.3"
|
|
32
33
|
},
|
|
@@ -40,21 +41,22 @@
|
|
|
40
41
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
41
42
|
"@rollup/plugin-terser": "^0.4.4",
|
|
42
43
|
"@rollup/plugin-typescript": "^11.1.5",
|
|
43
|
-
"@types/brace-expansion": "^1.1.
|
|
44
|
-
"@types/inquirer": "^9.0.
|
|
45
|
-
"@types/jest": "^29.5.
|
|
46
|
-
"@types/node": "^20.
|
|
44
|
+
"@types/brace-expansion": "^1.1.2",
|
|
45
|
+
"@types/inquirer": "^9.0.7",
|
|
46
|
+
"@types/jest": "^29.5.8",
|
|
47
|
+
"@types/node": "^20.9.0",
|
|
47
48
|
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
|
48
49
|
"@typescript-eslint/parser": "^6.10.0",
|
|
49
50
|
"eslint": "^8.53.0",
|
|
50
|
-
"inquirer": "^9.2.
|
|
51
|
+
"inquirer": "^9.2.12",
|
|
51
52
|
"jest": "^29.7.0",
|
|
52
53
|
"jest-ts-webcompat-resolver": "^1.0.0",
|
|
53
|
-
"
|
|
54
|
+
"npm-check-updates": "^16.14.6",
|
|
55
|
+
"rollup": "^4.3.1",
|
|
54
56
|
"rollup-plugin-dts": "^6.1.0",
|
|
55
57
|
"ts-jest": "^29.1.1",
|
|
56
58
|
"ts-node": "^10.9.1",
|
|
57
|
-
"tsx": "^
|
|
59
|
+
"tsx": "^4.1.1",
|
|
58
60
|
"typescript": "^5.2.2"
|
|
59
61
|
}
|
|
60
62
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|