Code Monkey home page Code Monkey logo

Comments (4)

danzel avatar danzel commented on August 12, 2024

You add listeners on each of them and handle them like normal.

I'm not sure what you mean by your second question, all grid layers should be in the same position?

from leaflet.utfgrid.

webdobe avatar webdobe commented on August 12, 2024

I have added listeners to both. But the layer below the other grid layer does not know if it is being moused. I find no evidence that all grid layers are the same position. Even if I am using mapboxes swipe layers example what I want to achieve is being a pain.

This is kind of a bad example since I am using 2 separate maps http://widash.visiontech360.com/console/broadband_slider_map but I would still like to be able to trigger the hover of one maps grid layer based on the others. That would allow for my mouse events to activate both sets of data. SO when I am hovering the top slider layer I would see grid data for both allowing for better comparing. After all that is what that ui is for.

from leaflet.utfgrid.

webdobe avatar webdobe commented on August 12, 2024

I guess I can try and add listeners to the top layer for every layer underneath. I will try this and let known if it works.

from leaflet.utfgrid.

danzel avatar danzel commented on August 12, 2024

To use it across 2 maps you'll need to do some dodgyness:

Listen for mouse events on both maps so you get latlng's.

Call the _objectForEvent method on your grid layer, passing your mouse event.
See: https://github.com/danzel/Leaflet.utfgrid/blob/master/src/leaflet.utfgrid.js#L122

You'll get the same object back that the events usually fire.

Hopefully this gets you there!

from leaflet.utfgrid.

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.