Reputation: 6534
I'm trying to make a map using {ggmap} and Stamen maps. The map needs to span the antimeridian at 180° longitude. Specifically, I want the map to extend from -190° to -60° longitude.
This is roughly the map that I want, so it's definitely possible using Stamen maps.
However, when I try to retrieve the tiles for this using get_stamenmap()
I get multiple HTTP 503 errors ("Failed to aquire tile") for tiles that lie on the "other" side of the antimeridian.
library(ggmap)
map <- get_stamenmap(
bbox = c(
left = -190.0,
right = -60.0,
top = -35.0,
bottom = -70.0),
zoom = 3
)
ggmap(map)
This is what the resulting map looks like (note the missing tiles on the left side of the map).
I have similar issues when I add 360° to both the left
and right
extremes, only the missing tiles are then on the right side of the map.
It makes sense that the bounding box for these maps is constrained to lie between -180° and 180° of longitude, however, surely there must be a workaround to cater for maps which straddle the antimeridian?
Thanks, Andrew.
As an aside, it's possible to do this using Google Maps but I don't want to be encumbered with having to provide a Google API key since this is going to be presented as an exercise at a workshop.
get_googlemap(center = c(lon = -135, lat = -40), zoom = 2)
Upvotes: 2
Views: 187