Project

General

Profile

« Previous | Next » 

Revision 3844ef1e

Added by Katja Luther almost 2 years ago

fix #9917: remove etopo1 and add update script

View differences:

modules/cdm_dataportal/cdm_dataportal.install
58 58
  _rename_variable('cdm_dataportal_show_media', 'cdm_images_include_children');
59 59
}
60 60

  
61

  
62

  
61 63
/**
62 64
 * update for RELEASE 3.2.1:
63 65
 *  - adding missing permissions for role CDM Admin
......
526 528

  
527 529
  return join(', ', $tasks_performed);
528 530
}
531
/**
532
 * update for RELEASE 5.30:
533
 *  - map layers edit-etopo1 mapproxy_etopo1 removed, fallback to default, see https://dev.e-taxonomy.eu/redmine/issues/9917
534
 *
535
 */
536

  
537
function cdm_dataportal_update_7701()
538
{
539
  $tasks_performed = array();
540
  $cdm_map_distribution = variable_get(CDM_MAP_DISTRIBUTION);
541
  if(isset_not_empty($cdm_map_distribution)) {
542
    if (isset($cdm_map_distribution['openlayers'])) {
543
      if (isset($cdm_map_distribution['openlayers']['base_layers'])) {
544
        if (strpos($cdm_map_distribution['openlayers']['base_layers']['PREFERRED'], 'etopo1') !== FALSE) {
545
          $cdm_map_distribution['openlayers']['base_layers']['PREFERRED'] = 'open_topomap';
546
        }
547
        unset($cdm_map_distribution['openlayers']['base_layers']['edit-etopo1']);
548
        unset($cdm_map_distribution['openlayers']['base_layers']['mapproxy_etopo1']);
549
      }
550
      _modify_variable(CDM_MAP_DISTRIBUTION, $cdm_map_distribution);
551
      $tasks_performed[] = ' edit-etopo1 & mapproxy_etopo1 removed removed from ' . DISTRIBUTION_HIERARCHY_STYLE . " variable";
552
    }
553
  }
554
  return join(', ', $tasks_performed);
555
}
529 556

  
530 557
/* ======================================================================== */
531 558

  
532 559
/**
533 560
 * Renames a persistent variable.
534 561
 *
535
 * @return
562
 * @return string
536 563
 *   A message string of the performed operation.
537 564
 */
538 565
function _rename_variable($old_name, $new_name) {
modules/cdm_dataportal/js/map/openlayers_layers.js
66 66
              }
67 67
            );
68 68

  
69
         /**
70
          * ETOPO1 Global Relief Model
71
          */
72
         case 'edit-etopo1':
73
            return  new OpenLayers.Layer.WMS(
74
                  "ETOPO1 Global Relief Model",
75
                  "https://edit.africamuseum.be/geoserver/topp/wms",
76
                  {layers: 'topp:color_etopo1_ice_full', format:"image/png"},
77
                  {
78
                    maxExtent: window.CdmOpenLayers.mapExtends.epsg_4326,
79
                    projection: new OpenLayers.Projection("EPSG:4326"),
80
                    isBaseLayer: true,
81
                    displayInLayerSwitcher: true
82
                  }
83
                );
84 69

  
85
        /**
86
         * ETOPO1 Global Relief Model
87
         */
88
          case 'mapproxy_etopo1':
89
            return  new OpenLayers.Layer.WMS(
90
              "ETOPO1 Global Relief Model via mapproxy",
91
              "https://geo.cybertaxonomy.org/mapproxy/service",
92
              {layers: 'etopo1', format:"image/png"},
93
              {
94
                maxExtent: window.CdmOpenLayers.mapExtends.epsg_4326,
95
                projection: new OpenLayers.Projection("EPSG:4326"),
96
                isBaseLayer: true,
97
                displayInLayerSwitcher: true
98
              }
99
            );
100 70

  
101 71
          /*
102 72
           * OSM Layers:
modules/cdm_dataportal/settings.php
415 415
      // 'mapproxy_vmap0' => 'mapproxy_vmap0',
416 416
      // it is sufficient to define the preferred layer,
417 417
      // since it will automatically be enabled:
418
      'PREFERRED' => 'mapproxy_vmap0'),
418
      'PREFERRED' => 'open_topomap'),
419 419
    'custom_wms_base_layer' => array(
420 420
      'name' => NULL,
421 421
      'url' => NULL,
......
3101 3101
    'osgeo_vmap0' => "Metacarta Vmap0 (OSGeo server) - instable!", // EPSG:4326: EPSG:900913
3102 3102
    'metacarta_vmap0' => "Metacarta Vmap0 (MetaCarta Labs server)  - instable!", // EPSG:4326, EPSG:900913
3103 3103
    'mapproxy_vmap0' => "Metacarta Vmap0 (OSGeo server) - via fast EDIT MapProxy",
3104
    'mapproxy_etopo1' => "ETOPO1 Global Relief Model - via fast EDIT MapProxy",
3105
    'edit-etopo1' => "ETOPO1 Global Relief Model",
3104
    //'mapproxy_etopo1' => "ETOPO1 Global Relief Model - via fast EDIT MapProxy",
3105
    //'edit-etopo1' => "ETOPO1 Global Relief Model",
3106 3106
    // all others EPSG:900913
3107 3107
    'mapnik' => 'OpenStreetMap (mapnik)',
3108 3108
    'stamen_terrain' => 'Stamen Terrain',

Also available in: Unified diff