basemapkit 0.4.0 → 0.5.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "basemapkit",
3
3
  "private": false,
4
- "version": "0.4.0",
4
+ "version": "0.5.0",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
package/readme.md CHANGED
@@ -2,7 +2,10 @@
2
2
  <img src="./public/logo.svg" alt="Basemapkit logo" width="400px"></img>
3
3
  </p>
4
4
  <p align="center">
5
- Basemaps for <a href="https://maplibre.org/maplibre-gl-js/docs/">Maplibre GL JS</a> + <a href="https://protomaps.com/">Protomaps</a>
5
+ Basemaps for the people!</a>
6
+ </p>
7
+ <p align="center">
8
+ Compatible with <a href="https://maplibre.org/maplibre-gl-js/docs/">Maplibre GL JS</a> + <a href="https://protomaps.com/">Protomaps</a>
6
9
  </p>
7
10
 
8
11
  <p align="center">
@@ -246,7 +249,22 @@ getStyle(
246
249
 
247
250
  Note that the corresponding layers are removed from the style and not just made invisible. If hiding POIs or label, the options `sprite` and `glyph` are unnecessary.
248
251
 
249
- ## Getting creative with `buildStyle()`
252
+ ## Globe or Mercator projection 🌐
253
+ By default, the styles available in basempkit are all showing Earth as a globe, but Mercator projection can still be used. use
254
+ The option `globe` (boolean) can be set to `false` in the functions `getStyle()` and `buildStyle()`. Just like that:
255
+
256
+ ```ts
257
+ getStyle(
258
+ "avenue",
259
+ {
260
+ pmtiles: "...",
261
+ sprite: "...",
262
+ glyphs: "...",
263
+ globe: false,
264
+ });
265
+ ```
266
+
267
+ ## Getting creative with `buildStyle()` 🎨
250
268
  In addition to language and hiding POIs/labels, Basmapkit exposes some methods to modify the colors of the original style (`avenue`) to create *presets*. When the style is generated with some non-default `colorEdit`, a brand new Maplibre style is created and can be directly injected into a Maplibre `Map` instance's `.setStyle()` method, or even written as a static json file.
251
269
 
252
270
  ```ts
@@ -348,7 +366,7 @@ And here is the result:
348
366
  You can live play with these on [basemapkit.jnth.io](https://s.jnth.io/s/basemapkit) and selecting the style `🖌️ custom 🎨`.
349
367
  And from this "color editor" were created the built-in styles available below...
350
368
 
351
- ## Available styles
369
+ ## Available styles 📚
352
370
  So far, we mentioned only the **Avenue** style as it's the first and default one, but there are many others! And while **Avenue** takes pride in being a rich yet generalistic style, Basemapkit provides styles that are better suited for **data visualization**, that are minimalistic and leaves room to your own data. And all the styles come with extra *presets*, meaning variants, playing with color and contrasts, but more on this in the next section.
353
371
 
354
372
  ### Base style: `avenue`
@@ -529,7 +547,7 @@ Spectre comes with many extra presets, mostly to change the hue of the coastline
529
547
  - `spectre-negative-yellow`
530
548
  ![](./public/screenshots/spectre-16.jpg)
531
549
 
532
- # Extra API
550
+ # Extra API 🪄
533
551
  The extra API goes beyond just providing style, yet, it's still minimal and only related to "obtain a style as one need it".
534
552
 
535
553
  ## Swapping two layers