Comments (2)
The way Leaflet treats markers added to the map is the further down the screen the marker is the higher of a z-index it is given. This is why you are seeing the behavior where markers with a slightly less latitude are displaying over the higher ones. Labels are paired with a markers so that the label will match the markers z-index.
In cases where you want the label to show above everything else you can use the option riseOnHover: true
when creating the marker (http://leafletjs.com/reference.html#marker-riseonhover). Since the label matches the marker this will mean both he marker and the label are displayed over everything.
You probably want to use this option anyway as it would be unusual for the label only to come to the front when you mouse over the marker. This is more apparent when the markers themselves overlap (zoom the map out in your example).
Regarding the rules, I understand what you are getting at. However for 1 this behavior is strange when you have a cluster of labels and markers. You would not see any markers behind the labels and would not be able to determine the marker-label pairs. I think 2 is fixed by using the riseOnHover
property.
from leaflet.label.
I completely missed the riseOnHover. This seems to address the issues. Thanks!
from leaflet.label.
Related Issues (20)
- labels not moving after panTo in Leaflet HOT 5
- Click event when dragging from label HOT 2
- Display label in center of Circle permanently HOT 2
- Label on geoJson Layer HOT 1
- Change noHide option at high zoom levels
- Some labels not displayed when removing layer and re-adding it while using Leaflet.markercluster HOT 4
- About maintainer on npm
- Labels are not removed from Map under IE11/Edge HOT 1
- Bad positionning when noHide with Leaflet.markerCluster HOT 6
- Maximum call stack size exceeded when loading Leaflet.label HOT 8
- leaflet.label plugin error HOT 1
- Cannot set property 'labelVersion' of undefined HOT 3
- Version 0.2.4 does not work together with ui-leaflet 1.0.1
- RTL support
- overlapping labels
- Leaflet.label 0.2.4 is not compliant with leaflet 1.0.2 HOT 2
- L.bindTooltip throws error in console HOT 5
- labels outside polygon
- Claim: bottom label
- Archiv this repo 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 leaflet.label.