3.3.4 • Published 6 months ago
versatiles-styles v3.3.4
VersaTiles Styles
Programatically generates Shortbread StyleJSON for MapLibre.
Styles
- Colorful - colorful, full featured map
- Neutrino - light basemap
- Graybeard - gray basemap
Download
You can download the latest StyleJSONs from the latest release. We provide each style with and without labels, and also in multiple languages.
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.
as Node.js module
Install versatiles-styles
via NPM:
npm install versatiles-styles
Use it in Node.js:
import { colorful } from 'versatiles-styles';
let style = colorful({language:'de'});
writeFileSync('style.json', JSON.stringify(style));
in a web browser
Download latest release:
wget "https://github.com/versatiles-org/versatiles-styles/releases/latest/download/versatiles-styles.js"
Use it in:
<div id="map"></div>
<script src="maplibre-gl.js"></script>
<script src="versatiles-styles.js"></script>
<script>
const baseUrl = new URL('/', window.location.href).href;
const map = new maplibregl.Map({
container: 'map',
style: versatiles_styles.colorful({
glyphsUrl: baseUrl + 'fonts/{fontstack}/{range}.pbf',
spriteUrl: baseUrl + 'sprites/sprites',
tilesUrl: [baseUrl + 'tiles/{z}/{x}/{y}'],
})
});
<script>
Generate styles
npm run build
Add/edit styles
- style definitions in
src/styles/*.js
- shortbread layer definition in
src/lib/shortbread_layers.js
- style template in
src/lib/shortbread_template.json
Licenses
- Code: Unlicense
- Styles: CC0 1.0 Universal
todo
- convert 'in' to '==' if only one element
- outlines for roads, buildings, boundaries
- :en labels
- links under other roads, sort by size
- waterway width
- rail colorscheme
- bridge semitransparent
- cycleways and bicycle-roads
- trams
- rail zooms 17+
- minor rails
- more sites and landcovers
- airports
- pois
- sprites and patterns, revisit sprites
- public transport signage
- road signage
- labels for rivers, islands, places
- aggregate layers with same filters and style for smaller result