diff --git a/module/css/vmap.less b/module/css/vmap.less index cc42f401d348f812f18c9a25d00af7abcaa4dcb4..fa7278d2fcf13ac3cdd3f2529f01158bff52c206 100644 --- a/module/css/vmap.less +++ b/module/css/vmap.less @@ -2438,3 +2438,23 @@ div.vmap-select-scale-alert{ min-height: 55px; padding-top: 15px !important; } + +.basic-tools-element>span.icon-mirror { + font-size: 16px; + line-height: 0; +} + +.layerstree-nav { + margin-left: 40px; +} + +.layerstree-nav>li>a { + padding: 0px 15px; + border: 1px solid #8a8a8a !important; + color: #333; +} + +.ol-current-projection-compare{ + bottom: 29px; + margin-left: -16%; +} diff --git a/module/forms/configuration/configuration_vitis_configuration_vmapConfig.json b/module/forms/configuration/configuration_vitis_configuration_vmapConfig.json index eed719d9aedd5f8c8024774e31b13b187c9ae6cc..4304e1397892ff9d425bc986d7d2e91706722ca7 100755 --- a/module/forms/configuration/configuration_vitis_configuration_vmapConfig.json +++ b/module/forms/configuration/configuration_vitis_configuration_vmapConfig.json @@ -1,21 +1,46 @@ { "datasources": { - "datasource_1": { + "datasource_tools": { "type": "object", "dataType": "text", "name": "avaliable_controls", "description": "", "options": [ - "FORM_TOOLS_ATTRIBUTION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|Attribution", - "FORM_TOOLS_MOUSE_POSITION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|MousePosition", - "FORM_TOOLS_CURRENT_PROJECTION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|CurrentProjection", - "FORM_TOOLS_MAP_NAME_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|MapName", - "FORM_TOOLS_SCALE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|Scale", - "FORM_TOOLS_SCALE_LINE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|ScaleLine", - "FORM_TOOLS_OVERVIEW_MAP_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|OverviewMap", - "FORM_TOOLS_ZOOM_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|Zoom", - "FORM_TOOLS_ZOOM_SLIDER_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|ZoomSlider", - "FORM_TOOLS_REFRESH_SOCKET_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|RefreshSocket" + "FORM_TOOLS_MAP_MANAGER_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|MapManager", + "FORM_TOOLS_LOCATION_SEARCH_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|LocationSearch", + "FORM_TOOLS_LOCATION_HOME_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|LocationHome", + "FORM_TOOLS_LOCATION_REFRESH_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|LocationRefresh", + "FORM_TOOLS_LOCATION_MAX_EXTENT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|LocationMaxExtent", + "FORM_TOOLS_LOCATION_MY_POSITION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|LocationMyPosition", + "FORM_TOOLS_LOCATION_XY_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|LocationXY", + "FORM_TOOLS_LOCATION_PREC_NEXT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|LocationPrecNext", + "FORM_TOOLS_URL_GENERATOR_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|URLGenerator", + "FORM_TOOLS_MAP_COMPARE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|MapCompare", + "FORM_TOOLS_MESURE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|Mesure", + "FORM_TOOLS_SELECT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|Select", + "FORM_TOOLS_ADVANCED_SELECT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|AdvancedSelect", + "FORM_TOOLS_INSERT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|Insert", + "FORM_TOOLS_PRINT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|Print", + "FORM_TOOLS_CONFIG_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|Config", + "FORM_TOOLS_USER_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|User" + ] + }, + "datasource_controls": { + "type": "object", + "dataType": "text", + "name": "avaliable_controls", + "description": "", + "options": [ + "FORM_CONTROLS_ATTRIBUTION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|Attribution", + "FORM_CONTROLS_MOUSE_POSITION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|MousePosition", + "FORM_CONTROLS_CURRENT_PROJECTION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|CurrentProjection", + "FORM_CONTROLS_MAP_NAME_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|MapName", + "FORM_CONTROLS_SCALE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|Scale", + "FORM_CONTROLS_SCALE_LINE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|ScaleLine", + "FORM_CONTROLS_OVERVIEW_MAP_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|OverviewMap", + "FORM_CONTROLS_ZOOM_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|Zoom", + "FORM_CONTROLS_ZOOM_SLIDER_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|ZoomSlider", + "FORM_CONTROLS_REFRESH_SOCKET_CONFIGURATION_CONFIGURATION_VMAP_CONFIG|RefreshSocket" ] } }, @@ -252,19 +277,53 @@ "fields": [ { "type": "double_select", - "name": "controls.active_controls", + "name": "controls.active_tools", "label_from": "FORM_AVALIABLE_TOOLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG", "label_to": "FORM_ACTIVE_TOOLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG", "required": false, "nb_cols": 12, "size": 10, - "id": "Element_0_1_1", + "name_to": "controls.active_tools", + "name_from": "controls.active_tool", + "datasource": { + "datasource_id": "datasource_tools" + } + } + ] + }, + { + "fields": [ + { + "type": "double_select", + "name": "controls.public_active_tools", + "label_from": "FORM_AVALIABLE_PUBLIC_TOOLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG", + "label_to": "FORM_ACTIVE_PUBLIC_TOOLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG", + "required": false, + "nb_cols": 12, + "size": 10, + "name_to": "controls.public_active_tools", + "name_from": "controls.public_active_tool", + "datasource": { + "datasource_id": "datasource_tools" + } + } + ] + }, + { + "fields": [ + { + "type": "double_select", + "name": "controls.active_controls", + "label_from": "FORM_AVALIABLE_CONTROLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG", + "label_to": "FORM_ACTIVE_CONTROLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG", + "required": false, + "nb_cols": 12, + "size": 10, "name_to": "controls.active_controls", "name_from": "controls.active_control", "datasource": { - "datasource_id": "datasource_1" - }, - "id_from": "Element_0_1_1_from" + "datasource_id": "datasource_controls" + } } ] }, diff --git a/module/forms/vmap_business_object/vmap_business_object_vmap_business_object.js b/module/forms/vmap_business_object/vmap_business_object_vmap_business_object.js index 80ce27242794ab26e6305251870eb4adbaa0c17b..6a1ab146892cecec6567b3fa5ecc9a3e3bfe53f1 100644 --- a/module/forms/vmap_business_object/vmap_business_object_vmap_business_object.js +++ b/module/forms/vmap_business_object/vmap_business_object_vmap_business_object.js @@ -250,6 +250,11 @@ var oFormScope; oFormValues['id_field']['options'] = aColumnsOptions; } } + if (angular.isDefined(oFormValues['sorted_by'])) { + if (angular.isDefined(oFormValues['sorted_by']['options'])) { + oFormValues['sorted_by']['options'] = aColumnsOptions; + } + } if (angular.isDefined(oFormValues['geom_column'])) { if (angular.isDefined(oFormValues['geom_column']['options'])) { oFormValues['geom_column']['options'] = aColumnsOptions; diff --git a/module/forms/vmap_business_object/vmap_business_object_vmap_business_object.json b/module/forms/vmap_business_object/vmap_business_object_vmap_business_object.json index 17dbe0468ee4c3609c0710e359ad976f627aea44..e0168f15efdbb3674d714c7de0f294e58283bb88 100644 --- a/module/forms/vmap_business_object/vmap_business_object_vmap_business_object.json +++ b/module/forms/vmap_business_object/vmap_business_object_vmap_business_object.json @@ -280,13 +280,24 @@ }, { "fields": [{ - "type": "text", + "type": "editable_select", "name": "sorted_by", "label": "FORM_SORTED_BY_DEVELOPMENT_0", "required": false, - "pattern": "", - "nb_cols": 6, - "id": "New_el_9_11_1" + "nb_cols": 5 + }, { + "type": "button", + "class": "btn-group btn-group-sm margin-top-20", + "nb_cols": 1, + "buttons": [{ + "type": "button", + "name": "table-datalist", + "label": "FORM_SORTED_BY_DEVELOPMENT_0", + "class": "btn-primary", + "event": "loadVMapBoFormColumns()", + "glyphicon": "refresh" + } + ] }] }, { @@ -709,13 +720,24 @@ }, { "fields": [{ - "type": "text", + "type": "editable_select", "name": "sorted_by", "label": "FORM_SORTED_BY_DEVELOPMENT_0", "required": false, - "pattern": "", - "nb_cols": 6, - "id": "New_el_9_11_1" + "nb_cols": 5 + }, { + "type": "button", + "class": "btn-group btn-group-sm margin-top-20", + "nb_cols": 1, + "buttons": [{ + "type": "button", + "name": "table-datalist", + "label": "FORM_SORTED_BY_DEVELOPMENT_0", + "class": "btn-primary", + "event": "loadVMapBoFormColumns()", + "glyphicon": "refresh" + } + ] }] }, { diff --git a/module/javascript/app/vmap/map/mapcompare.js b/module/javascript/app/vmap/map/mapcompare.js index 4fdf3a756d3a58291345c3b5b19ca7a9428f311a..b3304a3c7800e0e991cc42b0c80bd0a11e4ee882 100644 --- a/module/javascript/app/vmap/map/mapcompare.js +++ b/module/javascript/app/vmap/map/mapcompare.js @@ -86,8 +86,15 @@ nsVmap.MapCompare = function () { * @private */ this.vmapTooltip_ = {}; + // Ajoute les couches à reprojeter en cas de changement de carte dans layersToTransform_ this.layersToTransform_ = []; + + // Vide les controls par défaut + var controls = this.oOpenLayersMap_.getControls().getArray(); + for (var i = 0; i < controls.length; i++) { + this.oOpenLayersMap_.removeControl(controls[i]); + } } /** @@ -512,8 +519,10 @@ nsVmap.MapCompare.prototype.mapCompareController = function ($scope, $window, $e 'size': this_.map.getSize(), 'tileSize': tileSize }); + // Définit la vue de la carte this_.addView(olView_); + // Définit les couches de la carte for (var i = 0; i < olLayers_.length; i++) { this_.addLayer(olLayers_[i]); @@ -526,6 +535,12 @@ nsVmap.MapCompare.prototype.mapCompareController = function ($scope, $window, $e setTimeout(function () { this_.updateCompareScaleMap(); }); + + // Affiche le nom de la carte + this_.displayMapName(); + + // Affiche le nom de la carte + this_.displayMapProj(); }) /** @@ -577,7 +592,7 @@ nsVmap.MapCompare.prototype.mapCompareController.prototype.synchronizeMap = func var this_ = this; // Synchro Échelle - oVmap.getMap().getOLMap().getTargetElement().addEventListener('mouseenter', function(){ + this_.map.getTargetElement().addEventListener('mouseleave', function(){ oVmap.getMap().getOLMap().on("moveend", this_.updateCompareScaleMap, this_); this_.map.un("moveend", this_.updateScaleMap, this_); }); @@ -758,3 +773,35 @@ nsVmap.MapCompare.prototype.mapCompareController.prototype.addView = function (o }); } }; + +/** + * Display the map name tool + */ +nsVmap.MapCompare.prototype.mapCompareController.prototype.displayMapName = function () { + oVmap.log('nsVmap.nsMapManager.LayersTree.prototype.LayertreeController.prototype.displayMapName'); + + if ($("#map-name-compare").length == 0) { + $('#olMapCompare').children().children('.ol-overlaycontainer-stopevent').append('<div class="ol-map-name ol-map-name-compare ol-unselectable"><span id="map-name-compare" class="ol-control"></span></div>'); + } + + var vMapCatalog = oVmap.getMapManager().getMapCatalog(); + for (var i = 0; i < vMapCatalog['maps'].length; i++) { + if (vMapCatalog['maps'][i]['compare'] === true) { + var currentMapName = vMapCatalog['maps'][i]['name']; + } + } + $("#map-name-compare").html(currentMapName); +} + +/** + * Display the map proj tool + */ +nsVmap.MapCompare.prototype.mapCompareController.prototype.displayMapProj = function () { + oVmap.log('nsVmap.nsMapManager.LayersTree.prototype.LayertreeController.prototype.displayMapProj'); + + if ($("#current-projection-compare").length == 0) { + $('#olMapCompare').children().children('.ol-overlaycontainer-stopevent').append('<div class="ol-current-projection ol-unselectable ol-current-projection-compare"><span id="current-projection-compare" class="ol-control"></span></div>'); + } + + $("#current-projection-compare").html(oVmap['oProjections'][oVmap.getMapCompare().getOLMap().getView().getProjection().getCode()]); +} diff --git a/module/javascript/app/vmap/mapmanager/layerstree.js b/module/javascript/app/vmap/mapmanager/layerstree.js index 673cb4e0f66ff2e60cc0b2faab5137030da12bb0..2a5fe743b519e0186dae873e6317327fee403212 100644 --- a/module/javascript/app/vmap/mapmanager/layerstree.js +++ b/module/javascript/app/vmap/mapmanager/layerstree.js @@ -117,6 +117,19 @@ nsVmap.nsMapManager.LayersTree.prototype.LayertreeController = function ($scope, */ $scope['tree'] = oVmap.getMapManager().getLayersTree(); + + /** + * The map compare layersTree + * @type {object} + */ + $scope['compareTree'] = {}; + + + /** + * The active map + */ + $scope['activeMap'] = 1; + /** * The current properties */ @@ -194,6 +207,17 @@ nsVmap.nsMapManager.LayersTree.prototype.LayertreeController = function ($scope, }; oVmap.module.controller('AppLayertreeController', nsVmap.nsMapManager.LayersTree.prototype.LayertreeController); +/** + * Resize the layertools + */ +nsVmap.nsMapManager.LayersTree.prototype.LayertreeController.prototype.resize = function () { + oVmap.log('nsVmap.nsMapManager.LayersTree.LayertreeController.resize'); + + setTimeout(function () { + oVmap.resizeLayerTools(); + }); +} + /** * Set a layer visible or not * @param {ol.layer.Base} olLayer @@ -270,6 +294,8 @@ nsVmap.nsMapManager.LayersTree.prototype.LayertreeController.prototype.setGroupV } this.memoriseGroupVisible(node); + + oVmap['scope'].$broadcast('layersChanged'); }; /** @@ -350,6 +376,14 @@ nsVmap.nsMapManager.LayersTree.prototype.LayertreeController.prototype.reloadTre // relance le chargement des couches avec le nouvel arbre this.loadTree(); + // Arbre pour la comparaison + if(this.scope_["$root"]["compare_enabled"]){ + var oCompareTree = jQuery.extend(true, {}, oVmap.getMapManager().getCompareLayersTree()); + this.scope_['compareTree'] = oCompareTree; + } else { + this.scope_['compareTree'] = {}; + } + oVmap.resizeLayerTools(false); }; @@ -638,6 +672,20 @@ nsVmap.nsMapManager.LayersTree.prototype.LayertreeController.prototype.closeLaye } } } + + if (goog.isDefAndNotNull(this.scope_['compareTree'])) { + if (goog.isArray(this.scope_['compareTree']['children'])) { + for (var i = 0; i < this.scope_['compareTree']['children'].length; i++) { + if (goog.isDefAndNotNull(this.scope_['compareTree']['children'][i]['children'])) { + for (var ii = 0; ii < this.scope_['compareTree']['children'][i]['children'].length; ii++) { + if (goog.isDefAndNotNull(this.scope_['compareTree']['children'][i]['children'][ii]['olLayer'])) { + this.scope_['compareTree']['children'][i]['children'][ii]['displayedMenu'] = false; + } + } + } + } + } + } }; /** diff --git a/module/javascript/app/vmap/mapmanager/maplegend.js b/module/javascript/app/vmap/mapmanager/maplegend.js index 48d2e54ec1915eb1e28b91b4908630d62aa5b32c..c6759068d12cdca81139276cf329080ba8fe1adf 100644 --- a/module/javascript/app/vmap/mapmanager/maplegend.js +++ b/module/javascript/app/vmap/mapmanager/maplegend.js @@ -136,7 +136,17 @@ nsVmap.nsMapManager.MapLegend.prototype.maplegendController = function ($scope) /** * @private */ - this['aUrls'] = []; + this['oUrls'] = {}; + + /** + * @private + */ + this['oCompareUrls'] = {}; + + /** + * The active map + */ + $scope['activeMap'] = 1; /** * Contains the events stocked by listenLayers() @@ -158,6 +168,18 @@ nsVmap.nsMapManager.MapLegend.prototype.maplegendController = function ($scope) }); }; + +/** + * Resize the layertools + */ +nsVmap.nsMapManager.MapLegend.prototype.maplegendController.prototype.resize = function () { + oVmap.log('nsVmap.nsMapManager.MapLegend.maplegendController.resize'); + + setTimeout(function () { + oVmap.resizeLayerTools(); + }); +} + /** * Loads the legend * @export @@ -165,18 +187,26 @@ nsVmap.nsMapManager.MapLegend.prototype.maplegendController = function ($scope) nsVmap.nsMapManager.MapLegend.prototype.maplegendController.prototype.loadLegend = function () { oVmap.log('nsVmap.nsMapManager.MapLegend.maplegendController.loadLegend'); - this['oUrls'] = this.getLegendUrls(); + this['oUrls'] = this.getLegendUrls(oVmap.getMap().getOLMap()); this.downloadLegendImgs(this['oUrls']); + + if(this.$scope_["$root"]["compare_enabled"]){ + this['oCompareUrls'] = this.getLegendUrls(oVmap.getMapCompare().getOLMap()); + this.downloadLegendImgs(this['oCompareUrls']); + } else { + this['oCompareUrls'] = {}; + } }; /** * Get the legend URLs + * @param {object} olMap * @returns {object} */ -nsVmap.nsMapManager.MapLegend.prototype.maplegendController.prototype.getLegendUrls = function () { +nsVmap.nsMapManager.MapLegend.prototype.maplegendController.prototype.getLegendUrls = function (olMap) { oVmap.log('nsVmap.nsMapManager.MapLegend.maplegendController.getLegendUrls'); - var aLayers = oVmap.getMap().getOLMap().getLayers().getArray(); + var aLayers = olMap.getLayers().getArray(); var oUrls = {}; // Récupération des URL WMS diff --git a/module/javascript/app/vmap/mapmanager/mapmanager.js b/module/javascript/app/vmap/mapmanager/mapmanager.js index 13114d60d7874701fa6fc84a16d079e020ee1634..d42d368d9bce08e8b42bcc399a3efab62aee2ec9 100644 --- a/module/javascript/app/vmap/mapmanager/mapmanager.js +++ b/module/javascript/app/vmap/mapmanager/mapmanager.js @@ -314,7 +314,7 @@ nsVmap.nsMapManager.MapManager.prototype.loadCompareMap = function (element) { var this_ = this; this_.getAjaxLayersTree(sUrl, function(oTree){ - oVmap.log("oTree: ", oTree); + oVmap.log("oCompareTree: ", oTree); // Change la variable oLayersTree this_.setCompareLayersTree(oTree); @@ -927,7 +927,7 @@ nsVmap.nsMapManager.MapManager.prototype.ajaxGetMapCatalog = function (sUrl) { * @return {object<LayersTree>} */ nsVmap.nsMapManager.MapManager.prototype.getAjaxLayersTree = function (sUrl, callback) { - var LayersTree; + var oLayersTree; ajaxRequest({ 'method': 'GET', @@ -937,11 +937,9 @@ nsVmap.nsMapManager.MapManager.prototype.getAjaxLayersTree = function (sUrl, cal 'success': function (response) { var data = JSON.parse(response['data']); if (goog.isDef(data['mapjsons'])) { - LayersTree = data['mapjsons'][0]; + oLayersTree = data['mapjsons'][0]; } - - oVmap.log(LayersTree); - callback.call(this, LayersTree); + callback.call(this, oLayersTree); } }); }; diff --git a/module/javascript/app/vmap/tools/controls.js b/module/javascript/app/vmap/tools/controls.js index 67b20e2e0fa4df43af05829b3365f6282f0ae60d..6fee41a7d7821c2ffb37070543fbe7aaef4e23df 100755 --- a/module/javascript/app/vmap/tools/controls.js +++ b/module/javascript/app/vmap/tools/controls.js @@ -31,7 +31,7 @@ goog.require('ol.format.TopoJSON'); /** * @classdesc * Class {@link nsVmap.nsToolsManager.Controls}: Add the controls defined in data/tools.json, - * available : Attribution, FullScreen, MousePosition, OverviewMap, Rotate, ScaleLine, Zoom, ZoomSlider, + * available : Attribution, FullScreen, MousePosition, OverviewMap, Rotate, ScaleLine, Zoom, ZoomSlider, * ZoomToExtent, CurrentProjection, DragAndDrop (GPX,GeoJSON,IGC,KML,TopoJSON) * @param {array} aControls Controls to set * @constructor @@ -273,7 +273,7 @@ nsVmap.nsToolsManager.Controls.prototype.addControl = function (control) { /** * Toggle a control to the ol map * @param {string} control Control to toggle - * @param {boolean} bActive + * @param {boolean} bActive * @export */ nsVmap.nsToolsManager.Controls.prototype.setToolActive = function (control, bActive) { @@ -426,4 +426,4 @@ nsVmap.nsToolsManager.Controls.prototype.getOverviewMap = function () { // Définit la directive et le controller oVmap.module.directive('appControls', nsVmap.nsToolsManager.Controls.prototype.controlsDirective); -oVmap.module.controller('AppControlsController', nsVmap.nsToolsManager.Controls.prototype.controlsController); \ No newline at end of file +oVmap.module.controller('AppControlsController', nsVmap.nsToolsManager.Controls.prototype.controlsController); diff --git a/module/javascript/app/vmap/tools/insert.js b/module/javascript/app/vmap/tools/insert.js index 456136bce313f4f78931835bdeec5e500dec4500..ce07b2686567b9c5002a2441209ecb8a80568318 100644 --- a/module/javascript/app/vmap/tools/insert.js +++ b/module/javascript/app/vmap/tools/insert.js @@ -317,6 +317,19 @@ nsVmap.nsToolsManager.Insert.prototype.inserttoolController = function ($scope, // Supprime du trou de la feature (si il existe) feature lors de la sélection sur l'interaction this.deleteHole_ this.deleteHole_.on('select', this.deleteHole, this); + // Évite les superpositions à l'édition + this.modify_.on('modifyend', function (evt) { + + // Récupère la feature ajoutée + var aFeatures = evt.features.getArray(); + + var j = 0; + for (var i = 0; i < aFeatures.length; i++) { + // Évite les superpositions avec les autres couches si besoin + this_.avoidSuperpositions(aFeatures[i]); + } + }); + // Lance updateInsertObjectFeature lors de chaque changement sur this.oOverlayFeatures_ // si il n'y a pas eut de changements pendant 500ms var iTmpChanges = 0; @@ -324,6 +337,7 @@ nsVmap.nsToolsManager.Insert.prototype.inserttoolController = function ($scope, // Retire les anciennes features si on est pas en mode multi var sGeomType = $scope['oInsertObject']['sGeomType']; + // Si il ne s'agit pas d'une géométrie multiple if (goog.isDefAndNotNull(sGeomType)) { if (sGeomType.substr(0, 5) !== 'MULTI' && sGeomType !== 'GEOMETRYCOLLECTION') { @@ -1244,7 +1258,7 @@ nsVmap.nsToolsManager.Insert.prototype.inserttoolController.prototype.setDiffGeo this_.setDiffGeom_(aSuperpositionBos, olFeature, opt_options); } }, function(err){ - console.error('Cannot get the diff geom: ', err) + console.error('Cannot get the diff geom: ', err); }); } @@ -1282,11 +1296,11 @@ nsVmap.nsToolsManager.Insert.prototype.inserttoolController.prototype.getDiffGeo return 0; } if (!goog.isDefAndNotNull(response['data'][0])) { - deferred.reject('response.data[0] not defined'); + deferred.resolve(sEWKTGeom); return 0; } if (!goog.isDefAndNotNull(response['data'][0]['diff_geom'])) { - deferred.reject('response.data[0].diff_geom not defined'); + deferred.resolve(sEWKTGeom); return 0; } deferred.resolve(response['data'][0]['diff_geom']); diff --git a/module/javascript/app/vmap/tools/location.js b/module/javascript/app/vmap/tools/location.js index 4cd96440554191c47a0415289ddde0cb77eb6065..415bd9cb19f286c3fcb11ea2c8818f5b60dc3c30 100644 --- a/module/javascript/app/vmap/tools/location.js +++ b/module/javascript/app/vmap/tools/location.js @@ -197,12 +197,25 @@ nsVmap.nsToolsManager.Location.prototype.locationController = function ($scope, fHistoryDelayHandler = $timeout(function () { if(this_['iHistoryOffset'] === 0){ - this_["aLocationHistory"].push({ + + var oNewLocation = { center: this_.map_.getView().getCenter(), zoom: this_.map_.getView().getZoom() - }); + } + + var oLastLocation = this_['aLocationHistory'][this_['aLocationHistory'].length - 1]; + + if (this_['aLocationHistory'].length > 0) { + if (oNewLocation.zoom === oLastLocation.zoom && + oNewLocation.center[0] === oLastLocation.center[0] && + oNewLocation.center[1] === oLastLocation.center[1]) { + return 0; + } + } + + this_["aLocationHistory"].push(oNewLocation); } else { - // splice + // splice var iHistoryPosition = this_['aLocationHistory'].length - (this_['iHistoryOffset']); this_["aLocationHistory"].splice(iHistoryPosition, this_['iHistoryOffset'], { center: this_.map_.getView().getCenter(), diff --git a/module/javascript/app/vmap/tools/print.js b/module/javascript/app/vmap/tools/print.js index efc99e6add1af7135b89c9210efd195df339902c..f2d041ca2bb9172bf72884d8c7ef08051d3080aa 100644 --- a/module/javascript/app/vmap/tools/print.js +++ b/module/javascript/app/vmap/tools/print.js @@ -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,26 +387,29 @@ 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.oComparePrintMapSize.resizeCoeff; + this['resolutionCompare'] = this.printedCompareMapSize_.resizeCoeff; // Ajuste l'échelle avec le niveau de détail - this['currentScaleCompare'] = oVmap.getMapCompare().getPrettyScale(oVmap.getMapCompare().getScale() / this.oComparePrintMapSize.resizeCoeff); + this['currentScaleCompare'] = oVmap.getMapCompare().getPrettyScale(oVmap.getMapCompare().getScale() / this.printedCompareMapSize_.resizeCoeff); // Dessine un carré d'impression à chaque mouvement de la carte - this.printBoxCompare_.setSize(this.oComparePrintMapSize.printedMapSize); + this.printBoxCompare_.setSize(this.printedCompareMapSize_.printedMapSize); this.printBoxCompare_.show(); } else { this.printBoxCompare_.hide(); } } + // Supprime le template du body de Vmap + $(this.template_).remove(); }; /** @@ -420,11 +435,18 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.setTemplate = fu }); } + this.$scope_['compare_mode'] = this.$scope_["$root"]["compare_enabled"]; + if (goog.isDefAndNotNull(oModel['definition'])) { var template = document.createElement("div"); template.innerHTML = oModel['definition']; + + this.$compile_(template)(this.$scope_); this_.template_ = template; - callback.call(this, [template]); + + setTimeout(function () { + callback.call(this_, [template]); + }); } }; @@ -450,6 +472,8 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.getPrintedMapSiz return 0; } + oPrintScope = angular.element($(template).find(sPrintId)).scope(); + // Ajoute temporairement le template au body de Vmap $(template).addClass('print_template'); $('body').append(template); @@ -457,9 +481,6 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.getPrintedMapSiz var mapHeight = imageDiv.height(); var mapWidth = imageDiv.width(); - // Supprime le template du body de Vmap - $(template).remove(); - // Vérifie si la taille de la carte est suppérieur à la taille de l'écran var resizeCoeff = 1; var tmpWidth = angular.copy(mapWidth); @@ -472,6 +493,7 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.getPrintedMapSiz return { printedMapSize: [mapWidth, mapHeight], + realSize: [imageDiv.width(), imageDiv.height()], resizeCoeff: resizeCoeff } }; @@ -575,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.oComparePrintMapSize !== 0){ + if(this.printedCompareMapSize_ !== 0){ // Enregistre l'échelle actuelle this.currentScaleCompare_ = oVmap.getMapCompare().getScale({ 'pretty': true @@ -635,14 +657,22 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.print = function var printStyleId = opt_options.printStyleId; // Set includesJSON - var includesJson = JSON.stringify([{ + var aIncludes = [{ 'target': '#map_legend', - 'html': this_.getLegendTemplate() - }]); + 'html': this_.getLegendTemplate('#maplegend') + }]; + if(this.$scope_["$root"]["compare_enabled"]){ + aIncludes.push({ + 'target': '#map_legend_compare', + 'html': this_.getLegendTemplate('#compare_maplegend') + }); + } + var includesJson = JSON.stringify(aIncludes); // Set scope var oPrintScope = goog.isDefAndNotNull(opt_options.scope) ? opt_options.scope : {}; oPrintScope['date'] = goog.isDefAndNotNull(oPrintScope['date']) ? oPrintScope['date'] : today; + oPrintScope['compare_mode'] = this.$scope_["$root"]["compare_enabled"] === true ? true : false; var sScope = JSON.stringify(oPrintScope); // Ouvre la fenêtre d'impression @@ -687,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, @@ -780,6 +807,10 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.print = function return 1; }; +/** + * Get the maps JSON defs + * @param {object} opt_options + */ nsVmap.nsToolsManager.Print.prototype.printController.prototype.getMapsJsonDef = function (opt_options) { oVmap.log('nsVmap.nsToolsManager.Print.prototype.printController.prototype.getMapsJsonDef'); @@ -899,40 +930,14 @@ 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 * @returns {String} */ -nsVmap.nsToolsManager.Print.prototype.printController.prototype.getLegendTemplate = function () { +nsVmap.nsToolsManager.Print.prototype.printController.prototype.getLegendTemplate = function (sTarget) { - var template = $('#maplegend').clone(); + var template = $(sTarget).clone(); // Transforme les images en base64 template.find('img').each(function (index) { diff --git a/module/javascript/app/vmap/tools/select/basicselect.js b/module/javascript/app/vmap/tools/select/basicselect.js index f8d0af3ccdbafe8cc7ba4a165cb54767d5d7e001..200baf000377bef18fafd189872aea028fddca67 100755 --- a/module/javascript/app/vmap/tools/select/basicselect.js +++ b/module/javascript/app/vmap/tools/select/basicselect.js @@ -542,6 +542,7 @@ nsVmap.nsToolsManager.BasicSelect.prototype.basicSelectController.prototype.repl nsVmap.nsToolsManager.BasicSelect.prototype.basicSelectController.prototype.displaySelectionPopup = function (aSelection, olPoint) { oVmap.log('nsVmap.nsToolsManager.BasicSelect.prototype.basicSelectController.prototype.displaySelectionPopup'); + var this_ = this; var scope = this.$scope_; for (var i = 0; i < aSelection.length; i++) { @@ -659,6 +660,51 @@ nsVmap.nsToolsManager.BasicSelect.prototype.basicSelectController.prototype.disp } }); } + + aSelection[i]['mapPopup'].addAction({ + 'content': '<span class="icon-link_url"></span> Lien vers cet objet' , + 'event': angular.bind(this, function(i){ + scope.$apply(function () { + // generate url for this object; + var sUrl = this_['properties']['web_server_name'] + "/" + this_['properties']['application']; + + if (goog.isDefAndNotNull(this_['properties']['environment'])){ + if (this_['properties']['environment'] != ""){ + sUrl += "_" + this_['properties']['environment']; + } + } + + sUrl += "?mode_id=vmap&"; + + var oMapCatalog = oVmap.getMapManager().getMapCatalog(); + var iMapId = oMapCatalog["maps"][oMapCatalog["usedMap"]]["map_id"]; + + sUrl += "map_id=" + iMapId + "&"; + sUrl += "bo_id=" + aSelection[i]["bo_type"] + "&"; + sUrl += "ids=" + aSelection[i]["bo_id_value"]; + + //copy url to clipboard + var textArea = document.createElement("textarea"); + textArea.value = sUrl; + document.body.appendChild(textArea); + textArea.focus(); + textArea.select(); + + try { + var successful = document.execCommand('copy'); + if (successful){ + $.notify('L\'URL d\'accés à cette objet a été copié dans votre presse-papier : \n' + sUrl, 'success'); + } else { + $.notify('L\'URL d\'accés à cette objet n\'a pas pu être copié dans votre presse-papier : \n' + sUrl, 'error'); + } + } catch (err) { + $.notify('L\'URL d\'accés à cette objet n\'a pas pu être copié dans votre presse-papier : \n' + sUrl, 'error'); + console.error('Fallback: Oops, unable to copy', err); + } + document.body.removeChild(textArea); + }); + }, i) + }); } // Ajoute les résultats diff --git a/module/javascript/app/vmap/tools/select/select.js b/module/javascript/app/vmap/tools/select/select.js index 9c89bc22cbe78198752e73c76846568ace3d2d68..0944cee5c36c0157e090e853d22cadfe027a9f6e 100755 --- a/module/javascript/app/vmap/tools/select/select.js +++ b/module/javascript/app/vmap/tools/select/select.js @@ -539,13 +539,14 @@ nsVmap.nsToolsManager.Select.prototype.selectController = function ($scope, $tim // Récupère la feature ajoutée var aFeatures = evt.features.getArray(); - // Évite les superpositions avec les autres couches si besoin var j = 0; for (var i = 0; i < aFeatures.length; i++) { + // Évite les superpositions avec les autres couches si besoin this_.avoidSuperpositions(aFeatures[i]).then(function(){ j++; if (!j < aFeatures.length) { setTimeout(function () { + // Enregistre les changements this_.putFeaturesOnTheElement(this_.oOverlayFeatures_.getArray()); }); } @@ -556,6 +557,7 @@ nsVmap.nsToolsManager.Select.prototype.selectController = function ($scope, $tim setTimeout(function () { if (j === 0) { console.error('avoidSuperpositions never sents callback'); + // Enregistre les changements this_.putFeaturesOnTheElement(this_.oOverlayFeatures_.getArray()); } }, 3000); @@ -2332,11 +2334,11 @@ nsVmap.nsToolsManager.Select.prototype.selectController.prototype.getDiffGeom_ = return 0; } if (!goog.isDefAndNotNull(response['data'][0])) { - deferred.reject('response.data[0] not defined'); + deferred.resolve(sEWKTGeom); return 0; } if (!goog.isDefAndNotNull(response['data'][0]['diff_geom'])) { - deferred.reject('response.data[0].diff_geom not defined'); + deferred.resolve(sEWKTGeom); return 0; } deferred.resolve(response['data'][0]['diff_geom']); diff --git a/module/javascript/app/vmap/tools/urlexporter.js b/module/javascript/app/vmap/tools/urlexporter.js index d89684f26f381a40125ee0d52a88f24eaa559637..d531827eddb069217fffec94531c0200d183ca03 100644 --- a/module/javascript/app/vmap/tools/urlexporter.js +++ b/module/javascript/app/vmap/tools/urlexporter.js @@ -68,35 +68,38 @@ nsVmap.nsToolsManager.Urlexporter.prototype.urlExporterController = function ($s /** * @type {string} */ - this["urlToExport"] = ""; + this["privateExportUrl"] = ""; + /** - * @type {boolean} + * @type {string} */ - this["usePublicToken"] = false; - - this["urlConstructor"](); + this["publicExportUrl"] = ""; // recalcule l'url quand on change de carte oVmap['scope'].$on('mapChanged', function () { - this_["urlConstructor"](); + this_["privateExportUrl"] = this_.getExportUrl(); + this_["publicExportUrl"] = this_.getExportUrl(true); }); - $scope.$watch("ctrl.usePublicToken", function(){ - this_["urlConstructor"](); - }) - + // recalcule l'url quand on bouge la carte oVmap.getMap().getOLMap().on("moveend", function(event){ - this_["urlConstructor"](); + this_["privateExportUrl"] = this_.getExportUrl(); + this_["publicExportUrl"] = this_.getExportUrl(true); }); + + // Recalcule l'URL + this_["privateExportUrl"] = this_.getExportUrl(); + this_["publicExportUrl"] = this_.getExportUrl(true); }; /** - * Display the user form in display mode - * @returns {undefined} + * Generates and return the export URL + * @param {boolean} bPublic + * @return {string} * @export */ -nsVmap.nsToolsManager.Urlexporter.prototype.urlExporterController.prototype.urlConstructor = function () { - oVmap.log("nsVmap.nsToolsManager.Urlexporter.urlExporterController.urlConstructor"); +nsVmap.nsToolsManager.Urlexporter.prototype.urlExporterController.prototype.getExportUrl = function (bPublic) { + oVmap.log("nsVmap.nsToolsManager.Urlexporter.urlExporterController.getExportUrl"); var sUrl = this['properties']['web_server_name'] + "/" + this['properties']['application']; @@ -106,7 +109,7 @@ nsVmap.nsToolsManager.Urlexporter.prototype.urlExporterController.prototype.urlC } } - sUrl += "?"; + sUrl += "?mode_id=vmap&"; var oMapCatalog = oVmap.getMapManager().getMapCatalog(); var iMapId = oMapCatalog["maps"][oMapCatalog["usedMap"]]["map_id"]; @@ -114,7 +117,7 @@ nsVmap.nsToolsManager.Urlexporter.prototype.urlExporterController.prototype.urlC sUrl += "map_id=" + iMapId; // si public add token - if (this["usePublicToken"]){ + if (bPublic === true){ sUrl += "&token=" + this['properties']['public_token']; } @@ -122,20 +125,23 @@ nsVmap.nsToolsManager.Urlexporter.prototype.urlExporterController.prototype.urlC var sExtent = oVmap.getMap().getOLMap().getView().calculateExtent(oVmap.getMap().getOLMap().getSize()).join("|"); sUrl += "&extent=" + encodeURI(sExtent); - this["urlToExport"] = sUrl; + return sUrl; }; - /** * Copy the generated URL on the clipboard - * + * @param {boolean} bPublic * @export */ -nsVmap.nsToolsManager.Urlexporter.prototype.urlExporterController.prototype.copyUrl = function () { +nsVmap.nsToolsManager.Urlexporter.prototype.urlExporterController.prototype.copyUrl = function (bPublic) { oVmap.log("nsVmap.nsToolsManager.Urlexporter.urlExporterController.copyUrl"); /* Get the text field */ - var copyText = document.getElementById("urlExporterField"); + if (bPublic === true) { + var copyText = document.getElementById("publicExportUrlField"); + } else { + var copyText = document.getElementById("privateExportUrlField"); + } /* Select the text field */ copyText.select(); diff --git a/module/javascript/vitis/script_module.js b/module/javascript/vitis/script_module.js index 00d7bea38f0f130a3f1f55460702749cb216fc1f..d740803e7e6612533b3c6704dd7e89348b7bad86 100644 --- a/module/javascript/vitis/script_module.js +++ b/module/javascript/vitis/script_module.js @@ -3607,4 +3607,22 @@ vitisApp.on('appMainDrtvLoaded', function () { "sMessage": "LIST_DELETE_CONFIRM_VMAP_BUSINESS_OBJECT" }); }; + + /** + * Return true/false if the tool is avaliable for this user + * @param {string} sTool + * @return {boolean} + */ + angular.element(vitisApp.appMainDrtv).scope()["isVmapToolActive"] = function (sTool) { + + var aTools; + + if (propertiesSrvc['public_user']) { + aTools = propertiesSrvc['controls']['public_active_tools'].split('|'); + } else { + aTools = propertiesSrvc['controls']['active_tools'].split('|'); + } + + return aTools.indexOf(sTool) !== -1 ? true : false; + } }); diff --git a/module/lang/lang-en.json b/module/lang/lang-en.json index 29d2d9f92d85c94d9d0f1e4a057bb501cf571635..dfca19f973cb24a29baabc9d4d03dbef574b89c8 100644 --- a/module/lang/lang-en.json +++ b/module/lang/lang-en.json @@ -251,19 +251,40 @@ "FORM_PRINTSERVER_ALIAS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Printserver alias", "FORM_VEREMAP_API_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Veremap API", "FORM_PROXY_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Proxy", + "FORM_AVALIABLE_CONTROLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Avaliable controls", + "FORM_ACTIVE_CONTROLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Actives controls", "FORM_AVALIABLE_TOOLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Avaliable tools", "FORM_ACTIVE_TOOLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Active tools", - "FORM_TOOLS_ATTRIBUTION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Attribution", - "FORM_TOOLS_MOUSE_POSITION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Mouse position", - "FORM_TOOLS_CURRENT_PROJECTION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Current projection", - "FORM_TOOLS_MAP_NAME_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Map Name", - "FORM_TOOLS_SCALE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Numeric scale", - "FORM_TOOLS_OVERVIEW_MAP_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Overview map", - "FORM_TOOLS_ROTATE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Rotate", - "FORM_TOOLS_SCALE_LINE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Scale line", - "FORM_TOOLS_ZOOM_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Zoom", - "FORM_TOOLS_ZOOM_SLIDER_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Zoom slider", - "FORM_TOOLS_REFRESH_SOCKET_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Refresh auto", + "FORM_AVALIABLE_PUBLIC_TOOLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Avaliable tools for public user", + "FORM_ACTIVE_PUBLIC_TOOLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Active tools for public user", + "FORM_CONTROLS_ATTRIBUTION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Attribution", + "FORM_CONTROLS_MOUSE_POSITION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Mouse position", + "FORM_CONTROLS_CURRENT_PROJECTION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Current projection", + "FORM_CONTROLS_MAP_NAME_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Map Name", + "FORM_CONTROLS_SCALE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Numeric scale", + "FORM_CONTROLS_OVERVIEW_MAP_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Overview map", + "FORM_CONTROLS_ROTATE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Rotate", + "FORM_CONTROLS_SCALE_LINE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Scale line", + "FORM_CONTROLS_ZOOM_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Zoom", + "FORM_CONTROLS_ZOOM_SLIDER_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Zoom slider", + "FORM_CONTROLS_REFRESH_SOCKET_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Refresh auto", + "FORM_TOOLS_MAP_MANAGER_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Gestion des cartes", + "FORM_TOOLS_LOCATION_SEARCH_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Localisation recherche", + "FORM_TOOLS_LOCATION_HOME_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Position initiale", + "FORM_TOOLS_LOCATION_REFRESH_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Rafraichissement carte", + "FORM_TOOLS_LOCATION_MAX_EXTENT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Étendue maximale", + "FORM_TOOLS_LOCATION_MY_POSITION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Position GPS", + "FORM_TOOLS_LOCATION_XY_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Position XY", + "FORM_TOOLS_LOCATION_PREC_NEXT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Précédent/suivant", + "FORM_TOOLS_URL_GENERATOR_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "URL de la carte en cours", + "FORM_TOOLS_MAP_COMPARE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Comparaison de cartes", + "FORM_TOOLS_MESURE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Mesures", + "FORM_TOOLS_SELECT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Interrogation", + "FORM_TOOLS_ADVANCED_SELECT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Interrogation avancée", + "FORM_TOOLS_INSERT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Insertion", + "FORM_TOOLS_PRINT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Impressions", + "FORM_TOOLS_CONFIG_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Configuration contrôles", + "FORM_TOOLS_USER_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Utilisateur en cours", "TITLE_DISPLAY_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Display", "TITLE_TOOLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Tools", "TITLE_CONTROLS_KEEPLOADED_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Keep tiles loaded when autorefreshing", diff --git a/module/lang/lang-fr.json b/module/lang/lang-fr.json index 82fca25d0f2fa89bab33f3cd82e694948c3b78cc..a1b1a7bbd94917d3d4b0021295bd5cac3f109774 100644 --- a/module/lang/lang-fr.json +++ b/module/lang/lang-fr.json @@ -251,19 +251,40 @@ "FORM_PRINTSERVER_ALIAS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Alias pintserver", "FORM_VEREMAP_API_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "API Veremap", "FORM_PROXY_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Proxy", + "FORM_AVALIABLE_CONTROLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Contrôles disponibles", + "FORM_ACTIVE_CONTROLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Contrôles actifs", "FORM_AVALIABLE_TOOLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Outils disponibles", - "FORM_ACTIVE_TOOLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Outils actifs par défaut", - "FORM_TOOLS_ATTRIBUTION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Attributions", - "FORM_TOOLS_MOUSE_POSITION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Position de la souris", - "FORM_TOOLS_CURRENT_PROJECTION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Projection en cours", - "FORM_TOOLS_MAP_NAME_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Nom de la carte", - "FORM_TOOLS_SCALE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Échelle numérique", - "FORM_TOOLS_SCALE_LINE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Échelle graphique", - "FORM_TOOLS_OVERVIEW_MAP_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Carte de supervision", - "FORM_TOOLS_ROTATE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Rotation", - "FORM_TOOLS_ZOOM_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Zoom", - "FORM_TOOLS_ZOOM_SLIDER_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Slider de zoom", - "FORM_TOOLS_REFRESH_SOCKET_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Rafraichissement auto", + "FORM_ACTIVE_TOOLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Outils actifs", + "FORM_AVALIABLE_PUBLIC_TOOLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Outils disponibles pour l'utilisateur public", + "FORM_ACTIVE_PUBLIC_TOOLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Outils actifs pour l'utilisateur public", + "FORM_CONTROLS_ATTRIBUTION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Attributions", + "FORM_CONTROLS_MOUSE_POSITION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Position de la souris", + "FORM_CONTROLS_CURRENT_PROJECTION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Projection en cours", + "FORM_CONTROLS_MAP_NAME_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Nom de la carte", + "FORM_CONTROLS_SCALE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Échelle numérique", + "FORM_CONTROLS_SCALE_LINE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Échelle graphique", + "FORM_CONTROLS_OVERVIEW_MAP_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Carte de supervision", + "FORM_CONTROLS_ROTATE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Rotation", + "FORM_CONTROLS_ZOOM_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Zoom", + "FORM_CONTROLS_ZOOM_SLIDER_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Slider de zoom", + "FORM_CONTROLS_REFRESH_SOCKET_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Rafraichissement auto", + "FORM_TOOLS_MAP_MANAGER_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Gestion des cartes", + "FORM_TOOLS_LOCATION_SEARCH_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Localisation recherche", + "FORM_TOOLS_LOCATION_HOME_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Localisation position initiale", + "FORM_TOOLS_LOCATION_REFRESH_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Rafraichissement couches", + "FORM_TOOLS_LOCATION_MAX_EXTENT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Localisation étendue maximale", + "FORM_TOOLS_LOCATION_MY_POSITION_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Localisation GPS", + "FORM_TOOLS_LOCATION_XY_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Localisation XY", + "FORM_TOOLS_LOCATION_PREC_NEXT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Localisation précédent/suivant", + "FORM_TOOLS_URL_GENERATOR_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "URL de la carte en cours", + "FORM_TOOLS_MAP_COMPARE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Comparaison de cartes", + "FORM_TOOLS_MESURE_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Mesures", + "FORM_TOOLS_SELECT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Interrogation", + "FORM_TOOLS_ADVANCED_SELECT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Interrogation avancée", + "FORM_TOOLS_INSERT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Insertion", + "FORM_TOOLS_PRINT_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Impressions", + "FORM_TOOLS_CONFIG_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Configuration contrôles", + "FORM_TOOLS_USER_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Utilisateur en cours", "TITLE_DISPLAY_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Affichage", "TITLE_TOOLS_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Outils", "TITLE_CONTROLS_KEEPLOADED_CONFIGURATION_CONFIGURATION_VMAP_CONFIG": "Garder les tuiles lors d'un rafraichissement automatique", diff --git a/module/template/layers/layertree.html b/module/template/layers/layertree.html index 5002135b16e7963f77a07de5163eee7f95c04f80..3141c44e2381b972cbd1df47df5f2c3cd7f5de90 100644 --- a/module/template/layers/layertree.html +++ b/module/template/layers/layertree.html @@ -12,10 +12,20 @@ </div> <div id="layertree" class="layers-tool" collapse="{{ctrl.layerstree_collapsed === true ? 'out' : 'in'}}"> + + <ul class="nav nav-tabs layerstree-nav left" ng-show="$root.compare_enabled"> + <li ng-class="{'active' : activeMap == 1}"> + <a href="#" ng-click="activeMap=1;ctrl.resize()">Carte 1</a> + </li> + <li ng-class="{'active' : activeMap == 2}"> + <a href="#" ng-click="activeMap=2;ctrl.resize()">Carte 2</a> + </li> + </ul> <div class="indicators"> <span class="text-info icon-eye" style="font-size: 18px;line-height: 0" title="Définit si la couche est visible"></span> </div> - <ul class="tree"> + + <ul class="tree" ng-show="activeMap == 1 || !$root.compare_enabled"> <div ng-repeat="node in tree.children| orderBy : 'name'" ng-if="node.view === undefined"> <!-- Service --> @@ -140,6 +150,108 @@ </ul> </div> </ul> + + <ul class="tree" ng-show="activeMap == 2 && $root.compare_enabled"> + <div ng-repeat="node in compareTree.children| orderBy : 'name'" ng-if="node.view === undefined"> + + <!-- Service --> + <div class="layerstree-phather"> + <div class="tree-father-collapse-btn service-name left" data-toggle="collapse" data-target="#comparetree_element_{{$id}}" onclick="setTimeout(function () { + oVmap.resizeLayerTools(true) + }, 500)" title="{{node.name}}"> + {{node.name}} + </div> + <div class="checkbox checkbox-info inline-checkbox right" + ng-class="{'checkbox_indeterminate': node.visible === null}"> + <input id="compare_service_{{$id}}_visible" + ng-init="node.visible = ctrl.isGroupVisible(node)" + ng-model="node.visible" + ng-model-options="{getterSetter: true}" + ng-click="ctrl.setGroupVisible(node)" + type="checkbox" + style="cursor:pointer; position: absolute" + title="Definit si le groupe est visible"> + <label for="compare_service_{{$id}}_visible" + style="cursor:pointer" + title="Definit si le groupe est visible"></label> + </div> + </div> + + <!-- Calque --> + <ul id="comparetree_element_{{$id}}" class="collapse layers-tree-ul tree-element" ng-class="{'in': ctrl.layers_collapsed !== true}"> + <div ng-repeat="layer in node.children"> + <li> + <ul class="list-group-item layertree-item auto-height"> + + <!-- Nom du calque --> + <div class="layer-name layer-name-tree" title="{{layer.name}}">{{layer.name}}</div> + <div class="layer-checkboxes"> + <button type="button" + class="btn btn-xs margin-sides-10 hidden" + ng-click="layer.olLayer.getSource().refreshWithTimestamp()"> + <span class="glyphicon glyphicon-refresh"></span> + </button> + <div type="button" class="btn btn-xs layer-menu-button" ng-click="ctrl.toggleLayerMenu(layer, $event)"> + <span ng-class="{'icon-filter': layer.olLayer.get('is_filtered'), 'icon-format_list_bulleted': !layer.olLayer.get('is_filtered')}"></span> + </div> + <!-- Checkbox visible --> + <div class="checkbox checkbox-info inline-checkbox" style="z-index: 10;"> + <input id="{{layer.$$hashKey}}_compare_visible_order_checkbox" + type="checkbox" + style="cursor:pointer; position: absolute" + title="Definit si le calque est visible" + ng-checked="layer.olLayer.values.visible === true" + ng-click="ctrl.setVisible(layer.olLayer, !layer.olLayer.values.visible);node.visible = ctrl.isGroupVisible(node)"> + <label for="{{layer.$$hashKey}}_compare_visible_order_checkbox" style="cursor:pointer" title="Definit si la couche est visible"></label> + </div> + </div> + </ul> + </li> + <div class="dropdown-menu layer-menu" ng-class="{'block': layer.displayedMenu === true}"> + <div class="layer-menu-list"> + <li ng-if="layer.olLayer.get('is_filtered')" ng-click="ctrl.displayFilterLayerModal(layer.olLayer)"> + <a href="#"> + <span class="icon-filter"></span> + Filtre + </a> + </li> + <li> + <a href="#"> + <div class="row"> + <div class="col-xs-6"> + <span class="icon-star-half"></span> + Transparence + </div> + <div class="col-xs-6"> + <div class="layer-menu-list-slider"> + <input data-app-layer-opacity-slider="" id="compare_slider_layer_form_{{layer.$$hashKey}}" type="text"> + </div> + </div> + </div> + </a> + </li> + <li ng-if="layer.olLayer.get('type') === 'imagewms' || layer.olLayer.get('type') === 'tilewms'" + ng-repeat="sublayer in layer.olLayer.get('sublayers')"> + <div class="sublayer-checkboxes"> + <!-- Checkbox visible --> + <div class="checkbox checkbox-info sublayer-checkbox inline-checkbox"> + <input id="{{layer.$$hashKey}}_compare_sublayer_{{sublayer}}_visible_checkbox" + type="checkbox" + style="cursor:pointer; position: absolute" + title="Definit si la couche est visible" + ng-checked="ctrl.isSublayerActive(layer.olLayer, sublayer)" + ng-disabled="layer.olLayer.values.visible !== true" + ng-click="ctrl.toggleSubLayer(layer.olLayer, sublayer, '#' + layer.$$hashKey + '_sublayer_' + sublayer + '_visible_checkbox')"> + <label for="{{layer.$$hashKey}}_compare_sublayer_{{sublayer}}_visible_checkbox" style="cursor:pointer" title="Definit si la couche est visible">{{sublayer}}</label> + </div> + </div> + </li> + </div> + </div> + </div> + </ul> + </div> + </ul> </div> <!--Modale pour le filtrage--> diff --git a/module/template/layers/maplegend.html b/module/template/layers/maplegend.html index a82570aa249be47f2f17a50eb48f4238af16d693..4c34eb4904c8941687b5019d7b7c9d20076a7b57 100755 --- a/module/template/layers/maplegend.html +++ b/module/template/layers/maplegend.html @@ -1,9 +1,9 @@ <div class="maplegendtool"> <div ng-if="!$root.is_mobile" id="maplegendcontainer-button"> - <div class="list-group-item active pointer maplegend-button-content" - title="Légende de la carte" + <div class="list-group-item active pointer maplegend-button-content" + title="Légende de la carte" collapse="{{ctrl.legend_collapsed === true ? 'out' : 'in'}}" - data-target="#maplegendcontainer" + data-target="#maplegendcontainer" onclick="oVmap.getMapManager().collapseElement(this)"> <span class="icon-info list-group-icon"></span> <span>Légende</span> @@ -12,7 +12,15 @@ </div> </div> <div id="maplegendcontainer" class="layers-tool legend" collapse="{{ctrl.legend_collapsed === true ? 'out' : 'in'}}"> - <div id="maplegend" class="tree legend"> + <ul class="nav nav-tabs layerstree-nav" ng-show="$root.compare_enabled"> + <li ng-class="{'active' : activeMap == 1}"> + <a href="#" ng-click="activeMap=1;ctrl.resize()">Carte 1</a> + </li> + <li ng-class="{'active' : activeMap == 2}"> + <a href="#" ng-click="activeMap=2;ctrl.resize()">Carte 2</a> + </li> + </ul> + <div id="maplegend" class="tree legend" ng-show="activeMap == 1 || !$root.compare_enabled"> <div ng-repeat="(sLayerName, layer) in ctrl.oUrls" class="layer-legend" ng-show="ctrl.areLegendsLoaded(layer)"> <div id="legend_father{{$index}}" data-toggle="collapse" data-target="#legend_element_{{$index}}"> @@ -23,7 +31,26 @@ <div id="legend_element_{{$index}}" class="collapse in"> <ul class="list-group-item auto-height"> <div ng-repeat="node in layer" - ng-show="node.legendBlobURL"> + ng-show="node.legendBlobURL"> + <img ng-src="{{node.legendBlobURL}}" class="legend-img" legend-image-node> + </div> + </ul> + </div> + </div> + </div> + + <div id="compare_maplegend" class="tree legend" ng-show="activeMap == 2 && $root.compare_enabled"> + <div ng-repeat="(sLayerName, layer) in ctrl.oCompareUrls" class="layer-legend" + ng-show="ctrl.areLegendsLoaded(layer)"> + <div id="compare_legend_father{{$index}}" data-toggle="collapse" data-target="#compere_legend_element_{{$index}}"> + <div style="display: inline-block; width:98%"> + <div class="legend_father_name" title="{{sLayerName}}">{{sLayerName}}</div> + </div> + </div> + <div id="compare_legend_element_{{$index}}" class="collapse in"> + <ul class="list-group-item auto-height"> + <div ng-repeat="node in layer" + ng-show="node.legendBlobURL"> <img ng-src="{{node.legendBlobURL}}" class="legend-img" legend-image-node> </div> </ul> @@ -31,4 +58,4 @@ </div> </div> </div> -</div> \ No newline at end of file +</div> diff --git a/module/template/tools/basicselect.html b/module/template/tools/basicselect.html index 1f829c663fd7e9b9eded8c88c38dc379a45fca29..d0ecff8d419dbc2a90adbf8772de3f0f568a4e27 100644 --- a/module/template/tools/basicselect.html +++ b/module/template/tools/basicselect.html @@ -1,6 +1,6 @@ <div id="vmap-basicselect-tool"></div> -<li role="presentation" style="position: inherit" class="basic-tools-dropdown"> +<li role="presentation" style="position: inherit" class="basic-tools-dropdown" ng-class="{'hidden': !$root.isVmapToolActive('Select')}"> <a class="basic-tools-element pointer" id="basic-tools-dropdown-basicselect-btn" ng-show="ctrl.aBusinessObjectsList.length > 0 || (ctrl.properties.selection.enable_getfeatureinfo === true && ctrl.aQueryableLayers.length > 0)" diff --git a/module/template/tools/basictools.html b/module/template/tools/basictools.html index 0321871288835fc992af7d5daaf74aba86e102d4..8d42420c8cb939607f43cac769066030a2b7c227 100644 --- a/module/template/tools/basictools.html +++ b/module/template/tools/basictools.html @@ -5,12 +5,12 @@ <!-- Outils de localisation --> <div app-location app-lang="ctrl.lang" app-map="ctrl.map"></div> <!-- Outil d'export d'url --> - <div> + <div ng-class="{'hidden': !$root.isVmapToolActive('URLGenerator')}"> <li role="presentation" style="position: inherit" class="basic-tools-dropdown"> <a class="basic-tools-element pointer" title="Lien vers la carte en cours" onclick="oVmap.getToolsManager().getBasicTools().toggleTool(this)"> - <span class="fa fa-link" aria-hidden="true"></span> + <span class="icon-link_url" aria-hidden="true"></span> </a> <div app-url-exporter app-lang="ctrl.lang" app-map="ctrl.map" id="basic-tools-dropdown-urlexporter" @@ -20,7 +20,7 @@ </li> </div> <!-- Outil de comparaison --> - <div> + <div ng-class="{'hidden': !$root.isVmapToolActive('MapCompare')}"> <li role="presentation" style="position: inherit" class="basic-tools-dropdown"> <a class="basic-tools-element pointer" id="map-compare-tool-btn" @@ -36,7 +36,7 @@ </li> </div> <!-- Login de l'utilisateur --> - <div class="right"> + <div class="right" ng-class="{'hidden': !$root.isVmapToolActive('User')}"> <li role="presentation" style="position: inherit" class="basic-tools-dropdown"> <a class="basic-tools-element pointer" title="Utilisateur" @@ -50,7 +50,7 @@ </li> </div> <!-- Contrôles --> - <div class="right"> + <div class="right" ng-class="{'hidden': !$root.isVmapToolActive('Config')}"> <li role="presentation" style="position: inherit" class="basic-tools-dropdown"> <a class="basic-tools-element pointer" title="Outils de contrôle" @@ -64,7 +64,7 @@ </li> </div> <!-- Impression --> - <div class="right"> + <div class="right" ng-class="{'hidden': !$root.isVmapToolActive('Print')}"> <li role="presentation" style="position: inherit" class="basic-tools-dropdown"> <a id="print-select-btn" class="basic-tools-element pointer" @@ -79,7 +79,7 @@ </li> </div> <!-- Insertion --> - <div class="right"> + <div class="right" ng-class="{'hidden': !$root.isVmapToolActive('Insert')}"> <li role="presentation" style="position: inherit" class="basic-tools-dropdown"> <a class="basic-tools-element pointer" id="basic-tools-dropdown-insert-btn" @@ -96,7 +96,7 @@ <!--Outils de sélection--> <div app-select app-lang="ctrl.lang" app-map="ctrl.map" app-action="ctrl.currentAction" class="right basic-tools-nav"></div> <!-- Mesure --> - <div class="right"> + <div class="right" ng-class="{'hidden': !$root.isVmapToolActive('Mesure')}"> <li style="position: inherit" class="basic-tools-dropdown"> <a class="basic-tools-element pointer" title="Outils de mesure" diff --git a/module/template/tools/location.html b/module/template/tools/location.html index a9f3e9bca3288fb5fc5a32a7d83eb4dec5ce8667..62e46ed34e6b7d9853846d9d0845101216ac75a9 100644 --- a/module/template/tools/location.html +++ b/module/template/tools/location.html @@ -1,16 +1,16 @@ <!--location search--> -<li id="location-search-tool" role="presentation"> +<li id="location-search-tool" role="presentation" ng-class="{'hidden': !$root.isVmapToolActive('LocationSearch')}"> <form ng-submit="ctrl.searchLocation()" id="location-search-form" class="margin-sides-5 from-control"> <!--Recherche--> <input id="location-search-input" - type="text" + type="text" placeholder="Localiser.." ng-model="ctrl.locationSearch" ng-click="ctrl.searchLocation()"> <!--Sélecteur--> <select id="location-search-api-select" ng-model="ctrl.sSelectedLocationService" - ng-change="ctrl.searchLocation()"> + ng-change="ctrl.searchLocation()"> <!--Géocodeurs--> <option ng-repeat="(key, value) in ctrl.locationServices" value="{{key}}">{{value.title}}</option> @@ -26,7 +26,7 @@ <!--Bandeau du haut--> <div style="margin: 10px"> <label>Résultats de la recherche: </label> - <span class="glyphicon glyphicon-remove right pointer margin-sides-10" + <span class="glyphicon glyphicon-remove right pointer margin-sides-10" ng-click="ctrl.removeLocation()"></span> </div> @@ -65,12 +65,12 @@ <!-- Géocodeur --> <div ng-if="locationServiceType === 'geocoder'" class="location-search-dropdown-content"> - <div class="location-search-dropdown-result" + <div class="location-search-dropdown-result" ng-repeat="node in ctrl.locationResults"> <div class="pointer opacity-hover" ng-click="ctrl.locatePlace(node)"> <span>{{node.title}}</span> - </div> + </div> <div class="location-search-dropdown-result-buttons pointer collapsed" data-toggle="collapse" href="#location-search-dropdown-result-infos-{{this['$index']}}"> <a>Détails</a> @@ -78,7 +78,7 @@ </div> <div class="collapse" id="location-search-dropdown-result-infos-{{this['$index']}}"> - <div style="padding-bottom: 10px" ng-if="node.summary"> + <div style="padding-bottom: 10px" ng-if="node.summary"> <ul> <li ng-repeat="oSummaryElement in node.summary">{{oSummaryElement.label}}: {{oSummaryElement.value}}</li> </ul> @@ -91,13 +91,13 @@ <div style="text-align: center; margin: 10px;"> <button type="button" class="btn btn-sm btn-primary" ng-click="ctrl.searchLocation(ctrl.locationSearch, 12)"> Plus de résultats - </button> + </button> </div> </div> </li> <!--Go home--> -<li role="presentation"> +<li role="presentation" ng-class="{'hidden': !$root.isVmapToolActive('LocationHome')}"> <a id="original-position-tool" class="basic-tools-element pointer" title="Centrer la carte sur l’emprise par défaut" ng-click="ctrl.goHome()"> @@ -106,7 +106,7 @@ </li> <!--Refresh map--> -<li role="presentation"> +<li role="presentation" ng-class="{'hidden': !$root.isVmapToolActive('LocationRefresh')}"> <a id="original-position-tool" class="basic-tools-element pointer" title="Rafraichir les couches de la carte" ng-click="ctrl.refreshMap()"> @@ -115,7 +115,7 @@ </li> <!--Max extent--> -<li role="presentation"> +<li role="presentation" ng-class="{'hidden': !$root.isVmapToolActive('LocationMaxExtent')}"> <a class="basic-tools-element pointer" title="Centrer la carte à l’étendue maximale" ng-click="ctrl.maxExtent()"> <span class="icon-language" aria-hidden="true"></span> @@ -123,7 +123,7 @@ </li> <!--Geolocate me--> -<li role="presentation"> +<li role="presentation" ng-class="{'hidden': !$root.isVmapToolActive('LocationMyPosition')}"> <a class="basic-tools-element pointer" title="Centrer la carte sur ma position" ng-click="ctrl.geolocateMe()"> <span class="glyphicon glyphicon-map-marker" aria-hidden="true"></span> @@ -131,7 +131,7 @@ </li> <!--Go to--> -<li role="presentation" style="position: inherit" class="basic-tools-dropdown"> +<li role="presentation" style="position: inherit" class="basic-tools-dropdown" ng-class="{'hidden': !$root.isVmapToolActive('LocationXY')}"> <a class="basic-tools-element pointer" title="Centrer la carte sur une position donnée" @@ -148,7 +148,7 @@ <div class="input-group-sm"> <input type="number" class="form-control" placeholder="Y" ng-model="goToY"> </div> - </div> + </div> <div class="col-md-5"> <b>Projection:</b> <select class="form-control" ng-model="goToProj"> @@ -169,7 +169,7 @@ </li> <!--Previous history--> -<li role="presentation"> +<li role="presentation" ng-class="{'hidden': !$root.isVmapToolActive('LocationPrecNext')}"> <a class="basic-tools-element pointer" title="Aller à l'étendue précédente" ng-click="ctrl.previousHistoryExtent()" ng-class="{'inactive' : ctrl.iHistoryOffset >= ctrl.aLocationHistory.length - 1}"> <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span> @@ -177,7 +177,7 @@ </li> <!--Next history--> -<li role="presentation"> +<li role="presentation" ng-class="{'hidden': !$root.isVmapToolActive('LocationPrecNext')}"> <a class="basic-tools-element pointer" title="Aller à l'étendue suivante" ng-click="ctrl.nextHistoryExtent()" ng-class="{'inactive' : ctrl.iHistoryOffset === 0}"> <span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span> diff --git a/module/template/tools/select.html b/module/template/tools/select.html index 24ae5ca8505ff719e24f57588e36d5e262265c44..f801d83e906904ae6028f8e76bd8041af1c7d928 100644 --- a/module/template/tools/select.html +++ b/module/template/tools/select.html @@ -2,7 +2,7 @@ <div id="vmap-select-tool"></div> <!-- Selection Avancée --> -<div class="right" ng-if="!$root.is_mobile"> +<div class="right" ng-if="!$root.is_mobile" ng-class="{'hidden': !$root.isVmapToolActive('AdvancedSelect')}"> <li role="presentation" style="position: inherit" class="basic-tools-dropdown"> <a class="basic-tools-element pointer" id="basic-tools-dropdown-select-btn" diff --git a/module/template/tools/urlexporter.html b/module/template/tools/urlexporter.html index c10845a6e2310f0b48ee40f6479e40e21372608f..a1602e307b52d657096cda53b9c1ee618df0a754 100644 --- a/module/template/tools/urlexporter.html +++ b/module/template/tools/urlexporter.html @@ -2,29 +2,29 @@ <div class="row margin-sides-0 margin-10"> <div class="col-md-12"> <div class="left"> - <label for="urlExporterField" class="control-label">Lien vers la carte en cours</label> - </div> - <div class="right" ng-if="ctrl.properties.allow_public_connection"> - <div class="checkbox checkbox-info checkbox-inline"> - <input id="publicAccountCheckbox" - type="checkbox" - style="cursor:pointer;" - title=">Activer / Désactiver le mode public" - ng-model="ctrl.usePublicToken"> - <label for="publicAccountCheckbox" - style="cursor:pointer" - title="Activer / Désactiver le mode public"> - Public - </label> - </div> + <label for="privateExportUrlField" class="control-label">Lien vers la carte en cours</label> </div> </div> <div class="col-md-12"> <div class="input-group"> - <input type="text" class="form-control" ng-model="ctrl.urlToExport" id="urlExporterField"> + <span class="input-group-btn"> + <button type="button" class="btn btn-default" disabled><span class="fa fa-lock"></span></button> + </span> + <input type="text" class="form-control" ng-model="ctrl.privateExportUrl" id="privateExportUrlField"> <span class="input-group-btn"> <button type="button" class="btn btn-default" ng-click="ctrl.copyUrl()"><span class="icon-copy"></span></button> </span> </div> </div> + <div class="col-md-12 margin-10" ng-if="ctrl.properties.allow_public_connection"> + <div class="input-group"> + <span class="input-group-btn"> + <button type="button" class="btn btn-default" disabled><span class="fa fa-unlock"></span></button> + </span> + <input type="text" class="form-control" ng-model="ctrl.publicExportUrl" id="publicExportUrlField"> + <span class="input-group-btn"> + <button type="button" class="btn btn-default" ng-click="ctrl.copyUrl(true)"><span class="icon-copy"></span></button> + </span> + </div> + </div> </div> diff --git a/module/template/vmap.html b/module/template/vmap.html index 0b1b12f973b55e61a0408e13faf08923522ef702..3dfe8e972c9041da49bdcca98ac684467dbcd2c4 100755 --- a/module/template/vmap.html +++ b/module/template/vmap.html @@ -19,7 +19,7 @@ <app-maplistlitle app-lang="ctrl.lang" app-maplistlitle-map="ctrl.map"></app-maplistlitle> - <div id="map-manager-button-container" style="text-align: center"> + <div id="map-manager-button-container" style="text-align: center" ng-class="{'hidden': !$root.isVmapToolActive('MapManager')}"> <button id="map-manager-button" type="button" class="btn btn-success btn-sm btn-modal margin-10" diff --git a/web_service/conf/properties.inc b/web_service/conf/properties.inc index f21d672f35ce9422a3c58ad6d0234300c1e02950..14c81c8910fbc063076e47d22ae07118a19d04c9 100755 --- a/web_service/conf/properties.inc +++ b/web_service/conf/properties.inc @@ -10,6 +10,8 @@ $properties["vmap"]["layers_collapsed"] = false; $properties["vmap"]["layerstree_collapsed"] = false; $properties["vmap"]["layersorder_collapsed"] = true; $properties["vmap"]["legend_collapsed"] = false; +$properties['controls']['active_tools'] = 'LocationMaxExtent|User|Print|Insert|AdvancedSelect|Select|Mesure|URLGenerator|MapManager|LocationSearch|LocationHome|LocationRefresh|LocationXY|MapCompare|LocationMyPosition'; +$properties['controls']['public_active_tools'] = 'User|Insert|AdvancedSelect|LocationXY|MapManager|LocationHome|MapCompare|Select|Print|LocationSearch|LocationMyPosition|Mesure'; $properties['controls']['active_controls'] = 'Attribution|MousePosition|CurrentProjection|MapName|Scale|ScaleLine|OverviewMap|Zoom|ZoomSlider|RefreshSocket'; $properties["selection"]["limit_popup"] = 1; $properties["selection"]["limit_list"] = 50;