diff --git a/src/module_vmap/module/javascript/app/vmap/map/mapcompare.js b/src/module_vmap/module/javascript/app/vmap/map/mapcompare.js index 597d790f410c1f5a60e66034121d41bb61e1936b..03b6375ac2ab8952ff732962bb9d81dda6d321be 100644 --- a/src/module_vmap/module/javascript/app/vmap/map/mapcompare.js +++ b/src/module_vmap/module/javascript/app/vmap/map/mapcompare.js @@ -519,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]); @@ -533,6 +535,9 @@ nsVmap.MapCompare.prototype.mapCompareController = function ($scope, $window, $e setTimeout(function () { this_.updateCompareScaleMap(); }); + + // Affiche le nom de la carte + this_.setMapName(); }) /** @@ -765,3 +770,19 @@ nsVmap.MapCompare.prototype.mapCompareController.prototype.addView = function (o }); } }; + +nsVmap.MapCompare.prototype.mapCompareController.prototype.setMapName = function () { + oVmap.log('nsVmap.nsMapManager.LayersTree.prototype.LayertreeController.prototype.setMapName'); + + if ($("#map-name-compare").length == 0) { + $('#olMapCompare').children().children('.ol-overlaycontainer-stopevent').append('<div class="ol-map-name 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); +}