Estoy tratando de crear un código usando leaflet y estoy teniendo problemas para animar una serie de imágenes de radar meteorológico usando WMS. Mi código es el siguiente:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.2.0/leaflet.css" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.2.0/leaflet.js">
</script>
<div id="map" style='width: 943px; height: 480px;'></div>
<link rel="stylesheet" href="https://cdn.rawgit.com/socib/Leaflet.TimeDimension/master/dist/leaflet.timedimension.control.min.css"
/>
</head>
<body>
<script type="text/javascript" src="https://cdn.rawgit.com/socib/Leaflet.TimeDimension/master/dist/leaflet.timedimension.min.js">
</script>
<script type="text/javascript" src="https://cdn.rawgit.com/nezasa/iso8601-js-period/master/iso8601.min.js">
</script>
<script>
//make the map
var wmsLayerRadarRrai4kmLink = 'https://geo.weather.gc.ca/geomet?'
var wmsLayerRadarRrai4km = L.tileLayer.wms(wmsLayerRadarRrai4kmLink, {
layers: 'RADAR_RRAI',
version: '1.1.0',
format: 'image/png',
transparent: true
//opacity: .75
});
var wmsLayerRadarRrai4kmTD = L.timeDimension.layer.wms(wmsLayerRadarRrai4km, {
});
var map = L.map('map', {
center: [49.9, -97.215],
zoom: 5,
fullScreenControl: true,
timeDimension: true,
timeDimensionControl: true,
timeDimensionOptions: {
},
timeDimensionControlOptions: {
autoPlay: true,
playerOptions: {
loop: true,
timeSteps: 1,
}
}
});
//get the wms layers
var proxy = 'server/proxy.php'
//group wms layers
var overlayMaps = {
"Radar Rain 4km": wmsLayerRadarRrai4kmTD
};
//get basemaps using tileLayer
var basemapDark = L.tileLayer('https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y} {r}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors ©<a href="https://carto.com/attributions">CARTO</a>',
subdomains: 'abcd',
maxZoom: 19
});
var basemapLight = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
});
//group basemaps
var baseMaps = {
"Light": basemapLight,
"Dark": basemapDark
};
L.control.layers(baseMaps, overlayMaps).addTo(map);
L.control.timeDimension
</script>
</body>
</html>
La capa inicial por defecto se cargará, pero una vez que la capa de tiempo se activa/reproduce, no se muestra nada más. Parece que está tomando el componente de tiempo correcto de la GetCapabilities, así que no estoy seguro de cuál es el problema.