Project

General

Profile

« Previous | Next » 

Revision 0a96561f

Added by Andreas Kohlbecker almost 7 years ago

ref #6573 fixing overlay layer zindex and removing flora-cuba hack

View differences:

modules/cdm_dataportal/js/map/openlayers_map.js
148 148
      var defaultBaseLayer = null;
149 149

  
150 150
      /**
151
       * The top most layer which will be places above all data layers
152
       *
153
       * @type {null}
154
       */
155
      var wmsOverlay = null;
156

  
157
      /**
151 158
       * Default bounding box for map viewport in the projection of the base layer.
152 159
       * as defined by the user, can be null.
153 160
       *
......
334 341
            );
335 342

  
336 343
            if(map.addLayer(wmsOverlay)){
337
              map.setLayerIndex(wmsOverlay, 100);
338 344
              wmsOverlay.setVisibility(true);
345
              map.setLayerIndex(wmsOverlay, 100);
339 346
              log("Overlay wms added");
340 347
            } else {
341 348
              log("ERROR adding overlay wms layer")
......
356 363
        var initPostDataLoaded = function () {
357 364
          // all layers prepared, make the visible
358 365
          map.layers.forEach(function(layer){
359

  
360
            // hack for cuba
361
            if(layer.name === "flora_cuba_2016_regions"){
362
              map.setLayerZIndex(layer, 5);
363
            }
364
            if(layer.name === "flora_cuba_2016_provinces"){
365
              map.setLayerZIndex(layer, 6);
366
            }
367
            if(layer.name === "flora_cuba_2016_world"){
368
              map.setLayerZIndex(layer, 4);
369
            }
370

  
371 366
            layer.setVisibility(true);
372 367
          });
373 368

  
......
381 376
            map.zoomTo(opts.minZoom);
382 377
          }
383 378

  
379
          // make sure the wmsOverlay is still on top
380
          if(wmsOverlay){
381
            map.setLayerIndex(wmsOverlay, 100);
382
          }
383

  
384 384
          log(" > zoomToExtend done", true);
385 385
        };
386 386

  

Also available in: Unified diff