Skip to content
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

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

Open
sgofferj opened this issue Nov 17, 2022 · 0 comments
Open

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

sgofferj opened this issue Nov 17, 2022 · 0 comments

Comments

@sgofferj
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant