A Leaflet extension to distort images -- "rubbersheeting" -- for the MapKnitter.org (src) image georectification service by Public Lab. Leaflet.DistortableImage allows for perspectival distortions of images, client-side, using CSS3 transformations in the DOM.
- it can handle over 100 images smoothly, even on a smartphone.
- images can be right-clicked and downloaded individually in their original state
- CSS3 transforms are GPU-accelerated in most (all?) browsers, for a very smooth UI
- no need to server-side generate raster GeoTiffs, tilesets, etc in order to view distorted imagery layers
- images use DOM event handling for real-time distortion
Download as zip or clone to get a copy of the repo.
This plugin has basic functionality, and is in production as part of MapKnitter, but there are plenty of outstanding issues to resolve. Please consider helping out!
The recommended Google satellite base layer can be integrated using this Leaflet plugin: https://gitlab.com/IvanSanchez/Leaflet.GridLayer.GoogleMutant
Here's a screenshot:
Check out this simple demo.
And watch this GIF demo:
Download as zip or clone to get a copy of the Repo.
To test the code, open
index.html in your browser and click and drag the markers on the edges of the image. The image will show perspectival distortions.
- From the root directory, run
sudo npm install
- Open examples/index.html in a browser
- This project uses
gruntto do a lot of things, including concatenate source files from /src/ to /DistortableImageOverlay.js. But you may need to install grunt-cli:
npm install -g grunt-clifirst.
gruntin the root directory, and it will watch for changes and concatenate them on the fly.