GeoTIFF / georaster-layer-for-leaflet

Display GeoTIFFs and soon other types of raster on your Leaflet Map
https://geotiff.github.io/georaster-layer-for-leaflet-example/
Apache License 2.0
286 stars 57 forks source link

Delete multi Layer #50

Open aaronyeo40 opened 3 years ago

aaronyeo40 commented 3 years ago

I able to add multi layer based on dynamic url. May I know how to remove layer by id or name (once more than 1 layer).

var url_to_geotiff_fileaaa = "http://localhost:8086/leafletContent/tif/Abc1.tif";

        fetch(url_to_geotiff_fileaaa)
            .then(function (response) { return response.arrayBuffer(); })
            .then(function (arrayBuffer) {
                parseGeoraster(arrayBuffer).then(function (georaster) {
                    layerB = new GeoRasterLayer({
                        georaster: georaster,
                        resolution: 256
                    });
                    layerB.addTo(map);
                    map.fitBounds(layerB.getBounds());
                });
            });