Skip to content

Releases: Rimagination/ggmapcn

v0.2.0

10 Oct 08:51

Choose a tag to compare

ggmapcn 0.2.0

New features

  • annotation_compass(): Compass (grid north or true north). Works with coord_sf() or by injecting CRS via layer$geom_params$crs. Supports grob styles/functions (e.g., north_arrow_classic(), compass_sinan()).
  • annotation_scalebar(): Projection-aware scale bar with styles "segment", "ticks", "bar". Auto sizing and unit promotion (metric/imperial). Geographic CRS support via geographic_mode = "approx_m" | "degrees".
  • Compass style set (exported): north_arrow_classic(), north_arrow_solid(), compass_rose_simple(), compass_rose_classic(), compass_rose_circle(), compass_guiding_fish(), compass_sinan().
  • check_geodata(): Mirror-first downloads (jsDelivr → GitHub), pre-checks local files (local_dirs → package extdata → user cache), atomic writes, resume, retries, optional SHA-256.

Enhancements

  • geom_boundary_cn() now consumes check_geodata() paths, transforms to user crs, and injects CRS into compass/scale layers in “easy mode”.
  • Safer CRS handling in annotations (no %||%; explicit null checks). Defensive guards against zero-width panels.
  • Smarter labels/ticks for "segment" scale bar (segments, label_show, minor_tick_height).

Bug fixes

  • Prevent “zero-length unit” errors on degenerate panels.
  • Remove reliance on undefined %||% helper.
  • Consistent behavior in geographic CRS; clear warning in approximate mode.

Breaking/behavior changes

  • In geographic CRS, annotation_scalebar() defaults to geographic_mode = "approx_m" and warns about approximation. Use geographic_mode = "degrees" to display degrees.
  • Some internal helpers are now unexported (@noRd) but remain available internally.

Dependencies

  • Imports: add digest, grid; set curl (>= 5.0.0).

v0.0.2

25 Nov 03:13

Choose a tag to compare

New Features

  • Added the basemap_dem() function for visualizing elevation data with customizable projections.
  • Added the basemap_vege() function for visualizing vegetation data of China with customizable projections.
  • Added the geom_world() function for visualizing global administrative divisions.
  • Added the coord_proj() function, based on coord_sf, which limits the plotting area to the specified range after projection, without altering the underlying data.

Bug Fixes

Replaced size with linewidth to align with the latest standards of ggplot2.

Enhancements

Improved styling options for various boundaries in geom_boundary_cn().

Initial Release

14 Nov 10:14

Choose a tag to compare

This is the first release of the ggmapcn package, an R extension for plotting China maps using ggplot2.
Key features include:

  • Easy mapping of China’s provincial boundaries.
  • Built-in data files for provincial and national boundaries.
  • Integrated support for vegetation type raster data for China.