Skip to content

Instantly share code, notes, and snippets.

@ateucher
Last active March 28, 2019 22:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ateucher/1c99db8dab2d7aa2d1df36a7e7e4acb9 to your computer and use it in GitHub Desktop.
Save ateucher/1c99db8dab2d7aa2d1df36a7e7e4acb9 to your computer and use it in GitHub Desktop.
BC WMSTiles
library(bcmaps)
library(leaflet)
library(sf)
st_transform(bc_bound(), 4326) %>%
leaflet() %>%
#add basemap
#addpolygons and make it show in three different layers, by risk level
addPolygons() %>%
addProviderTiles(providers$CartoDB.DarkMatter,
options = providerTileOptions(noWrap = TRUE)) %>%
addWMSTiles("https://openmaps.gov.bc.ca/geo/pub/WHSE_WATER_MANAGEMENT.WLS_PWD_APPLICATIONS_SVW/ows?service=WMS",
layers="pub:WHSE_WATER_MANAGEMENT.WLS_PWD_APPLICATIONS_SVW",
options = WMSTileOptions(format = "image/png",
transparent = TRUE))
library(leaflet)
library(envreportutils)
library(leaflet.extras)
leaflet() %>%
addProviderTiles(providers$CartoDB.DarkMatter,
options = providerTileOptions(noWrap = TRUE)) %>%
addWMSTiles("https://openmaps.gov.bc.ca/geo/pub/WHSE_WATER_MANAGEMENT.WLS_PWD_APPLICATIONS_SVW/ows?service=WMS",
layers="pub:WHSE_WATER_MANAGEMENT.WLS_PWD_APPLICATIONS_SVW",
options = WMSTileOptions(format = "image/png",
transparent = TRUE)) %>%
addWMSLegend(uri = "https://openmaps.gov.bc.ca/geo/pub/WHSE_WATER_MANAGEMENT.WLS_PWD_APPLICATIONS_SVW/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=pub%3AWHSE_WATER_MANAGEMENT.WLS_PWD_APPLICATIONS_SVW") %>%
set_bc_view() %>%
add_bc_home_button()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment