diff --git a/src/renderer/components/EditLayer.vue b/src/renderer/components/EditLayer.vue index 31c63e2..9494f50 100644 --- a/src/renderer/components/EditLayer.vue +++ b/src/renderer/components/EditLayer.vue @@ -246,11 +246,23 @@ You should have received a copy of the GNU General Public License along with FG this.groundnetLayerGroup.eachLayer(l => { if (l instanceof L.Polyline) { l.getLatLngs().forEach(l => { - if (l.__vertex && !l.__vertex.getTooltip()) { - l.__vertex.bindTooltip(l.glueindex, {permanent: true}); + if (this.$parent.mapObject.getBounds().contains(l)) { + if (l.__vertex && !l.__vertex.getTooltip()) { + 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); }, @@ -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 () {