Code Monkey home page Code Monkey logo

Comments (9)

jywarren avatar jywarren commented on July 2, 2024

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.

ccpandhare avatar ccpandhare commented on July 2, 2024

Sorry, I am still unable to make out...
What are we trying to accomplish with leaflet.js?

from image-sequencer.

jywarren avatar jywarren commented on July 2, 2024

from image-sequencer.

jywarren avatar jywarren commented on July 2, 2024

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.

ccpandhare avatar ccpandhare commented on July 2, 2024

This looks nice!

from image-sequencer.

jywarren avatar jywarren commented on July 2, 2024

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.

grvsachdeva avatar grvsachdeva commented on July 2, 2024

@jywarren you want to open a new issue using this one? Thanks!

from image-sequencer.

jywarren avatar jywarren commented on July 2, 2024

Which part do you think? Breaking it out as a plugin? Thanks, Gaurav?

from image-sequencer.

jywarren avatar jywarren commented on July 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.