-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display TIFF Files in React Application as LayerControl.BaseLayer TileLayer #113
Comments
Were you able to solve the issue? |
I was yeah! Took some time but it's working now :) |
can you explain how did you manage to do it? I have layercontrol, baselayer and tilelayer with multiple maps. Georaster layer shows only when I have one map only. |
I have each Tiff layer as a separate component, where I parse the data. Then I import it into my main Map component, as a LayerControl.Overlay. Within the Overlay, I import each Tiff file via the local url, which I import at the top of my component; this let's the users choose between multiple Tiff overlays (let me know if you need a more detailed explanation, happy to share my code haha) |
In my project I have only one layer and I change the data. Thanks a lot. I would also like to take a look at your code. |
for sure! i have the tiff components structured like this - `import { useEffect, useRef } from "react"; window.proj4 = proj4; const TminLayer = ({ url }) => {
}; export default TminLayer; Then in my main Map component, I import those Tiff components, and import the Tiff data, then combine into Overlays as below - This was the only solution I could get working, there must be others out there but it's definitely a start...let me know? |
Hello @LukeHayesss, |
@LukeHayesss, thank you so, so much for posting this. As a relative newcomer to maps, this information seemed impossible to find. React-Leaflet is the cleanest tool I've found, but it's still a lot to learn. I made a few small changes that have worked better for me - your mileage may vary.
|
Hi, using React-Leaflet I'm able to display PNG layers within LayerControl.Baselayer TileLayer, and can display the various layers as additional layers on top of the initial baselayer. Utilizing a basic index.html file, I can build a simple Leaflet application that can parse TIFF files, and add them as layers, but within React-Leaflet, I'm struggling to get the layers to display. We've used Georaster Layer For Leaflet parse the data and have everything show up in the console correctly (can access everything when debugging as well), I'm just unsure how to proceed with what to do from here as far as adding these TIFF files to our base map (I have extensively searched online for guidance and cannot find much, unfortunately). Any help would be appreciated!
The text was updated successfully, but these errors were encountered: