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

Comparaison sur la fenêtre légende

parent 051f1865
Branches
Tags
No related merge requests found
......@@ -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,24 @@ 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']);
}
};
/**
* 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
......
......@@ -12,11 +12,15 @@
</div>
</div>
<div id="maplegendcontainer" class="layers-tool legend" collapse="{{ctrl.legend_collapsed === true ? 'out' : 'in'}}">
<ul class="nav nav-tabs layerstree-nav">
<li class="active"><a data-toggle="tab" href="#map1">Carte 1</a></li>
<li><a data-toggle="tab" href="#map1">Carte 2</a></li>
<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">
<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}}">
......@@ -34,5 +38,24 @@
</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>
</div>
</div>
</div>
</div>
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment