diff --git a/NEWS.md b/NEWS.md
index d19b8f52f..1be87d02f 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,7 @@
# leaflet (development version)
+* Attribution links for OpenStreetMap, OpenDataCommons, CartoDB, NASA, Kadaster, Kartena will now open in a new tab (using the HTML `target` attribute)
+
* `{leaflet}` no longer install sp by default and attempts to convert object to sf internally before creating a map and warns when it fails conversion (@olivroy, #942).
* The `breweries91`, `atlStorms2005`, and `gadmCHE` datasets are now `{sf}` objects (@olivroy, #944).
diff --git a/R/layers.R b/R/layers.R
index fd39eda0d..505cf090c 100644
--- a/R/layers.R
+++ b/R/layers.R
@@ -166,8 +166,8 @@ addTiles <- function(
options$attribution <- attribution
if (missing(urlTemplate) && is.null(options$attribution))
options$attribution <- paste(
- "© OpenStreetMap, ",
- "ODbL"
+ "© OpenStreetMap, ",
+ "ODbL"
)
invokeMethod(map, data, "addTiles", urlTemplate, layerId, group,
options)
diff --git a/R/legacy.R b/R/legacy.R
index 8fdc60084..4bafcdf3f 100644
--- a/R/legacy.R
+++ b/R/legacy.R
@@ -100,8 +100,8 @@ leafletMap <- function(
if (missing(initialTileLayer) && is.null(initialTileLayerAttribution))
initialTileLayerAttribution <- paste(
- "© OpenStreetMap",
- "contributors, CC-BY-SA"
+ "© OpenStreetMap",
+ "contributors, CC-BY-SA"
)
shiny::addResourcePath("leaflet-legacy", system_file("legacy/www", package = "leaflet"))
diff --git a/inst/examples/leaflet.R b/inst/examples/leaflet.R
index 74d28ee69..172edd068 100644
--- a/inst/examples/leaflet.R
+++ b/inst/examples/leaflet.R
@@ -125,8 +125,8 @@ m %>% setView(-122.36075812146, 47.6759920119894, zoom = 13) %>% addGeoJSON(seat
# use the Dark Matter layer from CartoDB
leaflet() %>% addTiles("https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png",
attribution = paste(
- "© OpenStreetMap contributors",
- "© CartoDB"
+ "© OpenStreetMap contributors",
+ "© CartoDB"
)
) %>% setView(-122.36, 47.67, zoom = 10)
diff --git a/inst/examples/proj4Leaflet-PolarProjections.R b/inst/examples/proj4Leaflet-PolarProjections.R
index daa5bfb67..1968679cb 100644
--- a/inst/examples/proj4Leaflet-PolarProjections.R
+++ b/inst/examples/proj4Leaflet-PolarProjections.R
@@ -124,7 +124,10 @@ leaflet(options = leafletOptions(
addCircleMarkers(data = points, label = ~Name) %>%
addTiles(urlTemplate = antarticaTilesURL,
layerId = "antartica_tiles",
- attribution = " NASA EOSDIS GIBS View Source ",
+ attribution = paste(
+ " NASA EOSDIS GIBS ",
+ " View Source "
+ ),
options = tileOptions(
tileSize = 512,
subdomains = "abc",
diff --git a/inst/examples/proj4Leaflet-TMS.R b/inst/examples/proj4Leaflet-TMS.R
index 3589913e6..f5631c3be 100644
--- a/inst/examples/proj4Leaflet-TMS.R
+++ b/inst/examples/proj4Leaflet-TMS.R
@@ -38,7 +38,7 @@ leaflet(options = leafletOptions(
addTiles("http://geodata.nationaalgeoregister.nl/tms/1.0.0/brtachtergrondkaart/{z}/{x}/{y}.png",
options = tileOptions(tms = TRUE,
errorTileUrl = "http://www.webmapper.net/theme/img/missing-tile.png"),
- attribution = "Map data: Kadaster") %>%
+ attribution = "Map data: Kadaster") %>%
addCircleMarkers(data = meuse.4326, popup = popupTable(meuse))
diff --git a/inst/examples/proj4Leaflet.R b/inst/examples/proj4Leaflet.R
index ee7135243..b132508fa 100644
--- a/inst/examples/proj4Leaflet.R
+++ b/inst/examples/proj4Leaflet.R
@@ -30,7 +30,7 @@ leaflet(
)) %>%
addTiles(
urlTemplate = "https://api.geosition.com/tile/osm-bright-3006/{z}/{x}/{y}.png",
- attribution = "Map data © OpenStreetMap contributors, Imagery © 2013 Kartena",
+ attribution = "Map data © OpenStreetMap contributors, Imagery © 2013 Kartena",
options = tileOptions(minZoom = 0, maxZoom = 14)) %>%
setView(11.965, 57.704, 13)
diff --git a/inst/legacy/examples/population/ui.R b/inst/legacy/examples/population/ui.R
index 482a9a047..f2dc113ee 100644
--- a/inst/legacy/examples/population/ui.R
+++ b/inst/legacy/examples/population/ui.R
@@ -6,7 +6,7 @@ shinyUI(fluidPage(
leafletMap(
"map", "100%", 400,
initialTileLayer = "//{s}.tiles.mapbox.com/v3/jcheng.map-5ebohr46/{z}/{x}/{y}.png",
- initialTileLayerAttribution = HTML("Maps by Mapbox"),
+ initialTileLayerAttribution = HTML("Maps by Mapbox"),
options = list(
center = c(37.45, -93.85),
zoom = 4,
diff --git a/man/leaflet.Rd b/man/leaflet.Rd
index e1f1f1fd2..05d498f79 100644
--- a/man/leaflet.Rd
+++ b/man/leaflet.Rd
@@ -251,8 +251,8 @@ m \%>\% setView(-122.36075812146, 47.6759920119894, zoom = 13) \%>\% addGeoJSON(
# use the Dark Matter layer from CartoDB
leaflet() \%>\% addTiles("https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png",
attribution = paste(
- "© OpenStreetMap contributors",
- "© CartoDB"
+ "© OpenStreetMap contributors",
+ "© CartoDB"
)
) \%>\% setView(-122.36, 47.67, zoom = 10)