Mercurial > gemma
comparison client/src/components/Pdftool.vue @ 2259:7e378b38d302
client: pdf-gen: made selectedSurvey mandatory for displaying the bottleneck info box and iso line legend.
The code for the info box needs a selected survey although it's possible to have only a bottleneck selected but no survey. So requiring a selectedSurvey for printing this box (and legend) was the simplest way of fixng that.
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Thu, 14 Feb 2019 10:09:23 +0100 |
parents | 24cafd6b1a55 |
children | 531e776cb81d |
comparison
equal
deleted
inserted
replaced
2258:24cafd6b1a55 | 2259:7e378b38d302 |
---|---|
631 this.pdf.doc.text(size < 3 ? x1 - 0.5 : x1 - 1.3, y3 + 1, "N"); | 631 this.pdf.doc.text(size < 3 ? x1 - 0.5 : x1 - 1.3, y3 + 1, "N"); |
632 }, | 632 }, |
633 addLegend(position, offset, rounding) { | 633 addLegend(position, offset, rounding) { |
634 if ( | 634 if ( |
635 this.selectedBottleneck && | 635 this.selectedBottleneck && |
636 this.selectedSurvey && | |
636 this.getLayerByName("Bottleneck isolines").isVisible | 637 this.getLayerByName("Bottleneck isolines").isVisible |
637 ) { | 638 ) { |
638 // transforming into an HTMLImageElement only to find out | 639 // transforming into an HTMLImageElement only to find out |
639 // the width x height of the legend image | 640 // the width x height of the legend image |
640 // FUTURE: find a better way to get the width and height | 641 // FUTURE: find a better way to get the width and height |
669 } | 670 } |
670 }, | 671 }, |
671 addBottleneckInfo(position, offset, rounding, color) { | 672 addBottleneckInfo(position, offset, rounding, color) { |
672 if ( | 673 if ( |
673 this.selectedBottleneck && | 674 this.selectedBottleneck && |
675 this.selectedSurvey && | |
674 this.getLayerByName("Bottleneck isolines").isVisible | 676 this.getLayerByName("Bottleneck isolines").isVisible |
675 ) { | 677 ) { |
676 let survey = this.selectedSurvey; | 678 let survey = this.selectedSurvey; |
677 | 679 |
678 // determine text dimensions | 680 // determine text dimensions |