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

Merge branch 'feature/impressions_144dpi' into 'master'

Increase the WMS symbols size to match resolution

See merge request Development/vitis_apps/sources/vitis!5
parents 35163699 38bafafa
Branches
No related tags found
No related merge requests found
......@@ -63,6 +63,9 @@ PrintMap = function (opt_options) {
// Supprime tous les controls par défaut
this.removeMapControls();
// Taille des icones en fonction de la résolution demandée
this.setMapSymbolsResolution(this.map, this.resolutionCoeff)
// Si aucune étendue a été donnée et que seul un point a été donné, alors zoom sur this.defaultScale
if (!isDef(opt_options.extent) && !isDef(this.features)) {
if (this.features.length === 1 && this.features[0].getGeometry().getType() === 'Point') {
......@@ -368,3 +371,20 @@ PrintMap.prototype.getGeomFromEWKT = function (EWKTGeom, proj) {
}
};
/**
* For WMS layers set MAP.RESOLUTION and MAP.DEFRESOLUTION to rise the symbols size
*
* @param {object} olMap
* @param {integer} resolutionCoeff
*/
PrintMap.prototype.setMapSymbolsResolution = function (olMap, resolutionCoeff) {
var newRes = resolutionCoeff * 72;
var aLayers = olMap.getLayers().getArray();
for (var i = 0; i < aLayers.length; i++) {
if (aLayers[i].get('type') === 'imagewms' || aLayers[i].get('type') === 'tilewms') {
aLayers[i].getSource().updateParams({'MAP.RESOLUTION': newRes, 'MAP.DEFRESOLUTION': 72});
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment