You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: playground/simple-map/text.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,8 +11,8 @@ description: How to add a simple OSM map.
11
11
In our example, we load these assets from our demo server at `https://tiles.versatiles.org`, but you can modify all URLs as needed.
12
12
13
13
> [!WARNING]
14
-
> You might want to include libraries such as MapLibre GL JS directly in your project and serve them yourself instead of loading them from tiles.versatiles.org. We regularly update front-end libraries on our demo server. However, this could introduce breaking changes to your project at some point in the future.
14
+
> You might want to include libraries such as MapLibre GL JS directly in your project and serve them yourself instead of loading them from tiles.versatiles.org. We regularly update frontend libraries on our demo server. However, this could introduce breaking changes to your project at some point in the future.
15
15
16
-
Loading the MapLibre libraries adds the global `maplibregl` variable to the JavaScript environment. Use `new maplibregl.Map()` to initialise your map.
16
+
Loading the MapLibre library adds the global `maplibregl` variable to the JavaScript environment. Use `new maplibregl.Map()` to initialise your map.
17
17
18
-
To learn more about all the options provided by MapLibre, take a look at the documentation for the [Map class documentation](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/) and in general the [MapLibre API documentation](https://maplibre.org/maplibre-gl-js/docs/API/).
18
+
To learn more about all the options provided by MapLibre, take a look at the documentation for the [Map class documentation](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/) and in general the [MapLibre API documentation](https://maplibre.org/maplibre-gl-js/docs/API/). We can also highly recommend all the [MapLibre examples](https://maplibre.org/maplibre-gl-js/docs/examples/).
Copy file name to clipboardExpand all lines: playground/simple-style/text.md
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,9 @@ title: Simple Style
3
3
description: How to style a simple OSM map.
4
4
---
5
5
6
-
[MapLibre GL JS](https://maplibre.org/maplibre-gl-js/docs/) use styles to define your map. These styles are quite complex JavaScript objects that define data sources, layers, colors, fonts, symbols, etc. (If you later want to really fine tune your map you can find the complete specification here: [MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/)) To make it easier to work with map styles, we've developed a [JavaScript library "versatiles-style"](https://github.com/versatiles-org/versatiles-style) to generate styles very fast and efficient in the frontend or the backend.
6
+
[MapLibre GL JS](https://maplibre.org/maplibre-gl-js/docs/) use special `style` objects that define the appearance of your map. These `style` object are quite complex JavaScript objects that define data sources, layers, colors, fonts, symbols, etc. (If you later want to really fine tune your map you can find the complete specification here: [MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/))
7
+
8
+
To make it easier to work with these map styles, we've developed the [JavaScript library "versatiles-style"](https://github.com/versatiles-org/versatiles-style) to generate styles very fast and efficient in the frontend or the backend.
7
9
8
10
Based on our [frontend specification](https://docs.versatiles.org/compendium/specification_frontend.html), the library should be ready to use under:
9
11
@@ -12,21 +14,22 @@ Based on our [frontend specification](https://docs.versatiles.org/compendium/spe
12
14
Loading our library adds the global variable `VersaTilesStyle` to the JavaScript environment. To generate a style ready to use simply run:
13
15
14
16
```javascript
15
-
conststyle=VersaTilesStyle.colorful();
17
+
conststyle=VersaTilesStyle.colorful(); // <- generates a style
18
+
16
19
newmaplibregl.Map({
17
-
style // <- use the generated style
20
+
style // <- use the style
18
21
container:"map",
19
22
})
20
23
```
21
24
22
25
We also provide other functions to generate base styles, like `colorful`, `eclipse`, `graybeard` and `neutrino`.
23
26
24
-
All these style functions accept optional properties to adapt the styles, like:
27
+
All these style functions accept optional properties to fine tune the styles, like:
25
28
26
29
```javascript
27
30
{
28
-
baseUrl: string; // host of the map server, like "https://example.org"
29
-
bounds: [number, number, number, number]; //bbox of the initial view
31
+
baseUrl: string; // host of your map server, like "https://example.org"
32
+
bounds: [number, number, number, number]; //bounding box of the initial view
30
33
colors: Partial<StyleBuilderColors>; // to change individual colors
31
34
fonts: Partial<StyleBuilderFonts>; // to change the default fonts
32
35
glyphs: string; // to change the url template of the fonts
@@ -38,7 +41,7 @@ All these style functions accept optional properties to adapt the styles, like:
38
41
}
39
42
```
40
43
41
-
So for example, the following code will generate a style without labels and tint it green to make it look like "Matrix" so people from the 90's will think your map looks cool.
44
+
For example, the following code will generate a map style without labels and tint it green, making it look like the 'Matrix', which will make people from the '90s think your map looks cool.
42
45
43
46
```javascript
44
47
conststyle=VersaTilesStyle.colorful({
@@ -58,7 +61,7 @@ To learn more about all the options provided by "versatiles-style", take a look
58
61
-[StyleBuilderColors](https://versatiles.org/versatiles-style/interfaces/StyleBuilderColors.html) for the property `colors` to change individual colors.
59
62
60
63
> [!NOTE]\
61
-
> ["versatiles-style"](https://github.com/versatiles-org/versatiles-style) helped us a lot to make it easier to work with map styles. That is way we plan to completely revamp the whole library in 2025.
64
+
> ["versatiles-style"](https://github.com/versatiles-org/versatiles-style) helped us a lot in making it easier to work with map styles. However, many features are missing. That is why we plan to completely revamp the entire library in 2025.
62
65
63
66
> [!WARNING]
64
-
> You might want to include libraries directly in your project and serve them yourself instead of loading them from tiles.versatiles.org. We regularly update front-end libraries on our demo server. However, this could introduce breaking changes to your project at some point in the future.
67
+
> Instead of loading the libraries from tiles.versatiles.org, we recommend including them directly in your project and hosting them yourself. Since we regularly update the front-end libraries on our demo server, future updates may affect your project.
0 commit comments