Open jclarkology opened 6 years ago
I will take a look this weekend and give you an answer.
Hi Bhaskar,
Not sure whether you've had time to take a look at this. I've made some progress, but would still like to confirm this is the correct syntax/best practice. This seems to be working:
leaflet() %>%
setView(113.8, .52, zoom = 8) %>%
leaflet.esri::addEsriImageMapLayer(
"https://landsat.arcgis.com/arcgis/rest/services/Landsat/PS/ImageServer",
imageMapLayerOptions(
from = JS('new Date(\'1999\')'),
to = JS('new Date(\'2001\')'),
renderingRule = "Pansharpened Enhanced with DRA"
),
group = "Landsat2", layerId = "landsat2")
leaflet() %>%
setView(113.8, .52, zoom = 8) %>%
leaflet.esri::addEsriImageMapLayer(
"https://landsat.arcgis.com/arcgis/rest/services/Landsat/PS/ImageServer",
imageMapLayerOptions(
from = JS('new Date(\'2004\')'),
to = JS('new Date(\'2006\')'),
renderingRule = "Pansharpened Enhanced with DRA"
),
group = "Landsat2", layerId = "landsat2")
The trick was to pass the year within htmlwidgets::JS() following the syntax from the ESRI example, AND ensure the date string is quoted to ensure it's parsed by Javascript.
Thank you for this package and your other fantastic contributions!
I'm trying to implement a raster time-series following this example: https://landsat.arcgis.com/arcgis/rest/services/LandsatGLS/MS/ImageServer However, I'm struggling with the syntax of the "from" and "to" arguments. The ESRI example just calls a single year:
Passing a numeric 'from' and 'to' doesn't return any tiles:
Which doesn't surprise me since I'm not passing it as the JS Date class. However, passing an R Date DOES return tiles, but the from/to constraints have no effect. These both return the same imagery:
Not sure whether syntax is the issue, maybe it needs to apply a mosaicRule? Any guidance you can provide would be greatly appreciated.