-
Notifications
You must be signed in to change notification settings - Fork 506
Closed
Labels
difficulty: noviceAnyone could helpAnyone could helpeffort: low< 1 day of work< 1 day of workhelp wantedSolution is well-specified enough that any community member could fixSolution is well-specified enough that any community member could fixpriority: mediumCould be fixed before next releaseCould be fixed before next release
Description
Hi,
it seems that geoJSON geometry primitives such as "Point"
or "Polygon"
are not displayed by addGeoJSON()
. I would expect them to be valid input as according to the specification and to geojsonlint::geojson_validate()
they conform to the standard.
Cheers,
Andrzej
library(leaflet)
library(jsonlite)
library(geojsonlint)
polygon = list(
type = "Polygon",
coordinates = list(
list(
c(8.330469, 48.261570),
c(8.339052, 48.261570),
c(8.339052, 48.258227),
c(8.330469, 48.258227),
c(8.330469, 48.261570)
)
)
)
geojson_validate(toJSON(polygon, auto_unbox = TRUE))
#> [1] TRUE
leaflet() %>%
addTiles() %>%
addGeoJSON(polygon, color="#F00") %>%
setView(lng = 8.330469, lat = 48.26157, zoom = 15)
feature <- list(
type = "Feature",
properties = "",
geometry = polygon
)
leaflet() %>%
addTiles() %>%
addGeoJSON(feature, color="#F00") %>%
setView(lng = 8.330469, lat = 48.26157, zoom = 15)
Created on 2019-05-03 by the reprex package (v0.2.1)
Metadata
Metadata
Assignees
Labels
difficulty: noviceAnyone could helpAnyone could helpeffort: low< 1 day of work< 1 day of workhelp wantedSolution is well-specified enough that any community member could fixSolution is well-specified enough that any community member could fixpriority: mediumCould be fixed before next releaseCould be fixed before next release