Skip to content

Commit dc4efea

Browse files
committed
better crs transformation warning; add an example
1 parent 505482d commit dc4efea

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

R/sf.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ st_cast_crs <- function(x) {
7474
if (!(isLongLat && isWGS84)) {
7575
warning(
7676
"The trace types 'scattermapbox' and 'scattergeo' require a coordinate ",
77-
"reference system (crs) which contains: '+proj=longlat +datum=WGS84'.\n",
78-
"However, the crs of the sf data provided is: (", crs$proj4string, ").\n",
77+
"reference system (crs) that contains: '+proj=longlat +datum=WGS84', ",
78+
"but the crs provided is: '", crs$proj4string, "'. ",
7979
"Attempting transformation to the target coordinate system.",
8080
call. = FALSE
8181
)

demo/sf-mapbox-data.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,11 @@ p1 %>%
5353
)
5454

5555

56+
# non-standard crs
57+
library(mapview)
58+
plot_mapbox(trails, text = ~district, hoverinfo = "text")
59+
60+
tsd <- crosstalk::SharedData$new(trails)
61+
plot_mapbox(tsd)
62+
63+

0 commit comments

Comments
 (0)