Code Monkey home page Code Monkey logo

Comments (12)

envirospatial avatar envirospatial commented on July 21, 2024

Hi Kopleman,

I noticed the same issue. I check my code and noticed that the map pane than contains my geoJson layer zIndex property was set at 680. I lowered it to 250 and it works fine.

from leaflet-measure.

Kopleman avatar Kopleman commented on July 21, 2024

Doesnt work for me becouze all html elements(circles and plugin's svgs) lay in same div

from leaflet-measure.

brandoncopeland avatar brandoncopeland commented on July 21, 2024

When a measurement is started, a marker with z-index of 1000 is placed on the map, and click events on that marker are used to add new points to the measurement. The z-index is set to ensure this marker is "above" all other elements. Is that not the case in your situation? Are other elements receiving the click event instead? What are their z-indexes?

from leaflet-measure.

Kopleman avatar Kopleman commented on July 21, 2024

2017-03-01_09-49-42
At screen when the cursor over the red circle(L.Circle element) clicks are not registred.
The <svg> and its <g> dont have z-index.

from leaflet-measure.

tomchadwin avatar tomchadwin commented on July 21, 2024

I'm having the same issue. I've used captureZIndex: 10000, but vertices are still not created if I click on a feature. The pane the feature is in has zIndex 602.

I'd really like to get a solution to this. I have used the a different Leaflet plugin for measurement in my qgis2web plugin. However, it has stopped working. I would like to switch to this plugin for Leaflet measurement functionality, but I hoped this issue was sorted.

Is there anything I can do to help try to fix this issue?

from leaflet-measure.

brandoncopeland avatar brandoncopeland commented on July 21, 2024

@Kopleman @tomchadwin Do you have an application demonstrating the issue that I can checkout? Or maybe recreate with a Plunker?

from leaflet-measure.

brandoncopeland avatar brandoncopeland commented on July 21, 2024

The general design if it helps troubleshoot.. When a measure is started, a marker 2X the size of the map is is added to the leaflet-marker-pane at the captureZIndex configured. The leaflet-marker-pane is the topmost leaflet pane, above the leaflet-overlay-pane containing vector layers, so there is typically no conflict.

Also, at what versions of Leaflet and leaflet-measure are you seeing this?

from leaflet-measure.

tomchadwin avatar tomchadwin commented on July 21, 2024

Leaflet 1.0.3
leaflet-measure 2.1.7

Are zIndices local to Leaflet panes? I am creating a pane for each layer, the panes have zIndex 600 + n, n being a simple count of the layers in the map. In my example page, my layers are in panes with zIndices 600-602.

I can try to create a Plunker or equivalent, but I am not writing the Leaflet code from scratch - qgis2web is exporting it. It's therefore likely to be a bit more complex than you would like for a minimal example.

from leaflet-measure.

tomchadwin avatar tomchadwin commented on July 21, 2024

OK, I see the issue now - the leaflet-marker-pane has zIndex = 600, so my map panes are higher. Let me see whether I am creating my new panes too high - I thought they were at an appropriate zIndex, but I probably misunderstood the Leaflet pane hierarchy.

from leaflet-measure.

tomchadwin avatar tomchadwin commented on July 21, 2024

Confirmed: if I drop my panes down to 400 + n, measure clicks don't reveal feature popups. Apologies for the noise. It would probably be worth adding some info about Leaflet panes into the docs (it might be there already - in which case, apologies).

Thanks for the help.

from leaflet-measure.

tomchadwin avatar tomchadwin commented on July 21, 2024

Update: I was a little confused, when I changed my panes' zIndices to 400-2 that, although it was working, the measure lines were appearing below these layers. Investigating showed that the measure lines were appearing in the leaflet-overlay-pane, not the leaflet-marker-pane. Since that has zIndex = 400, we see the issue. Are you sure the measure lines are intended to appear in the pane?

Update - apologies again. It's your big transparent click-blocking rectangle which goes in the marker-pane, and the visible measurement lines etc go into the overlay-pane. Got it.

from leaflet-measure.

lailamt avatar lailamt commented on July 21, 2024

I'm working on a project and got the same issue with the measure tool. After read lots of threads of issues I fixed the problem changing z-index of the leaflet-overlay-pane class. Now it works fine in all browsers except IE... Don't know if it's the best solution though.

from leaflet-measure.

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.