Open DanielJDufour opened 3 years ago
Hi! I have problem with proj4, vue 3 composition api with js. That problem displays when i push my project into the server, in local machine everything is OK,
node.js 20
import GeoRasterLayer from 'georaster-layer-for-leaflet'; import georaster from 'georaster';
const loadTiffLayer = async ( layer, link = import.meta.env.VITE_API_DEV + props.layer.link, token = localStorage.getItem('token'), ) => { if (isLoading.value) { return; }
isLoading.value = true;
try {
const response = await fetch(link, {
headers: {
Authorization: Bearer ${token}
,
},
});
if (!response.ok) {
throw new Error(`Error TIFF: ${response.statusText}`);
}
const arrayBuffer = await response.arrayBuffer();
const georasterData = await georaster(arrayBuffer);
tiffLayer.value = new GeoRasterLayer({
georaster: georasterData,
opacity: Number(layer.opacity),
resolution: 256,
}).addTo(map.value);
currentLayer.value.push(tiffLayer.value);
map.value.fitBounds(tiffLayer.value.getBounds());
} catch (error) { console.log(error) } finally { isLoading.value = false; } };
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like A clear and concise description of what you want to happen.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.