Comments (7)
I thought there might have been a z-index modifier in L.Popup, but unfortunately there isn't :(
The reason why this is happening is because I add the labels to the same Leaflet container as the popups. We could add a new container that is positioned under the popup one. I'll need to think about it.
You could use Leaflet.iconlabel which provides similar functionality, but stores the label element at the same level as the marker icon.
from leaflet.label.
Static labels are now added to the marker pane and synced up with the z-index of the marker. This should mean they are always behind popups.
from leaflet.label.
wow, works perfectly, thank you! :)
from leaflet.label.
Hi jacobtoye,
unfortunately my website does not work anymore since the update I did just noticed it today.
I display a realtime layer on my map where markers move each 10 seconds, and of course I need to move the labels as well.
I am doing it like this right now:
Vehicle[i].hideLabel();
Vehicle[i].unbindLabel();
Vehicle[i].setLatLng(new L.LatLng(update[i][0],updatei][1]));
Vehicle[i].bindLabel(update[i][3], { noHide: true });
Vehicle[i].showLabel();
Since the update (maybe some older issue, I did not update since january) I am getting the following error:
Uncaught TypeError: Cannot convert null to object leaflet-src.js:403
L.Mixin.Events.removeEventListener leaflet-src.js:403
L.Marker.include.unbindLabel leaflet.label.js:9
$.ajax.success MapFunctions.js:980
fire jquery-1.8.2.js:974
self.fireWith jquery-1.8.2.js:1082
done jquery-1.8.2.js:7788
callback
Leaflet src at line 403 is delete events[objKey][contextId];
So unbindlabel is causing the problem I think
EDIT:
The version from January does not work as well, it tells me: this._label is null after the first bind/unbind
The only version that does work for me is from october 2012 !
So maybe the question is, how should I move a static label with the marker? Seems that my approach is not valid anymore.
from leaflet.label.
I still have labels overlapping popups. Has this issue reappeared?
from leaflet.label.
I, too, am having this problem, and this is with adding the pane: 'markerPane'
option.
This is w/ version 0.2.2-dev.
from leaflet.label.
I solved the problem at least for myself.
this._pane=this._source instanceof L.Marker?t._panes.markerPane:t._panes.popupPane
This suggests that if the source is not on the markerPane (say it's on the overlayPane, like a polygon would be), then the label is placed on the popupPane.
So I just changed this line of code to:
this._pane=this._source instanceof L.Marker?t._panes.markerPane:t._panes.markerPane
It works for my specific use case, in that I only ever have circleMarkers. Despite the documentation, which calls for a pane: 'markerPane'
option, I haven't been able to get that to work. It was persistently putting my labels in the popupPane, and I think this snippet of code shows why.
Again, this is 0.2.2-dev.
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.