Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
vMap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open source
vMap
Commits
96e22dce
Commit
96e22dce
authored
6 years ago
by
Armand Bahi
Browse files
Options
Downloads
Plain Diff
Merge branch 'next_version' into pre-2018.04.00
parents
a29e52ba
a1c50ecd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
module/javascript/app/vmap/tools/print.js
+28
-44
28 additions, 44 deletions
module/javascript/app/vmap/tools/print.js
with
28 additions
and
44 deletions
module/javascript/app/vmap/tools/print.js
+
28
−
44
View file @
96e22dce
...
...
@@ -161,11 +161,23 @@ nsVmap.nsToolsManager.Print.prototype.printController = function ($timeout, $com
this
.
template_
;
/**
* Size of the printZone
* Size of the
map
printZone
* @private
*/
this
.
printedMapSize_
;
/**
* Size of the compare map printZone
* @private
*/
this
.
printedCompareMapSize_
;
/**
* Size of the overview map printZone
* @private
*/
this
.
printedOverviewMapSize_
;
/**
* this.printedMapSize_ resize coeff
* @private
...
...
@@ -363,10 +375,10 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.loadModelParmas2
oVmap
.
log
(
'
nsVmap.nsToolsManager.Print.printController.loadModelParmas2
'
);
// Récupère la taille de la carte this.printedMapSize_ ainsi que le coefficient this.resizeCoeff_
oPrintMapSize
=
this
.
getPrintedMapSize
(
this
.
template_
);
this
.
printedMapSize_
=
this
.
getPrintedMapSize
(
this
.
template_
,
'
#map1
'
,
'
#map_image
'
);
this
.
printedOverviewMapSize_
=
this
.
getPrintedMapSize
(
this
.
template_
,
'
#map1
'
,
'
#map_overview
'
);
this
.
printedMapSize_
=
oPrintMapSize
.
printedMapSize
;
this
.
resizeCoeff_
=
oPrintMapSize
.
resizeCoeff
;
this
.
resizeCoeff_
=
this
.
printedMapSize_
.
resizeCoeff
;
// Pré-rempli le champ "Résolution"
this
[
'
resolution
'
]
=
this
.
resizeCoeff_
;
...
...
@@ -375,20 +387,21 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.loadModelParmas2
this
[
'
currentScale
'
]
=
oVmap
.
getMap
().
getPrettyScale
(
oVmap
.
getMap
().
getScale
()
/
this
.
resizeCoeff_
);
// Dessine un carré d'impression à chaque mouvement de la carte
this
.
printBox_
.
setSize
(
this
.
printedMapSize_
);
this
.
printBox_
.
setSize
(
this
.
printedMapSize_
.
printedMapSize
);
this
.
printBox_
.
show
();
if
(
this
.
$scope_
[
"
$root
"
][
"
compare_enabled
"
]){
this
.
oComparePrintMapSize
=
this
.
getPrintedMapSize
(
this
.
template_
,
"
#map1Compare
"
,
"
#map_image_compare
"
);
if
(
this
.
oComparePrintMapSize
!==
0
){
this
.
printedCompareMapSize_
=
this
.
getPrintedMapSize
(
this
.
template_
,
"
#map1Compare
"
,
"
#map_image_compare
"
);
if
(
this
.
printedCompareMapSize_
!==
0
){
// Pré-rempli le champ "Résolution"
this
[
'
resolutionCompare
'
]
=
this
.
o
Compare
Print
MapSize
.
resizeCoeff
;
this
[
'
resolutionCompare
'
]
=
this
.
printed
CompareMapSize
_
.
resizeCoeff
;
// Ajuste l'échelle avec le niveau de détail
this
[
'
currentScaleCompare
'
]
=
oVmap
.
getMapCompare
().
getPrettyScale
(
oVmap
.
getMapCompare
().
getScale
()
/
this
.
o
Compare
Print
MapSize
.
resizeCoeff
);
this
[
'
currentScaleCompare
'
]
=
oVmap
.
getMapCompare
().
getPrettyScale
(
oVmap
.
getMapCompare
().
getScale
()
/
this
.
printed
CompareMapSize
_
.
resizeCoeff
);
// Dessine un carré d'impression à chaque mouvement de la carte
this
.
printBoxCompare_
.
setSize
(
this
.
o
Compare
Print
MapSize
.
printedMapSize
);
this
.
printBoxCompare_
.
setSize
(
this
.
printed
CompareMapSize
_
.
printedMapSize
);
this
.
printBoxCompare_
.
show
();
}
else
{
this
.
printBoxCompare_
.
hide
();
...
...
@@ -480,6 +493,7 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.getPrintedMapSiz
return
{
printedMapSize
:
[
mapWidth
,
mapHeight
],
realSize
:
[
imageDiv
.
width
(),
imageDiv
.
height
()],
resizeCoeff
:
resizeCoeff
}
};
...
...
@@ -583,7 +597,7 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.prepareAndLaunch
// récupération des infos pour la carte de comparaison si le mode comparaison est actif
if
(
this
.
$scope_
[
'
$root
'
][
"
compare_enabled
"
]){
if
(
this
.
o
Compare
Print
MapSize
!==
0
){
if
(
this
.
printed
CompareMapSize
_
!==
0
){
// Enregistre l'échelle actuelle
this
.
currentScaleCompare_
=
oVmap
.
getMapCompare
().
getScale
({
'
pretty
'
:
true
...
...
@@ -703,12 +717,9 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.print = function
var
sFormat
=
response
[
'
data
'
][
'
data
'
][
0
][
'
rt_format_id
'
];
var
sOrientation
=
response
[
'
data
'
][
'
data
'
][
0
][
'
rt_orientation_id
'
];
var
template
=
document
.
createElement
(
"
div
"
);
template
.
innerHTML
=
response
[
'
data
'
][
'
data
'
][
0
][
'
definition
'
];
var
mapImageSize
=
this_
.
getTemplateTargetSize
(
template
,
'
#map_image
'
);
var
mapImageSizeCompare
=
this_
.
getTemplateTargetSize
(
template
,
'
#map_image_compare
'
);
var
overviewSize
=
this_
.
getTemplateTargetSize
(
template
,
'
#map_overview
'
);
var
mapImageSize
=
this_
.
printedMapSize_
.
realSize
;
var
mapImageSizeCompare
=
this_
.
printedCompareMapSize_
.
realSize
;
var
overviewSize
=
this_
.
printedOverviewMapSize_
.
realSize
;
var
oJsonDefOptions
=
{
mapId
:
opt_options
.
mapId
,
...
...
@@ -919,33 +930,6 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.getMapsJsonDef =
return
mapsJson
;
}
/**
* Get the size of a target in a template
* @param {string} template
* @param {string} target
* @returns {Array<Number>|undefined}
*/
nsVmap
.
nsToolsManager
.
Print
.
prototype
.
printController
.
prototype
.
getTemplateTargetSize
=
function
(
template
,
target
)
{
var
targetDiv
=
$
(
template
).
find
(
target
);
// Vérifie la présence de '#map_image'
if
(
!
goog
.
isDef
(
targetDiv
.
get
(
0
)))
{
oVmap
.
log
(
'
Aucune balise
'
+
target
+
'
trouvée dans le template
'
);
return
undefined
;
}
$
(
'
body
'
).
append
(
template
);
var
targetHeight
=
targetDiv
.
height
();
var
targetWidth
=
targetDiv
.
width
();
// Supprime le template du body de Vmap
$
(
template
).
remove
();
return
[
targetWidth
,
targetHeight
];
};
/**
* Get the html definition of the template with base64 images
* @param {string} sTarget
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment