Comments (9)
This could be done by setting up a basic Leaflet map in an example, and using this listener to find when tileLayers are loaded: https://stackoverflow.com/questions/27378572/leaflet-fire-event-when-tile-layer-loading-begins-and-ends#27379032
layerInstance.on('load', function (event) {
// fetch all the tile URLs, so in jQuery:
$('img.leaflet-tile');
});
Then use the new replaceImage()
method on them!
from image-sequencer.
Sorry, I am still unable to make out...
What are we trying to accomplish with leaflet.js?
from image-sequencer.
from image-sequencer.
Just a followup fleshing this out a bit more; the demo could be later built out into a plugin named Leaflet.TileFilter: A Leaflet plugin that accepts a pixel compositing function and runs it on every pixel of incoming tiles, on the fly
function filter(pixel) { // [r, g, b, a]
var ndvi = (r + b) / (r - b);
return [ndvi, ndvi, ndvi, 1]
}
var src = "http://tilesource.com/..."
var tileFilter = new Leaflet.TileFilter(filter, src);
// tileFilter acts like a tile layer
tileFilter.update(filter);
from image-sequencer.
This looks nice!
from image-sequencer.
Yay this is now possible!
Go here and drag the NDVI bookmarklet into your bookmarks bar: https://publiclab.org/wiki/imagesequencerbookmarklet#NDVI
Then go here: https://publiclab.github.io/Leaflet.DistortableImage/examples/
and click the bookmarklet!
from image-sequencer.
@jywarren you want to open a new issue using this one? Thanks!
from image-sequencer.
Which part do you think? Breaking it out as a plugin? Thanks, Gaurav?
from image-sequencer.
I've spun this into it's own Leaflet plugin here: https://github.com/publiclab/leaflet-multispectral and submitted it to the Leaflet Plugins listing here: Leaflet/Leaflet#6499
from image-sequencer.
Related Issues (20)
- Use blobs instead of dataurls to pass data between modules HOT 2
- Adding an image sharpening module
- Removing scroll-to-top on mobile devices HOT 5
- Focus stacking module implementation HOT 1
- Halftone angle (in radians) needs to be a decimal instead of an integer HOT 3
- Dependencies Requiring Manual Upgrades HOT 1
- Remove Unused Dependencies HOT 1
- Supported NodeJS Versions HOT 3
- New module idea: ocr text recognition
- Use Modern JS HOT 2
- Can add units to the dimension of the image HOT 10
- How do I specify "executablePath" when calling Puppeteer HOT 5
- yarn.lock vs. package-lock.json HOT 1
- Checklist and coordination for v3.7.2 patch release and v3.7.3 follow-up patch release HOT 8
- Ideas for next release HOT 2
- Yarn complains about [email protected] expecting node 0.8.x HOT 13
- New module idea: descreen/dehalftone/inverse halftone
- Checklist and coordination for v3.8.0 minor release
- Incorrect local path for manipulation.wasm when using as an embedded library in MapKnitter.org
- eslint-error : Expected linebreaks to be 'LF' but found 'CLRF' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image-sequencer.