show upper labels if there's still space for them

This commit is contained in:
Laura Klünder 2019-12-22 23:36:03 +01:00
parent f8e6080941
commit ae4c96f678

View file

@ -324,16 +324,24 @@ c3nav = {
zoom = c3nav.map.getZoom();
if (!labels) return;
var valid_upper = [];
for (var location of labels) {
if (zoom < (location.label_settings.min_zoom || -10)) {
// since the labels are sorted by min_zoom, we can just leave here
break;
}
if (bounds.contains(location.label.getLatLng()) &&
(location.label_settings.max_zoom || 10) > zoom) {
if (bounds.contains(location.label.getLatLng())) {
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);
}
},
load_location_details: function (location) {