Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addWMSTiles not appearing when using a custom pane #834

Open
mtennekes opened this issue Dec 15, 2022 · 0 comments
Open

addWMSTiles not appearing when using a custom pane #834

mtennekes opened this issue Dec 15, 2022 · 0 comments

Comments

@mtennekes
Copy link
Contributor

This map shows (as expected) an OSM base layer with a WMS layer on top:

leaflet() %>%
	
	setView(lng = 5.287638, lat = 51.703039, zoom = 12) %>%
	addMapPane("myPane", zIndex = 10) %>%
	
	# Defines open-source base maps
	addProviderTiles(group = "OSM", providers$OpenStreetMap) %>%
	
	# Defines bodemgebruik 2017 WMS from PDOK
	addWMSTiles(group = "BBG17",
				baseUrl = "https://service.pdok.nl/cbs/bestandbodemgebruik/2017/wms/v1_0?",
				layers = "bestandbodemgebruik_2017_hoofdgroep",
				options = WMSTileOptions(format = "image/png", transparent = TRUE, crs = "EPSG:4326", interactive = TRUE, minZoom = 7, maxZoom = 15)) %>%
	
	addLayersControl(
		baseGroups = "OSM",
		overlayGroups = "BBG17",
		options = layersControlOptions(collapsed = FALSE)
		
	)

(Note that it may take about 10 seconds before the WMS tiles arrive)

image

However, when I assign the WMS tile layer to the custom pane, "myPane" it isn't appearing:

leaflet() %>%
	
	setView(lng = 5.287638, lat = 51.703039, zoom = 12) %>%
	addMapPane("myPane", zIndex = 10) %>%
	
	# Defines open-source base maps
	addProviderTiles(group = "OSM", providers$OpenStreetMap) %>%
	
	# Defines bodemgebruik 2017 WMS from PDOK
	addWMSTiles(group = "BBG17",
				baseUrl = "https://service.pdok.nl/cbs/bestandbodemgebruik/2017/wms/v1_0?",
				layers = "bestandbodemgebruik_2017_hoofdgroep",
				options = WMSTileOptions(pane = "myPane", format = "image/png", transparent = TRUE, crs = "EPSG:4326", interactive = TRUE, minZoom = 7, maxZoom = 15)) %>%
	
	addLayersControl(
		baseGroups = "OSM",
		overlayGroups = "BBG17",
		options = layersControlOptions(collapsed = FALSE)
		
	)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant