Hello everyone,
I tried to develop a Radar Visor from AEMET images but I can't show the color of the radar. This is the code:
`
<style>
#map {
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
}
</style>
<script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script>
<script src="https://unpkg.com/georaster"></script>
<script src="https://unpkg.com/georaster-layer-for-leaflet/georaster-layer-for-leaflet.browserify.min.js"></script>
<script>
// initalize leaflet map
var map = L.map('map').setView([41.7, 0], 5);
// add OpenStreetMap basemap
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
var url_to_geotiff_file = "http://radarzgz.meteozgz.eu/last2.tif";
fetch(url_to_geotiff_file)
.then(response => response.arrayBuffer())
.then(arrayBuffer => {
parseGeoraster(arrayBuffer).then(georaster => {
console.log("georaster:", georaster);
/*
GeoRasterLayer is an extension of GridLayer,
which means can use GridLayer options like opacity.
Just make sure to include the georaster option!
http://leafletjs.com/reference-1.2.0.html#gridlayer
*/
var layer = new GeoRasterLayer({
attribution: "Planet",
georaster: georaster,
resolution: 300,
opacity: 0.6
});
layer.addTo(map);
map.fitBounds(layer.getBounds());
});
});
</script>
`
And you can enter to visor: http://radarzgz.meteozgz.eu/geotif.html The original is this: https://ama.aemet.es/o/estaticos/productos/scm/202004122300_r8za.gif
I don't know how to do to show the original colors...
Thank you very much.
Carlos C.
Hello everyone,
I tried to develop a Radar Visor from AEMET images but I can't show the color of the radar. This is the code:
<style> #map { bottom: 0; left: 0; position: absolute; right: 0; top: 0; } </style> <script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script> <script src="https://unpkg.com/georaster"></script> <script src="https://unpkg.com/georaster-layer-for-leaflet/georaster-layer-for-leaflet.browserify.min.js"></script> <script> // initalize leaflet map var map = L.map('map').setView([41.7, 0], 5);`
And you can enter to visor: http://radarzgz.meteozgz.eu/geotif.html The original is this: https://ama.aemet.es/o/estaticos/productos/scm/202004122300_r8za.gif
I don't know how to do to show the original colors...
Thank you very much.
Carlos C.