I am trying to display several zipcodes (thus polygons...) on a leaflet
map. Data is available as a geojson
file here. I chose as an example some zip codes from Seattle.
I tried the following (reproducible example):
library(jsonlite)
library(leaflet)
url <- "https://raw.githubusercontent.com/openseattle/seattle-boundaries/master/data/zip-codes.geojson"
geojson <- fromJSON(url)
map <- leaflet() %>% addTiles() %>% addGeoJSON(geojson)
map
I could not figure out how to properly set addGeoJSON
parameters, and calling map only displays the leaflet() %>% addTiles()
part...
Documentation is too light for the non json advanced user that I am:
geojson: a GeoJSON list, or character vector of length 1
How should I proceed? Thank you very much in advance for your views on this issue
Regards