Draw time radius around lat/long on map

前端 未结 2 1231
梦毁少年i
梦毁少年i 2021-01-15 11:18

I am working with the gmapsdistance package in R. I have my API key, and I am familiar with the functions within the package.

However, I would like to w

2条回答
  •  隐瞒了意图╮
    2021-01-15 12:15

    If you want to render in leaflet and use a free isochrone service, this is a pretty neat option. There is a limit of 2 hours drive away though.

    devtools::install_github("tarakc02/rmapzen")
    library(rmapzen)
    Sys.setenv(MAPZEN_KEY = "") # get for free at https://mapzen.com/
    
    marimar <- mz_geocode("Marimar, FL")
    isos <- mz_isochrone(
      marimar,
      costing_model = mz_costing$auto(),
      contours = mz_contours(c(60 * 2))  # 2 hours 
    )
    
    library(leaflet)
    leaflet(as_sp(isos)) %>%
      addProviderTiles("CartoDB.DarkMatter") %>%
      addPolygons(color = ~paste0("#", color), weight = 1)
    

提交回复
热议问题