Improved Tooltips

dependabot/npm_and_yarn/mathjs-7.5.1
Keith Paterson 3 years ago
parent cfa7a1bf3b
commit cf1c829c11

@ -246,11 +246,23 @@ You should have received a copy of the GNU General Public License along with FG
this.groundnetLayerGroup.eachLayer(l => { this.groundnetLayerGroup.eachLayer(l => {
if (l instanceof L.Polyline) { if (l instanceof L.Polyline) {
l.getLatLngs().forEach(l => { l.getLatLngs().forEach(l => {
if (this.$parent.mapObject.getBounds().contains(l)) {
if (l.__vertex && !l.__vertex.getTooltip()) { if (l.__vertex && !l.__vertex.getTooltip()) {
l.__vertex.bindTooltip(l.glueindex, {permanent: true}); l.__vertex.bindTooltip(l.glueindex, {permanent: true});
} }
}
}); });
} }
if (l instanceof L.ParkingSpot) {
if (this.$parent.mapObject.getBounds().contains(l.getLatLng())) {
var parkingHub = l.glueindex + " " + l.options.attributes.name + " " + l.options.attributes.number;
if(l.box) {
l.box.bindTooltip(parkingHub, {permanent: true, direction: 'right'});
} else {
l.bindTooltip(parkingHub, {permanent: true, direction: 'right'});
}
}
}
}); });
setTimeout(this.closeTooltips.bind(this), 2000); setTimeout(this.closeTooltips.bind(this), 2000);
}, },
@ -263,6 +275,13 @@ You should have received a copy of the GNU General Public License along with FG
} }
}); });
} }
if (l instanceof L.ParkingSpot) {
if(l.box) {
l.box.unbindTooltip();
} else {
l.unbindTooltip();
}
}
}); });
}, },
disableEdit () { disableEdit () {

Loading…
Cancel
Save