Skip to content
Snippets Groups Projects
Commit 9b919e1e authored by Armand Bahi's avatar Armand Bahi
Browse files

Merge branch 'bug/43-probleme-lors-de-la-generation-de-la-fiche-urba' into 'master'

Resolve "Problème lors de la génération de la fiche urba"

Closes #43

See merge request Development/vitis_apps/application/vmap!36
parents 25377003 a126bf3a
No related branches found
No related tags found
No related merge requests found
...@@ -1279,6 +1279,7 @@ nsVmap.nsToolsManager.nsModules.Cadastre.prototype.cadastreController.prototype. ...@@ -1279,6 +1279,7 @@ nsVmap.nsToolsManager.nsModules.Cadastre.prototype.cadastreController.prototype.
templateId: oVmap['properties']['cadastre']["fiche_urb"]['printtemplate_id'], templateId: oVmap['properties']['cadastre']["fiche_urb"]['printtemplate_id'],
mapId: oVmap['properties']['cadastre']["fiche_urb"]['map_id'], mapId: oVmap['properties']['cadastre']["fiche_urb"]['map_id'],
features: [feature], features: [feature],
recalcSize: true,
featuresZoom: oVmap['properties']['cadastre']["fiche_urb"]['features_zoom'] featuresZoom: oVmap['properties']['cadastre']["fiche_urb"]['features_zoom']
}); });
}; };
......
...@@ -444,10 +444,12 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.setTemplate = fu ...@@ -444,10 +444,12 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.setTemplate = fu
this.$compile_(template)(this.$scope_); this.$compile_(template)(this.$scope_);
this_.template_ = template; this_.template_ = template;
if (goog.isDefAndNotNull(callback)) {
setTimeout(function () { setTimeout(function () {
callback.call(this_, [template]); callback.call(this_, [template]);
}); });
} }
}
}; };
/** /**
...@@ -626,6 +628,7 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.prepareAndLaunch ...@@ -626,6 +628,7 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.prepareAndLaunch
* @param {number|undefined} opt_options.resolutionCoeff * @param {number|undefined} opt_options.resolutionCoeff
* @param {array<ol.Feature>|undefined} opt_options.features feature to zoom on * @param {array<ol.Feature>|undefined} opt_options.features feature to zoom on
* @param {number|undefined} opt_options.featuresZoom * @param {number|undefined} opt_options.featuresZoom
* @param {boolean|undefined} opt_options.recalcSize true pour recalculer la taille au moment de l'impression (utilisé pour module cadastre)
* @returns {number} 1 if all semms good * @returns {number} 1 if all semms good
* @export * @export
*/ */
...@@ -717,6 +720,17 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.print = function ...@@ -717,6 +720,17 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.print = function
var sFormat = response['data']['data'][0]['rt_format_id']; var sFormat = response['data']['data'][0]['rt_format_id'];
var sOrientation = response['data']['data'][0]['rt_orientation_id']; var sOrientation = response['data']['data'][0]['rt_orientation_id'];
// Cas d'utilisation de la fonction print sans passer par le forumlaire
if (opt_options.recalcSize === true ||
!goog.isDefAndNotNull(this.printedMapSize_) ||
!goog.isDefAndNotNull(this_.printedOverviewMapSize_)) {
this_.setTemplate({
'definition': response['data']['data'][0]['definition']
});
this_.printedMapSize_ = this_.getPrintedMapSize(this_.template_, '#map1', '#map_image');
this_.printedOverviewMapSize_ = this_.getPrintedMapSize(this_.template_, '#map1', '#map_overview');
}
var mapImageSize = this_.printedMapSize_.realSize; var mapImageSize = this_.printedMapSize_.realSize;
var overviewSize = this_.printedOverviewMapSize_.realSize; var overviewSize = this_.printedOverviewMapSize_.realSize;
...@@ -788,6 +802,8 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.print = function ...@@ -788,6 +802,8 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.print = function
$.notify('Impression réussie', 'success'); $.notify('Impression réussie', 'success');
printWindow.location.href = response['data']['printtemplateservices']['image']; printWindow.location.href = response['data']['printtemplateservices']['image'];
delete this_.printedMapSize_;
delete this_.printedOverviewMapSize_;
}, },
'error': function (response) { 'error': function (response) {
console.error(response); console.error(response);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment