Skip to contents

Works with layer_show_context

Usage

make_inset_map(
  map = NULL,
  inset = NULL,
  location = NULL,
  context = NULL,
  position = "bottomright",
  scale = 1,
  nudge_x = 0,
  nudge_y = 0,
  ...
)

Arguments

map

plot or map created with ggplot2

inset

plot or map created with ggplot2

location

sf or bbox object

context

sf or bbox object with location context, Default: NULL

position

inset map position, Default: 'bottomright'

nudge_x

nudge X position of inset map, Default: 0

nudge_y

nudge Y position of inset map, Default: 0

...

Additional parameters passed to layer_show_context

Value

ggplot2 with inset map added using patchwork

Examples

if (FALSE) {
if (interactive()) {
  map <-
    ggplot2::ggplot() +
    overedge::layer_location_data(data = mapbaltimore::get_area("neighborhood", "Harwood")) +
    overedge::layer_neatline(
      data = mapbaltimore::get_area("neighborhood", "Harwood"),
      asp = "8.5:11"
    )

  location <-
    mapbaltimore::get_area("neighborhood", "Harwood")

  context <-
    mapbaltimore::baltimore_city

  inset_context_map(
    map = map,
    location = location,
    context = context,
    position = "bottomright",
    nudge_x = -0.05,
    nudge_y = 0.05
  )
}
}