diff --git a/src/module_vmap/module/javascript/app/vmap/mapmanager/mapmanager.js b/src/module_vmap/module/javascript/app/vmap/mapmanager/mapmanager.js index 39bb4e0fdbd795ee3976ce6350430882451cd08f..e3373e5ecdddf34f2da578fbcc5916f4284c67b0 100644 --- a/src/module_vmap/module/javascript/app/vmap/mapmanager/mapmanager.js +++ b/src/module_vmap/module/javascript/app/vmap/mapmanager/mapmanager.js @@ -1638,3 +1638,21 @@ nsVmap.nsMapManager.MapManager.prototype.getInsertableBusinessObjects = function return aInsertableBOs; }; + +/** + * Measure features getter + * + * @return {array} + */ +nsVmap.nsMapManager.MapManager.prototype.getMeasureFeatures = function () { + + var oMeasureScope = angular.element($('[app-measure]').children()).scope(); + var aMeasureFeatures = oMeasureScope['ctrl'].oOpenLayersMeasureOverlayFeatures_.getArray(); + + return aMeasureFeatures; +} + +nsVmap.nsMapManager.MapManager.prototype.getMeasureFeaturesAsGeoJSON = function () { + + aMeasureFeatures = this.getMeasureFeatures(); +} diff --git a/src/module_vmap/module/javascript/app/vmap/tools/measure.js b/src/module_vmap/module/javascript/app/vmap/tools/measure.js index ba56969063fd78c335aa9cc27883aca7701e9072..49786e4049fc529128c43666bd22dc5279a2414b 100755 --- a/src/module_vmap/module/javascript/app/vmap/tools/measure.js +++ b/src/module_vmap/module/javascript/app/vmap/tools/measure.js @@ -386,10 +386,10 @@ nsVmap.nsToolsManager.Measure.prototype.measureController.prototype.createMeasur this.setInfosToFeature(olFeature); if (goog.isDefAndNotNull(this.measureTooltipElementTemp_)) { - + this.measureTooltipElement_.innerHTML = this.measureTooltipElementTemp_.innerHTML; this.measureTooltipElementTemp_.style.display = 'none'; - + } else { this.measureTooltipElement_.innerHTML = ''; @@ -546,6 +546,9 @@ nsVmap.nsToolsManager.Measure.prototype.measureController.prototype.setInfosToFe // Projection olFeature.set('Projection', this['map'].getView().getProjection().getCode()); + olFeature.set('geom_center', olFeature.getGeometry().getCenter()); + olFeature.set('geom_radius', olFeature.getGeometry().getRadius()); + } else { // Type olFeature.set('Type', 'undefined'); @@ -1128,4 +1131,4 @@ nsVmap.nsToolsManager.Measure.prototype.measureController.prototype.mobileDelete // Définit la directive et le controller oVmap.module.directive('appMeasure', nsVmap.nsToolsManager.Measure.prototype.measureDirective); -oVmap.module.controller('AppmeasureController', nsVmap.nsToolsManager.Measure.prototype.measureController); \ No newline at end of file +oVmap.module.controller('AppmeasureController', nsVmap.nsToolsManager.Measure.prototype.measureController); diff --git a/src/module_vmap/module/javascript/app/vmap/tools/print.js b/src/module_vmap/module/javascript/app/vmap/tools/print.js index 13e0f6d43a5fb86dd1e0793ff1525a97301051cd..a4da24b2226efaebd24a242eb9e0ac342265eb0e 100644 --- a/src/module_vmap/module/javascript/app/vmap/tools/print.js +++ b/src/module_vmap/module/javascript/app/vmap/tools/print.js @@ -592,6 +592,7 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.prepareAndLaunch var aLocationOverlayFeatures = oVmap.getMap().getLocationOverlayFeatures().getArray(); var aPopupOverlayFeatures = oVmap.getMap().getPopupOverlayFeatures().getArray(); var aSelectionOverlayFeatures = oVmap.getMap().getSelectionOverlayFeatures().getArray(); + var aMeasureFeatures = oVmap.getMapManager().getMeasureFeatures(); var oPrintOptions = { scope: scope, @@ -599,6 +600,7 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.prepareAndLaunch templateId: templateId, printStyleId: this.$scope_['selectedPrintstyleId'], resolutionCoeff: this['dpi'], + measureFeatures: aMeasureFeatures, features: goog.array.concat(aLocationOverlayFeatures, aPopupOverlayFeatures, aSelectionOverlayFeatures) }; @@ -743,6 +745,7 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.print = function extent: opt_options.extent, features: opt_options.features, featuresZoom: opt_options.featuresZoom, + measureFeatures: opt_options.measureFeatures, mapImageSize: mapImageSize, overviewSize: overviewSize } @@ -889,6 +892,15 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.getMapsJsonDef = sFeaturesZoom = oVmap['properties']['print']['features_zoom']; } + // Measures + var oMeasureFeatures = null; + if (goog.isArray(opt_options.measureFeatures)) { + if (opt_options.measureFeatures.length > 0) { + oMeasureFeatures = ol.getGeoJSONFromFeatures(opt_options.measureFeatures, + oVmap.getMap().getOLMap().getView().getProjection().getCode()); + } + } + if (goog.isDefAndNotNull(opt_options.mapImageSize)) { var oMapDef = { 'map_id': sMapId, @@ -899,6 +911,9 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.getMapsJsonDef = 'features': sEWKTFeatures, 'features_zoom': sFeaturesZoom }; + if (goog.isDefAndNotNull(oMeasureFeatures)) { + oMapDef['measure_features'] = oMeasureFeatures; + } } if (goog.isDefAndNotNull(opt_options.overviewSize)) { diff --git a/src/module_vmap/web_service/ws/PrintMapServices.class.inc b/src/module_vmap/web_service/ws/PrintMapServices.class.inc index 8c656d82a79f0611936a05c7a3bb8220adcab8db..a70672de6b20056261f8e97db20b2dde95dda170 100755 --- a/src/module_vmap/web_service/ws/PrintMapServices.class.inc +++ b/src/module_vmap/web_service/ws/PrintMapServices.class.inc @@ -199,7 +199,12 @@ class PrintMapServices extends PrintServices { $sFeaturesZoom = $this->aValues['features_zoom']; /** - * Map features zoom + * Measure features + */ + $aMeasureFeatures = $this->aValues['measure_features']; + + /** + * Map resolution coef */ $sResolutionCoeff = $this->aValues['resolution_coeff']; @@ -253,11 +258,13 @@ class PrintMapServices extends PrintServices { mkdir($this->aProperties['vas_home'] . '/public/vmap/prints', 0777, true); } } + $sMapJSONPath = $this->writeToFile($this->aProperties['vas_home'] . '/public/vmap/prints', 'map_json_' . $sTimestamp, $sMapJSON); $sFeaturesPath = $this->writeToFile($this->aProperties['vas_home'] . '/public/vmap/prints', 'features_' . $sTimestamp, $sFeatures); + $sMeasureFeaturesPath = $this->writeToFile($this->aProperties['vas_home'] . '/public/vmap/prints', 'measure_features_' . $sTimestamp, json_encode($aMeasureFeatures)); // Arguments de la ligne de commande - $aArguments = array($sProjectPath, $sPrintClientrUrl, $RestUrl, $sToken, $sOutputFile, $sMapId, $sMapJSONPath, $sImageSize, $sExtent, $sFeaturesPath, $sFeaturesZoom, $this->aValues['resolution_coeff'], $sQuality); + $aArguments = array($sProjectPath, $sPrintClientrUrl, $RestUrl, $sToken, $sOutputFile, $sMapId, $sMapJSONPath, $sImageSize, $sExtent, $sFeaturesPath, $sFeaturesZoom, $this->aValues['resolution_coeff'], $sQuality, $sMeasureFeaturesPath); // Commande à lancer $sCommand = '"' . $sPhantomjsPath . '" --ignore-ssl-errors=yes --ssl-protocol=any'; diff --git a/src/vitis/client/javascript/externs/openLayers/ol3-veremes/ol.veremes.js b/src/vitis/client/javascript/externs/openLayers/ol3-veremes/ol.veremes.js index d915330eda8e7394e61191beed2608dda9eb93ca..019af82e478da676b68e932baba72c11b23a5131 100755 --- a/src/vitis/client/javascript/externs/openLayers/ol3-veremes/ol.veremes.js +++ b/src/vitis/client/javascript/externs/openLayers/ol3-veremes/ol.veremes.js @@ -2,7 +2,7 @@ /** * @author: Armand Bahi - * @Description: Fichier contenant les fonctions + * @Description: Fichier contenant les fonctions * que Veremes rajoute à la librairie OpenLayers */ @@ -833,7 +833,7 @@ ol.getEWKTFromFeatures = function (aFeatures, proj) { }; /** - * Return true if EWKTGeom is an EWKT geometry + * Return true if EWKTGeom is an EWKT geometry * @param {string} EWKTGeom * @returns {boolean} * @export @@ -885,6 +885,72 @@ ol.getWKTFromFeatures = function(aFeatures, proj){ dataProjection: proj, featureProjection: proj }); - + return WKTGeom; -}; \ No newline at end of file +}; + +/** + * Return a GeoJSON object from a feature + * @param {ol.Feature} aFeature + * @param {String|undefined} proj + * @return {object} GeoJSON object + * @export + */ +ol.getGeoJSONFromFeature = function(oFeature, proj){ + log('ol.getGeoJSONFromFeature', oFeature); + + if (!goog.isDefAndNotNull(oFeature)) { + console.error('oFeature is not defined'); + return null; + } + if (!goog.isString(proj)) { + console.error('proj is not a string'); + return null; + } + if (!proj.indexOf('EPSG:') === 0) { + console.error('proj is not an EPSG code'); + return null; + } + + oGeoJSON = new ol.format.GeoJSON({ + defaultDataProjection: proj, + featureProjection: proj + }); + + oGeoJSONFeature = oGeoJSON.writeFeatureObject(oFeature); + + return oGeoJSONFeature; +} + +/** + * Return a GeoJSON object from an array of features + * @param {array<ol.Feature>} aFeatures + * @param {String|undefined} proj + * @return {object} GeoJSON object + * @export + */ +ol.getGeoJSONFromFeatures = function(aFeatures, proj){ + log('ol.getGeoJSONFromFeatures', aFeatures); + + if (!goog.isDefAndNotNull(aFeatures)) { + console.error('aFeatures is not defined'); + return null; + } + if (!goog.isString(proj)) { + console.error('proj is not a string'); + return null; + } + if (!proj.indexOf('EPSG:') === 0) { + console.error('proj is not an EPSG code'); + return null; + } + + oGeoJSON = new ol.format.GeoJSON({ + defaultDataProjection: proj, + featureProjection: proj + }); + + oGeoJSONFeatures = oGeoJSON.writeFeaturesObject(aFeatures); + + return oGeoJSONFeatures; +} diff --git a/src/vitis/vas/util/printserver/client/map/index.html b/src/vitis/vas/util/printserver/client/map/index.html index cb9a12c5493a0480c52846ed70725481ea6d94bf..fed7b9bc45db16fe31e645f2c55d7caf772a21b5 100755 --- a/src/vitis/vas/util/printserver/client/map/index.html +++ b/src/vitis/vas/util/printserver/client/map/index.html @@ -34,7 +34,41 @@ width: 0; transition: width 250ms; z-index: 2; - } + } + .measure-tooltip { + position: relative; + background: rgba(0, 0, 0, 0.5); + border-radius: 4px; + color: white; + padding: 4px 8px; + opacity: 0.7; + white-space: nowrap; + font-family: arial !important; + line-height: 1.42857143 !important; + } + .measure-tooltip-measure { + opacity: 1; + font-weight: bold; + } + .measure-tooltip-static { + background-color: #ffcc33; + color: black; + border: 1px solid white; + } + .measure-tooltip-measure:before, + .measure-tooltip-static:before { + border-top: 6px solid rgba(0, 0, 0, 0.5); + border-right: 6px solid transparent; + border-left: 6px solid transparent; + content: ""; + position: absolute; + bottom: -6px; + margin-left: -7px; + left: 50%; + } + .measure-tooltip-static:before { + border-top-color: white; + } </style> </head> <body> @@ -49,4 +83,4 @@ <script src="map.js"></script> <script src="index.js"></script> </body> -</html> \ No newline at end of file +</html> diff --git a/src/vitis/vas/util/printserver/client/map/index.js b/src/vitis/vas/util/printserver/client/map/index.js index cb6baf19b992a18303f677ffb47309fc56059f35..b5b0618b635ec8d7b837f9d5f4e55ece3fce88f9 100755 --- a/src/vitis/vas/util/printserver/client/map/index.js +++ b/src/vitis/vas/util/printserver/client/map/index.js @@ -9,9 +9,10 @@ * @param {string} opt_options.mapJSON * @param {array} opt_options.extent * @param {array} opt_options.features + * @param {array} opt_options.measureFeatures */ var initMap = function (opt_options) { - + // Convertit en float l'étendue if (isDef(opt_options.extent)) { for (var i = 0; i < opt_options.extent.length; i++) { @@ -31,11 +32,10 @@ var initMap = function (opt_options) { if (!isDef(opt_options.extent) && !isDef(opt_options.features)) { callError('neither opt_options.extent nor opt_options.features defined'); } - window.oProperties = new nsUtils.Properties(opt_options.apiUrl, opt_options.token); - // Ajoute la définition OpenLayers des projections + // Ajoute la définition OpenLayers des projections window.projections = new Projections(); // Initialise la carte @@ -45,6 +45,7 @@ var initMap = function (opt_options) { extent: opt_options.extent, features: opt_options.features, featuresZoom: opt_options.featuresZoom, + measureFeatures: opt_options.measureFeatures, resolutionCoeff: opt_options.resolutionCoeff, apiUrl: opt_options.apiUrl, token: opt_options.token @@ -54,5 +55,4 @@ var initMap = function (opt_options) { setTimeout(function () { window.oProgress = new Progress(window.oPrintMap, opt_options['displayProgress']); }, 100); - -}; \ No newline at end of file +}; diff --git a/src/vitis/vas/util/printserver/client/map/map.js b/src/vitis/vas/util/printserver/client/map/map.js index d6dcd882b6e15b31919e02a1799a6bb2b0212263..1644b287deb84e28d72ca01da8f77ce1495372e3 100755 --- a/src/vitis/vas/util/printserver/client/map/map.js +++ b/src/vitis/vas/util/printserver/client/map/map.js @@ -37,6 +37,8 @@ PrintMap = function (opt_options) { this.features = isDef(opt_options.features) ? this.getFeaturesFromEWKT(opt_options.features) : null; + this.measureFeatures = isDef(opt_options.measureFeatures) ? this.getFeaturesFromGeoJSON(opt_options.measureFeatures) : null; + this.extent = this.getExtent(opt_options); this.tileGrid = this.getTileGridFromDefinition(this.tileSize); @@ -53,10 +55,20 @@ PrintMap = function (opt_options) { this.scaleTools = new Scale(this.map, this.resolutionCoeff); // Ajoute les features - if (isDef(opt_options.features)) { + if (isDef(this.features)) { this.featuresOverlay.getSource().addFeatures(this.features); } + // Ajoute les measureFeatures + if (isDef(this.measureFeatures)) { + + // Ajout de la couche vecteur + this.measureFeaturesOverlay = this.setMeasureFeaturesOverlay(this.map); + + // Ajout des features dans la couche + this.addMeasureFeatures(this.measureFeatures, this.measureFeaturesOverlay); + } + // Centre la carte sur son étendue this.setMapExtent(this.extent); @@ -293,6 +305,39 @@ PrintMap.prototype.setFeaturesOverlay = function (olMap) { return featuresOverlay; }; +/** + * Set the map measure features overlay + * @param {ol.Map} olMap + * @returns {ol.layer.Vector} + */ +PrintMap.prototype.setMeasureFeaturesOverlay = function (olMap) { + + var featuresOverlay = new ol.layer.Vector({ + map: olMap, + source: new ol.source.Vector({}), + style: new ol.style.Style({ + fill: new ol.style.Fill({ + color: 'rgba(255, 255, 255, 0.2)' + }), + stroke: new ol.style.Stroke({ + color: '#ffcc33', + width: 2 + }), + image: new ol.style.Circle({ + radius: 7, + fill: new ol.style.Fill({ + color: '#ffcc33' + }), + stroke: new ol.style.Stroke({ + color: '#FFFFFF' + }) + }) + }) + }); + + return featuresOverlay; +}; + /** * Get the olFeatures from an array of EWKT features * @param {array<string>} aEWKTFeatures Array of EWKT features @@ -372,6 +417,40 @@ PrintMap.prototype.getGeomFromEWKT = function (EWKTGeom, proj) { }; +/** + * Get the olFeatures from an array of GeoJSON features + * @param {string} sGeoJSONFeatures Array of GeoJSON features + * @returns {array<ol.Feature>} + */ +PrintMap.prototype.getFeaturesFromGeoJSON = function (sGeoJSONFeatures) { + + if (!isDef(sGeoJSONFeatures)) { + callLog('error: sGeoJSONFeatures is not defined'); + return null; + } + + if (!isDef(JSON.parse(sGeoJSONFeatures))) { + callLog('error: sGeoJSONFeatures is not valid JSON'); + return null; + } + + var proj = this.view.getProjection().getCode(); + + oGeoJSON = new ol.format.GeoJSON({ + defaultDataProjection: proj, + featureProjection: proj + }); + + var aFeatures = [] + try { + aFeatures = oGeoJSON.readFeatures(sGeoJSONFeatures); + } catch (e) { + callLog('error: ' + e); + } + + return aFeatures; +}; + /** * For WMS layers set MAP.RESOLUTION and MAP.DEFRESOLUTION to rise the symbols size * @@ -388,3 +467,120 @@ PrintMap.prototype.setMapSymbolsResolution = function (olMap, resolutionCoeff) { } } } + +/** + * addMeasureFeatures function - add the measure features + * + * @param {array<ol.Feature>} aFeatures + */ +PrintMap.prototype.addMeasureFeatures = function (aFeatures, oVectorLayer) { + + callLog('addMeasureFeatures, ' + aFeatures); + + // Ajoute les features + for (var i = 0; i < aFeatures.length; i++) { + + // Cercles + if (aFeatures[i].get('Type') === 'Cercle') { + if (isDef(aFeatures[i].get('geom_center')) && + isDef(aFeatures[i].get('geom_radius'))) { + aFeatures[i].setGeometry(new ol.geom.Circle( + aFeatures[i].get('geom_center'), + aFeatures[i].get('geom_radius'))); + } + } + + oVectorLayer.getSource().addFeature(aFeatures[i]); + } + + // Ajoute les tooltip + for (var i = 0; i < aFeatures.length; i++) { + this.createMeasureTooltip(aFeatures[i]); + } +} + +/** + * createMeasureTooltip function - Create a measure feature tooltip + * + * @param {ol.Feature} olFeature + */ +PrintMap.prototype.createMeasureTooltip = function (olFeature) { + + oMeasureTooltipElement = document.createElement('div'); + oMeasureTooltipElement.className = 'measure-tooltip measure-tooltip-measure'; + oMeasureTooltip = new ol.Overlay({ + element: oMeasureTooltipElement, + offset: [0, -15], + positioning: 'bottom-center' + }); + oMeasureTooltip.set('type', 'measure'); + + if (olFeature !== undefined) + oMeasureTooltip.set('feature', olFeature); + + this.map.addOverlay(oMeasureTooltip); + + oMeasureTooltipElement.className = 'measure-tooltip measure-tooltip-static'; + oMeasureTooltipElement.style.fontSize = 12 * this.resolutionCoeff + 'px'; + oMeasureTooltip.setOffset([0.8, -13]); + + this.updateTooltip(olFeature, oMeasureTooltip); +} + +/** + * getTooltipPosition function - Get the position to be use on a tooltip + * + * @param {ol.Geom} geom + * @return {array} position + */ +PrintMap.prototype.getTooltipPosition = function (geom) { + + if (geom.getType() === 'Polygon') { + var position = geom.getInteriorPoint().getLastCoordinate(); + } else if (geom.getType() === 'LineString') { + var position = geom.getLastCoordinate(); + } else if (geom.getType() === 'Circle') { + var position = geom.getCenter(); + } else if (geom.getType() === 'Point') { + var position = geom.getLastCoordinate(); + } else if (geom.getType() === 'GeometryCollection') { + var position = null; + } else { + var position = geom.getLastCoordinate(); + } + + return position; +}; + +/** + * updateTooltip function - Update the feature tooltip text and position + * + * @param {ol.feature} olFeature + * @param {ol.Overlay} oOverlay + */ +PrintMap.prototype.updateTooltip = function (olFeature, oOverlay) { + + if (olFeature.get('Type') === 'Ligne') { + oOverlay.getElement().innerHTML = olFeature.get('Longueur'); + } else if (olFeature.get('Type') === 'Polygone') { + oOverlay.getElement().innerHTML = olFeature.get('Superficie'); + } else if (olFeature.get('Type') === 'Cercle') { + oOverlay.getElement().innerHTML = "Périmètre: " + olFeature.get('Perimètre'); + } else if (olFeature.get('Type') === 'Point') { + + var proj = this.view.getProjection().getCode(); + var coords = ol.proj.transform(olFeature.get('Coordonnées'), proj, olFeature.get('Projection')); + var htmlInfos = document.createElement('div'); + htmlInfos.innerHTML = olFeature.get('Projection'); + htmlInfos.innerHTML += '<br>'; + htmlInfos.innerHTML += 'X = ' + parseFloat(coords[0]).toPrecision(9); + htmlInfos.innerHTML += '<br>'; + htmlInfos.innerHTML += 'Y = ' + parseFloat(coords[1]).toPrecision(9); + oOverlay.getElement().appendChild(htmlInfos); + } + + var position = this.getTooltipPosition(olFeature.getGeometry()); + if (isDef(position)) { + oMeasureTooltip.setPosition(position); + } +}; diff --git a/src/vitis/vas/util/printserver/server/printmap.js b/src/vitis/vas/util/printserver/server/printmap.js index 8b08466c4c7e7f758a9be5fec171fcfc586edcbf..1d81643bb4a55137c4acb875086dbd115a90490a 100755 --- a/src/vitis/vas/util/printserver/server/printmap.js +++ b/src/vitis/vas/util/printserver/server/printmap.js @@ -16,8 +16,8 @@ page.onError = function (msg, trace) { }); }; -if (system.args.length < 11) { - console.log('Usage: [printmap.js PrintClientURL APIRestUrl Token OutputFileName MapId MapJSON ImageSize MapExtent Features sFeaturesZoom ResolutionCoeff Quality]'); +if (system.args.length < 12) { + console.log('Usage: [printmap.js PrintClientURL APIRestUrl Token OutputFileName MapId MapJSON ImageSize MapExtent Features sFeaturesZoom ResolutionCoeff Quality, MeasureFeatures]'); phantom.exit(1); } else { @@ -26,8 +26,6 @@ if (system.args.length < 11) { } var abordTimeout = 2 * 60 * 1000; -// var abordTimeout = 10000; - var sPrintClientURL = system.args[1]; var sApiRestUrl = system.args[2]; @@ -41,8 +39,7 @@ if (system.args.length < 11) { var sFeaturesZoom = system.args[10]; var sResolutionCoeff = system.args[11]; var sQuality = system.args[12]; - - + var sMeasureFeatures = system.args[13]; // Si sMapJson est un fichier var oMapJson = null; @@ -65,7 +62,11 @@ if (system.args.length < 11) { sFeatures = fs.read(sFeatures); } var aFeatures = sFeatures.split('|'); - + + // Si sMeasureFeatures est un fichier + if (fs.exists(sMeasureFeatures)) { + sMeasureFeatures = fs.read(sMeasureFeatures); + } page.viewportSize = {width: aImageSize[0], height: aImageSize[1]}; @@ -78,7 +79,7 @@ if (system.args.length < 11) { /** * Render the target from page at the given sQuality - * @param {number} sQuality Specify 0 to obtain small compressed files, 100 for large + * @param {number} sQuality Specify 0 to obtain small compressed files, 100 for large * @param {string} sOutputFileName file name * @returns {boolean} */ @@ -122,30 +123,32 @@ if (system.args.length < 11) { 'extent': aMapExtent, 'features': aFeatures, 'featuresZoom': sFeaturesZoom, + 'measureFeatures': sMeasureFeatures, 'resolutionCoeff': sResolutionCoeff, 'displayProgress': false }; - -// console.log('token: ', mapOptions.token); -// console.log('apiUrl: ', mapOptions.apiUrl); -// console.log('mapId: ', mapOptions.mapId); -// console.log('mapJSON: ', mapOptions.mapJSON); -// console.log('extent: ', mapOptions.extent); -// console.log('features: ', mapOptions.features); -// console.log('featuresZoom: ', mapOptions.featuresZoom); -// console.log('resolutionCoeff: ', mapOptions.resolutionCoeff); -// console.log('displayProgress: ', mapOptions.displayProgress); + + // console.log('token: ', mapOptions.token); + // console.log('apiUrl: ', mapOptions.apiUrl); + // console.log('mapId: ', mapOptions.mapId); + // console.log('mapJSON: ', mapOptions.mapJSON); + // console.log('extent: ', mapOptions.extent); + // console.log('features: ', mapOptions.features); + // console.log('featuresZoom: ', mapOptions.featuresZoom); + // console.log('measureFeatures: ', mapOptions.measureFeatures); + // console.log('resolutionCoeff: ', mapOptions.resolutionCoeff); + // console.log('displayProgress: ', mapOptions.displayProgress); // Initialize the map with the given params page.evaluate(function (mapOptions) { initMap(mapOptions); }, mapOptions); - // Si rien n'a été fait en 5 minutes, alors exit() + // Si rien n'a été fait en 2 minutes, alors exit() setTimeout(function () { var done = page.render(sOutputFileName, {format: 'jpeg', sQuality: sQuality}); phantom.exit(); }, abordTimeout); } }); -} \ No newline at end of file +}