basemaps icon indicating copy to clipboard operation
basemaps copied to clipboard

examples on protomaps.com for MapLibre usage

Open bdon opened this issue 4 years ago • 1 comments

  • MapLibre global example with key
  • MapLibre + PMTiles example
  • Deck.GL + Kepler.GL integration

bdon avatar Jun 09 '21 05:06 bdon

Thinking out loud:

protomaps-themes-base

  • It would be generally useful to have a set of basemap styles that is shared among both the protomaps.js canvas renderer and the GL renderer.
  • The protomaps.js canvas render should be able to read the JSON styles as demonstrated in this example. There is a lot of work to do to make it able to parse a majority of the spec.
  • The rendering will be similar but not close to 1:1 perfect between the canvas and GL renderers, because 1) the canvas renderer is not mature and 2) what is cartographically possible is limited by doing everything on UI thread
  • To that end, I have fleshed out six map styles - Light, Dark, White, Black, Grayscale and Debug - that are defined in this repo under base/ and published on NPM at protomaps-themes-base. These are the "house styles" and can be used by script includes or ES6.
  • If you want to take the JSON and use them in an editor like Maputnik or Fresco, here is a JSON style generator:

https://protomaps.github.io/protomaps-themes/base/

protomaps-themes-extra

  • This repo also contains a directory and npm package called protomaps-themes-extra.
  • These are written using protomaps.js symbolizers and are not designed for GL
  • They may be open source map styles with different licensing requirements than protomaps-themes-base e.g. attribution
  • Right now there is only a port of Stamen's Toner style

Map Comparison UI

To be able to view all of the base and extra styles I cooked up a page that lets you see any two styles side by side:

https://protomaps.github.io/protomaps-themes/#13/51.5050/-0.0900

bdon avatar Jun 11 '21 13:06 bdon