3.3.4 • Published 6 months ago

versatiles-styles v3.3.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

VersaTiles Styles

Programatically generates Shortbread StyleJSON for MapLibre.

Example: Colorful Style

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

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
3.3.1

6 months ago

3.3.0

6 months ago

3.2.1

7 months ago

3.2.0

7 months ago

3.1.0

7 months ago

3.3.4

6 months ago

3.3.3

6 months ago

3.3.2

6 months ago

3.0.0

7 months ago