Mercurial > gemma
comparison client/src/components/Pdftool.vue @ 2737:4a5c0e7cb75b
client:pdf-gen: add template element
* add new template element to show the map scale and paper size
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Tue, 19 Mar 2019 18:07:50 +0100 |
parents | 4dd38840d74b |
children | d0f6c222f4f9 |
comparison
equal
deleted
inserted
replaced
2736:017b1c0decfd | 2737:4a5c0e7cb75b |
---|---|
389 e.rounding === 0 || e.rounding ? e.rounding : defaultRounding, | 389 e.rounding === 0 || e.rounding ? e.rounding : defaultRounding, |
390 e.brcolor || defaultBorderColor | 390 e.brcolor || defaultBorderColor |
391 ); | 391 ); |
392 break; | 392 break; |
393 } | 393 } |
394 case "scale": { | |
395 this.addScale( | |
396 scaleNominator, | |
397 e.position, | |
398 e.width, | |
399 e.offset || defaultOffset, | |
400 e.fontSize || defaultFontSize, | |
401 e.color || defaultTextColor | |
402 ); | |
403 break; | |
404 } | |
394 case "northarrow": { | 405 case "northarrow": { |
395 this.addNorthArrow( | 406 this.addNorthArrow( |
396 e.position, | 407 e.position, |
397 e.offset || defaultOffset, | 408 e.offset || defaultOffset, |
398 e.size | 409 e.size |
428 this.rendercompleteListener.listener | 439 this.rendercompleteListener.listener |
429 ); | 440 ); |
430 this.openLayersMap.setSize(this.mapSize); | 441 this.openLayersMap.setSize(this.mapSize); |
431 this.openLayersMap.getView().fit(this.mapExtent, { size: this.mapSize }); | 442 this.openLayersMap.getView().fit(this.mapExtent, { size: this.mapSize }); |
432 this.readyToGenerate = true; | 443 this.readyToGenerate = true; |
444 }, | |
445 // add the used map scale and papersize | |
446 addScale(scalenominator, position, width, offset, fontSize, color) { | |
447 //TODO: check the correctence of the scalnominator value here. | |
448 let str = | |
449 this.$gettext("Scale") + | |
450 " 1 : " + | |
451 scalenominator + | |
452 " " + | |
453 "(DIN" + | |
454 " " + | |
455 this.form.paperSize.toUpperCase() + | |
456 ")"; | |
457 this.addText(position, offset, width, fontSize, color, str); | |
433 }, | 458 }, |
434 addRoundedBox(x, y, w, h, color, rounding, brcolor) { | 459 addRoundedBox(x, y, w, h, color, rounding, brcolor) { |
435 // draws a rounded background box at (x,y) width x height | 460 // draws a rounded background box at (x,y) width x height |
436 // using jsPDF units | 461 // using jsPDF units |
437 this.pdf.doc.setDrawColor(brcolor); | 462 this.pdf.doc.setDrawColor(brcolor); |