5

I want to add a digital elevation model (DEM) layer to my leaflet map and access the height data through javascript, i.e. I cannot use .png files or qgis2webplugin but rather .tif or some compressed webmaptile file.

Any efficient idea or plugin recommendation?

1

1 Answer 1

2

You will have to dump that tiff file (or whatever) into a <canvas> and read the values of whatever pixels you want. Be aware of cross-origin issues.

Do read:

https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Using_images

https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Pixel_manipulation_with_canvas

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.