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

Remove GeoRasterLayer #49

Closed aaronyeo40 closed 3 years ago

aaronyeo40 commented 3 years ago

Hi, May I know how to remove the layer?

thanks

regard

Aaron

aaronyeo40 commented 3 years ago

var layer = new GeoRasterLayer({ georaster: georaster, resolution: 256 }); layer.addTo(map); map.fitBounds(layer.getBounds());

after tested just remove the var

map.removeLayer(layer);

is it this is the correct way or any alternative?

thanks

DanielJDufour commented 3 years ago

Yup. That's correct. Thanks for posting this! It helps others who have the same question :-)

DanielJDufour commented 3 years ago

@aaronyeo40 solved the issue, so I'm going to close this issue. Please open new issues as problems come up as it helps everyone. Thank you very much!