Project

General

Profile

« Previous | Next » 

Revision 0b554b40

Added by Andreas Kohlbecker over 7 years ago

fix #6110 using the same request protocol for the map service

View differences:

modules/cdm_dataportal/includes/maps.inc
166 166
    }
167 167
  }
168 168

  
169
//   // combine keys and values
170
//   foreach($cdm_openlayers_options as $key=>&$val){
171
//     $val = $key . ": " . $val;
172
//   };
169
  $mapserver_base_uri = $edit_map_service['base_uri'];
170
  $is_https = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
171
  $http_protocol = $is_https ? 'https' : 'http';
172
  $mapserver_base_uri = preg_replace('/^https?:/', $http_protocol . ':', $mapserver_base_uri);
173 173

  
174 174
  // window.onload - is executed when the document and images etc is fully loaded
175 175
  // Query(document).ready - is executed much earlier, when the DOM is loaded
......
177 177
          jQuery(document).ready(function() {
178 178
                jQuery(window).load(function () {
179 179
                  var map_container = jQuery('#openlayers_map').cdm_openlayers_map(
180
                   '" . $edit_map_service['base_uri'] . "',
180
                   '" . $mapserver_base_uri . "',
181 181
                   '" . $edit_map_service['version'] . "',
182 182
                   " .  json_encode($cdm_openlayers_options) . "
183 183
                );
......
296 296
      1 => "italic",
297 297
  );
298 298

  
299
//   // Query cdm server for map service uri parameters.
300
//   $query_string = cdm_ws_get(CDM_WS_GEOSERVICE_DISTRIBUTIONMAP, $taxon->uuid, queryString(cdm_distribution_filter_query()));
301
//   $query_string = $query_string->String;
302
  $out .= "<!-- map_data_parameters:" . print_r($query_string, TRUE) . " -->";
303 299
  if (!$query_string) {
304 300
    // The $query_string is empty if there are no distribution areas defined.
305
    return;
301
    return null;
306 302
  }
307 303

  
308 304
  /* ------ choose the display mode, either openlayers or static image ------ */

Also available in: Unified diff