Skip to content

Commit 89f8e41

Browse files
committed
...
1 parent e7b2441 commit 89f8e41

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

vignettes/ext_mapgl.Rmd

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ tmap_options(scale = 0.75)
4646

4747
There are two modes included in **tmap**: `"plot"` for static mapping and `"view"` for interactive mapping. See [introduction](https://r-tmap.github.io/tmap/articles/basics_modes). The `"view"` mode uses the JavaScript library Leaflet as backend.
4848

49-
The extension package [**tmap.mapgl**](https://r-tmap.github.io/tmap.mapgl/) offers two new modes which are also interactive: `"mapbox"` and `"maplibre"` which use the JavaScript libraries Mapbox GL and Maplibre GL respectively. An API key is required to use `"mapbox"` (free for personal use), but `"maplibre"` is (as the name suggests) free for any use.
49+
The extension package [**tmap.mapgl**](https://r-tmap.github.io/tmap.mapgl/) offers two new modes which are also interactive: `"mapbox"` and `"maplibre"` which use the JavaScript libraries Mapbox GL and Maplibre GL respectively. The latter is a open source fork of the former before it went from open to closed source.
50+
51+
An API key is required to use `"mapbox"` (free for personal use, see [instructions](https://r-tmap.github.io/tmap.mapgl/articles/mapbox#getting-and-using-the-api-key)), but `"maplibre"` is (as the name suggests) free for any use.
52+
5053

5154
Note that *tmap.mapgl* is a bridge between the R packages *mapgl* and *tmap*. It makes the functionality of *mapgl* (making the JavaScript libraries available to R) also available via the *tmap* user interface.
5255

@@ -64,26 +67,27 @@ tmap_mode("plot")
6467
map
6568
```
6669

70+
## maplibre
71+
72+
```{r, fig.height = 5.5}
73+
library(tmap.mapgl)
74+
tmap_mode("maplibre")
75+
map
76+
```
77+
78+
79+
6780
## mapbox
6881

6982
For `"mapbox"` an API key is required, which is free for personal use. See [instructions](https://r-tmap.github.io/tmap.mapgl/articles/mapbox#getting-and-using-the-api-key).
7083

71-
7284
```{r, fig.height = 3.5, eval=FALSE}
73-
library(tmap.mapgl)
7485
tmap_mode("mapbox")
7586
map
7687
```
7788

7889
![tmap mapbox mode](https://r-tmap.github.io/tmap.mapgl/reference/figures/mapbox_well_being.jpg)
7990

80-
## maplibre
81-
82-
```{r, fig.height = 3.5}
83-
tmap_mode("maplibre")
84-
map
85-
```
86-
8791

8892
## 3d polygons
8993

@@ -101,7 +105,9 @@ tm_shape(NLD_dist) +
101105
tm_polygons_3d(height = "pop_dens",
102106
fill = "edu_appl_sci",
103107
fill.scale = tm_scale_intervals(style = "kmeans", values = "-pu_gn"),
104-
fill.legend = tm_legend("Univeristy degree")) +
108+
fill.legend = tm_legend("Univeristy degree"),
109+
options = opt_tm_polygons_3d(height.min = "0.1%")) +
105110
tm_maplibre(pitch = 45)
106111
```
107112

113+
Note: the minimal height is needed to fix an artefact when using the globe projection (icon on the top right).

0 commit comments

Comments
 (0)