show upper labels if there's still space for them
This commit is contained in:
parent
f8e6080941
commit
ae4c96f678
1 changed files with 10 additions and 2 deletions
|
@ -324,16 +324,24 @@ c3nav = {
|
||||||
zoom = c3nav.map.getZoom();
|
zoom = c3nav.map.getZoom();
|
||||||
if (!labels) return;
|
if (!labels) return;
|
||||||
|
|
||||||
|
var valid_upper = [];
|
||||||
for (var location of labels) {
|
for (var location of labels) {
|
||||||
if (zoom < (location.label_settings.min_zoom || -10)) {
|
if (zoom < (location.label_settings.min_zoom || -10)) {
|
||||||
// since the labels are sorted by min_zoom, we can just leave here
|
// since the labels are sorted by min_zoom, we can just leave here
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (bounds.contains(location.label.getLatLng()) &&
|
if (bounds.contains(location.label.getLatLng())) {
|
||||||
(location.label_settings.max_zoom || 10) > zoom) {
|
if ((location.label_settings.max_zoom || 10) > zoom) {
|
||||||
|
c3nav._labelLayer._maybeAddLayerToRBush(location.label);
|
||||||
|
} else {
|
||||||
|
valid_upper.unshift(location);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (location of valid_upper) {
|
||||||
c3nav._labelLayer._maybeAddLayerToRBush(location.label);
|
c3nav._labelLayer._maybeAddLayerToRBush(location.label);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
load_location_details: function (location) {
|
load_location_details: function (location) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue