-
Notifications
You must be signed in to change notification settings - Fork 74
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
AddWMSLegend does not work with Observe or ObserveEvent #155
Comments
I ran into this problem again. I don't know if you found a way to fix the issue, but a workaround is to use Looking at the source code, So something like what you're trying seems like it would not work with Instead, I'm using something like
where |
reprex:
|
I'm trying to insert a GeoServer WMS legend into Leaflet in Shiny as follows, but the legend does not render within an Observe or ObserveEvent function. Note that the legend does display in the map if not placed within an Observe or ObserveEvent.
I'd be grateful to learn how to make this work.
Thanks in advance,
Richard
Example code:
`observe({
if(input$srtm_sl != 0){
proxy <- leafletProxy("map")
proxy %>%
addWMSLegend(
uri = "http://11.11.1111.11:8080/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.1.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=ta9191:srtm_sl&legend_options=fontName:Times%20New%20Roman;fontAntiAliasing:true;fontColor:0x000033;fontSize:12;bgColor:0xFFFFEE;dpi:91&SCALE=1001",
position = "bottomleft",
layerId = "legend"
)
}
})
`
The text was updated successfully, but these errors were encountered: