Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

Commit

Permalink
fix examples prematurely changed for useCors = FALSE
Browse files Browse the repository at this point in the history
  • Loading branch information
schloerke committed Mar 27, 2018
1 parent 57b7cb4 commit ab61d68
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 18 deletions.
3 changes: 1 addition & 2 deletions R/dynamicMapLayers.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ dynamicMapLayerOptions <- function(
#' addEsriDynamicMapLayer(
#' url = paste0("https://maps7.arcgisonline.com/arcgis/rest/services/",
#' "USDA_USFS_2014_Wildfire_Hazard_Potential/MapServer"),
#' popupFunction = popupFunc,
#' options = dynamicMapLayerOptions(useCors = FALSE))
#' popupFunction = popupFunc)
#'
#' ## for more examples see
#' # browseURL(system.file("examples/dynamicMapLayers.R", package = "leaflet.esri"))
Expand Down
8 changes: 4 additions & 4 deletions R/imageMapLayers.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ imageMapLayerOptions <- function(
#' @export
#' @examples
#' leaflet() %>%
#' addEsriBasemapLayer(esriBasemapLayers$Gray) %>%
#' setView(30, 0, 3) %>%
#' addEsriBasemapLayer(esriBasemapLayers$Imagery) %>%
#' setView(-120.23, 43.5, 5) %>%
#' addEsriImageMapLayer(
#' url = "https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/World/MODIS/ImageServer",
#' options = imageMapLayerOptions(useCors = FALSE))
#' url = "http://imagery.oregonexplorer.info/arcgis/rest/services/NAIP_2011/NAIP_2011_Dynamic/ImageServer",
#' options = imageMapLayerOptions(bandIds = c(3, 0, 1)))
#'
#' ## for more examples see
#' # browseURL(system.file("examples/imageMapLayers.R", package = "leaflet.esri"))
Expand Down
6 changes: 2 additions & 4 deletions inst/examples/dynamicMapLayers.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ leaflet() %>% setView(-99.88, 37.71, 4) %>%
layerId = "selectedFeatures", position = "bottomleft") %>%
addEsriDynamicMapLayer(
url = "https://services.arcgisonline.com/arcgis/rest/services/Specialty/Soil_Survey_Map/MapServer",
layerId = "soil",
options = dynamicMapLayerOptions(useCors = FALSE)) %>%
layerId = "soil") %>%
htmlwidgets::onRender(htmlwidgets::JS(
"function(el, x, data) {
var map = this;
Expand Down Expand Up @@ -62,5 +61,4 @@ popupFunc <- htmlwidgets::JS(
leaflet() %>% setView(-96.8, 38.5, 4) %>%
addEsriBasemapLayer(esriBasemapLayers$Gray, autoLabels = TRUE) %>%
addEsriDynamicMapLayer(
url = "https://maps7.arcgisonline.com/arcgis/rest/services/USDA_USFS_2014_Wildfire_Hazard_Potential/MapServer", popupFunction = popupFunc,
options = dynamicMapLayerOptions(useCors = FALSE))
url = "https://maps7.arcgisonline.com/arcgis/rest/services/USDA_USFS_2014_Wildfire_Hazard_Potential/MapServer", popupFunction = popupFunc)
5 changes: 3 additions & 2 deletions inst/examples/imageMapLayers.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
library(leaflet.esri)

#' ### Examples 1 & 2
#' Simple examples. In Example 1 we need to disable CORS as the ArcGIS ver. is old and doesn't support cors.<br/><br/>


leaflet() %>%
addEsriBasemapLayer(esriBasemapLayers$Gray) %>%
Expand All @@ -20,8 +22,7 @@ leaflet() %>%
addEsriBasemapLayer(esriBasemapLayers$Gray) %>%
setView(-96.8, 38.5, 4) %>%
addEsriImageMapLayer(
url = "https://seamlessrnc.nauticalcharts.noaa.gov/arcgis/rest/services/RNC/NOAA_RNC/ImageServer",
options = imageMapLayerOptions(useCors = FALSE))
url = "https://seamlessrnc.nauticalcharts.noaa.gov/arcgis/rest/services/RNC/NOAA_RNC/ImageServer")

#' ### Example 3
#' Custom band Ids for infrared image layer.<br/><br/>
Expand Down
3 changes: 1 addition & 2 deletions man/addEsriDynamicMapLayer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/addEsriImageMapLayer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ab61d68

Please sign in to comment.