Comments (9)
I see from testing other things with Sidebyside that it may actually be the lack of an option for pathOptions(pane="") that is keeping the addWMS() from being used in Sidebyside.
from leaflet.extras2.
The argument layers
is used as layerId
.
It seems to be possible to use 1 call to addWMS
with addSidebyside
but not 2. I will have to dig a bit deeper to understand why it is not working correctly.
library(leaflet)
library(leaflet.extras2)
leaflet() %>%
addMapPane("left", zIndex = 0) %>%
addMapPane("right", zIndex = 0) %>%
addTiles() %>%
addWMS(baseUrl = "http://ows.terrestris.de/osm/service",
layers = "OSM-Overlay-WMS",
group = "wms_left",
options = leaflet::WMSTileOptions(
transparent = TRUE, format = "image/png", info_format = "text/html"
)) %>%
addLayersControl(overlayGroups = "wms_left") %>%
addSidebyside(layerId = "sidecontrols",
leftId = "OSM-Overlay-WMS")
from leaflet.extras2.
Using untiled=FALSE
seems to work. However, the click event ignores the pane argument and triggers also when moving the slider.
library(leaflet)
library(leaflet.extras2)
leaflet() %>%
addMapPane("left", zIndex = 0) %>%
addMapPane("right", zIndex = 0) %>%
addTiles(group = "base", layerId = "baseid",
options = pathOptions(pane = "right")) %>%
addProviderTiles(providers$CartoDB.DarkMatter, group = "carto", layerId = "cartoid",
options = tileOptions(pane = "left")) %>%
addWMS(baseUrl = "https://maps.dwd.de/geoserver/dwd/wms",
layers = "dwd:BRD_1km_winddaten_10m",
group = "wms_right",
options = leaflet::WMSTileOptions(untiled=FALSE,
transparent = TRUE, format = "image/png", info_format = "text/html"
,pane = "right"
)) %>%
addWMS(baseUrl = "http://ows.terrestris.de/osm/service",
layers = "OSM-Overlay-WMS",
group = "wms_left",
options = leaflet::WMSTileOptions(untiled=FALSE,
transparent = TRUE, format = "image/png", info_format = "text/html"
,pane = "left"
)) %>%
addLayersControl(overlayGroups = c("wms_right", "wms_left")) %>%
addSidebyside(layerId = "sidecontrols",
rightId = "baseid",
leftId = "cartoid")
from leaflet.extras2.
I just pushed 7a17032 which should make the pane
argument work for tiled and untiled WMS.
This PR heigeo/leaflet.wms#58 fixed it.
from leaflet.extras2.
Thanks so much for looking into this so quickly.
What I am trying to do with Sidebyside, is to compare the same satellite imagery based on two different time ranges. That means that the layers
argument will be the same name, which will interfere with the layerId argument. Here is my sample code:
leaflet() %>% setView(-86.39548,36.17889, 15) %>%
addMapPane("left", zIndex = 0) %>%
addMapPane("right", zIndex = 0) %>%
addTiles(group = "base", layerId = "baseid",
options = pathOptions(pane = "right")) %>%
addProviderTiles(providers$CartoDB.DarkMatter, group = "carto", layerId = "cartoid",
options = tileOptions(pane = "left")) %>%
addWMS(baseUrl = "https://services.sentinel-hub.com/ogc/wms/d0da9937-3594-4c41-9953-27dabd2bacae",
layers = "TRUE_COLOR",
group = "wms_right",
options = leaflet::WMSTileOptions(untiled=TRUE,
transparent = FALSE, info_format = "text/html"
,pane = "right",
time="2020-02-01/2020-08-14"
)) %>%
addWMS(baseUrl = "https://services.sentinel-hub.com/ogc/wms/d0da9937-3594-4c41-9953-27dabd2bacae",
layers = "TRUE_COLOR",
group = "wms_left",
options = leaflet::WMSTileOptions(untiled=TRUE,
transparent = FALSE, info_format = "text/html"
,pane = "left",
time="2018-02-01/2018-08-14"
)) %>%
addLayersControl(overlayGroups = c("wms_right", "wms_left")) %>%
addSidebyside(layerId = "sidecontrols",
rightId = "baseid",
leftId = "cartoid")
from leaflet.extras2.
Also, is there any way to just turn the click info off, so that we don't get the issue with the box popping up every time that the slider is moved?
from leaflet.extras2.
I will look into it, but if you dont need the click info, it might be better to just use leaflets addWMSTiles
instead. You can just exchange the addWMS
calls with addWMSTiles
. Would that work?
from leaflet.extras2.
It looks like that might be a good solution, since the only info i was trying to extract from the tiles was the date. I can call both layers (the image and date) and it will display the date over the tile. I’ll give it a try and let you know if I run into any issues. Thanks
from leaflet.extras2.
addWMS
now inherited a layerId
argument and works almost identical to addWMSTiles
. The only differences are the getFeatureInfo feature and the popupOptions
argument.
from leaflet.extras2.
Related Issues (20)
- awesomeIcons in addMovingMarker for direction HOT 7
- New Feature Request : Leaflet Pattern HOT 1
- Sidebar v2 working with crosstalk HOT 4
- Using CQL or OGC filters on addWMS() HOT 2
- addArrowhead function not rendering HOT 4
- addEasyprint does only export the top part of a map for "Current Size" HOT 3
- Overlaying sidebar using shinydashboard and addSidebar HOT 13
- Spinner does not appear in Shiny application HOT 6
- "addHexbin" in leaflet.extras2 doesn't allow for mean/sum HOT 2
- addVelocity not work HOT 1
- addWMS with interactive options HOT 1
- Changing the moveable marker icons and colours in addPlayback() HOT 6
- addWMS - authentication for title layer HOT 2
- addWMS() does not hide the attribution when corresponding group is hidden HOT 2
- Release leaflet.extras2 1.2.1
- addSidebar causing issues if multiple leaflet maps are in one R shiny app HOT 6
- Feature Request: Function to Recolor Polygons in Shiny without Redrawing them HOT 2
- airDatePickerInput (ShinyWidgets) not rendering properly in leaflet sidebar menu HOT 1
- Release leaflet.extras2 1.2.2
- Integrating GetLegendGraphic from Geoserver WMS Layers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leaflet.extras2.