How to get a map in the range of latitude and longitude?

How to get a map with certain minimum and maximum limits of latitude and longitude using ggmap in R?

I am new to using ggmap and now I was able to implement this:

center <- c(mean(src$longitude),mean(src$latitude)) zoom <- min(MaxZoom(range(src$latitude),range(src$longitude))) hdf <- get_map(location=center,zoom=zoom) 

The help file says that the location can be referred to as an address, a longitude / latitude pair (in that order), or a left / lower / right / top bounding box. I could not find useful material on implementing the restrictive framework for ggmap online.

+4
source share
1 answer

I'm not sure if you can do this at the boot stage, but what about at the build stage:

 map <- get_map() p1 <- ggmap( map ) p2 <- ggmap( map )+ scale_x_continuous( limits = c( -95.5 , -95.3 ) , expand = c( 0 , 0 ) )+ scale_y_continuous( limits = c( 29.6 , 29.8 ) , expand = c( 0 , 0 ) ) require( gridExtra ) grid.arrange( p1 , p2 , nrow = 1 ) 

enter image description here

+8
source

Source: https://habr.com/ru/post/1493288/


All Articles