Skip to contents

tmap.mapgl also features a new layer type, tm_polygons_3d, which is only available for "mapbox" and "maplibre".

This map layer is the same as tm_polygons, but one addition: polygons can be extruded in 3d shape. The visual variable to control this is called height.

Example

tmap_mode("maplibre")
#>  tmap mode set to "maplibre".

NLD_dist$pop_dens = NLD_dist$population / NLD_dist$area

tm_shape(NLD_dist) +
  tm_polygons_3d(height = "pop_dens",
    fill = "edu_appl_sci",
    fill.scale = tm_scale_intervals(style = "kmeans", values = "-pu_gn"),
    fill.legend = tm_legend("Univeristy degree")) +
tm_maplibre(pitch = 45)
#> No legends available in mode "maplibre" for map variables
#> "height"