Closed pinky2070500 closed 2 years ago
Hi @pinky2070500
This is not a geotiff.js issue, but more related to leafletGeotiff. Did you follow the instructions on how to import/include the dependencies?
I will close this issue, but you can still comment here if you have further questions.
i try to put the tiff on the map but get this error, i use leaflet and vue to build the map. use yii2 to build website homepage. The tiff image is generated from gdal, saved in srouce yii2
This code create gtiff in gdal and yii2, is working. $path = 'projects/gsnc/storage/raster'.'/home'; FileHelper::createDirectory($path); $filePath = Yii::getAlias('@webroot/'.$path.'/features.geojson'); file_put_contents($filePath, json_encode([ 'type' => 'FeatureCollection', 'features' =>$features->all() ])); $shpin = 'projects/gsnc/storage/vector/hcm.shp'; $shpinPath = Yii::getAlias('@webroot/'.$shpin);
This code in vue idw () { // GeoTIFF file URL. Currently only EPSG:4326 files are supported // Can be null if sourceFunction is GeoTIFF.fromArrayBuffer const url = "http://gsnc.local/projects/gsnc/storage/raster/home/idw_muivi_wgs84_1653559785.tif"; const options = { // See renderer sections below. // One of: L.LeafletGeotiff.rgb, L.LeafletGeotiff.plotty, L.LeafletGeotiff.vectorArrows renderer: null,
// create layer var layer = L.leafletGeotiff(url, options).addTo(map); },