Skip to main content

Module basemap

Module basemap 

Source
Expand description

Basemap: a map view to render, the Rust counterpart of R’s basemap() and Python’s basemapper.basemap() / Basemap.

The same verbs exist in all three languages: R verb(m, ...), Python m.verb(...), Rust m.verb(...):

TaskRust
createBasemap::new(style) + .size(), .center(), .zoom(), .bounds(), .pixel_ratio(), …
change the viewset_view(center, zoom), set_bounds(bounds, crs)
read the viewget_bounds(lonlat), get_center(), get_zoom(), get_size()
renderrender_array(), render_png(path), render_svg(path, options)

Structs§

Basemap
A map view: one style, or several stacked bottom to top, a size in CSS pixels, a centre and MapLibre zoom (512 px tiles, fractional allowed), and a device pixel ratio (images are pixel_ratio times larger with the same view and label layout).

Enums§

Crs
Coordinate reference system of bounds given to Basemap::set_bounds: the core reads longitude/latitude and Web Mercator (R and Python reproject other CRSs before calling it).