Skip to content

Does the plugin support a list of times (vs a range)? #221

@sgofferj

Description

@sgofferj

I'm trying to get the plugin work for a small project of mine. I download satellite images of my area and run them through some processing. I would like to display them through Leaflet. I have set up a MapServer instance and it works in QGIS but I can't get it to work in Leaflet. Becaause the images are in irregular intervals, my server gives a list of available times rather than a range - like this:
<Dimension name="time" units="ISO8601" default="2022-11-15T15:57:30Z" nearestValue="0">2022-10-22T04:42:09Z,2022-10-22T15:57:31Z,2022-10-27T04:50:17Z,2022-11-03T04:42:09Z,2022-11-03T15:57:30Z,2022-11-08T04:50:16Z,2022-11-15T15:57:30Z</Dimension>

My leaflet code looks like this:

var map = L.map('map', {
    zoom: 12,
    center: [61.2712,24.0333],
    timeDimension: true,
    timeDimensionControl: true,
});

var baseLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
    attribution: '© OpenStreetMap contributors'
}).addTo(map);

var satLayer = L.tileLayer.wms("https://mapserver.gofferje.net/?map=sat", {
    tileSize: 1024,
    layers: 'Sentinel-1-VVVH-ratio',
    format: 'image/png',
    transparent: true,
    attribution: 'VLK radar'
});

var tsatLayer = L.timeDimension.layer.wms(satLayer, {
    requestTimeFromCapabilities: true,
    updateTimeDimension: true,
//    updateTimeDimensionMode: "replace",
//    setDefaultTime: true,
    //wmsVersion: "1.3.0"
});
tsatLayer.addTo(map);
var marker = L.marker([61.2712,24.0333]).addTo(map);

I have tried setting the time dimension extent in the map section but to no avail. I just can't make it work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions