How to add XYZ and WMS link to leaflet map

Hi all,

I am using EllipsisDrive (https://ellipsis-drive.com/) to test it as repository for some R projects (Shiny & R markdown) without worrying for generating WMS my self or CORS configuration when hosting my cloud optimized geotif repository (in google cloud or AWS storage for instance).

With EDrive I have:
-XYZ link: https://api.ellipsis-drive.com/v3/path/7943dae4-4ad7-4cc3-82b4-a458c3476b28/raster/timestamp/627cc75b-67ef-4407-a04e-03cb1e736f28/tile/{z}/{x}/{y}?style=8b77dfaf-45e9-4e95-9d17-fa480901be39&token=epat_3Nk1WOphGqRXHZitewDt1RGD0JG6SLEz1tCIWASkuPxItBU2wRHWSaqrAKg7AmZg

-WMS link: Ellipsis Drive WMS

I tested these links with QGIS by adding WMS and XYZ layers and they work fine there. Then I tried in R:

library(leaflet)
library(leafem)

wms_modis<-"https://api.ellipsis-drive.com/v3/ogc/wms/7943dae4-4ad7-4cc3-82b4-a458c3476b28?request=getCapabilities&token=epat_Zr00OcopSu24najgtpxmUxea5YcNwrKPzwGpFbuRXv74uqxvYjR13xZduCFj5kcI"
 
 leaflet()  %>% setView(lng = -2.683 , lat =43.31 , zoom = 10) %>% addTiles() %>%
   addWMSTiles(
     wms_modis,
     layers = "0",
     options = WMSTileOptions(format = "image/png", transparent = F)
   )  

But I don´t get the layer, just the base OSM layer. I check the XML file and found:

<Layer queryable="0">
<Title>modis_ndvi_cog</Title>

so I changed the layers to layers = "modis_ndvi_cog" but got the same result. So, what is wrong with my code? In addition, is it possible to add an XYZ link to leaflet map? if so, how can be done? The links are open so anyone can check on them.

Thank you,

Try

addTiles(templateUrl= 'the xyz url')
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.