Project

General

Profile

Revision 2dc774be

ID2dc774be4d3d5506febc6249c07d55cca0ce6dae
Parent e0a990e9
Child a27edb33

Added by Andreas Kohlbecker over 2 years ago

settings for untiled wms layers

View differences:

modules/cdm_dataportal/js/map/openlayers_map.js
59 59
        projection: null,
60 60
        proj4js_def: null,
61 61
        max_extent: null,
62
        units: null
62
        units: null,
63
        untiled: null
63 64
    },
64 65
    wmsOverlayLayerData: {
65 66
      name: null,
66 67
      url: null,
67
      params: null
68
      params: null,
69
      untiled: null
68 70
    },
69 71
    /**
70 72
     * when true the map is made resizable by adding the jQueryUI widget resizable
......
339 341
              null,
340 342
              null,
341 343
              null,
342
              null
344
              null,
345
              opts.wmsOverlayLayerData.untiled
343 346
            );
344 347

  
345 348
            if(map.addLayer(wmsOverlay)){
......
765 768
                            customWMSBaseLayerData.projection,
766 769
                            customWMSBaseLayerData.proj4js_def,
767 770
                            customWMSBaseLayerData.units,
768
                            customWMSBaseLayerData.max_extent
771
                            customWMSBaseLayerData.max_extent,
772
                            customWMSBaseLayerData.untiled
769 773
                    );
770 774
                  wmsBaseLayer.setIsBaseLayer(true);
771 775
                  baseLayers[i] = wmsBaseLayer;
......
913 917
        console.log(timestamp + message);
914 918
      };
915 919

  
916
      var makeWMSLayerOptions = function(projection, proj4js_def, maxExtent, units){
917
        wmsOptions = {
920
      var makeWMSLayerOptions = function(projection, proj4js_def, maxExtent, units, untiled) {
921
        var wmsOptions = {
918 922
          isBaseLayer: false,
919 923
          displayInLayerSwitcher: true
920 924
        };
......
942 946
        if (units) {
943 947
          wmsOptions.units = units;
944 948
        }
949

  
950
        if (untiled) {
951
          wmsOptions.singleTile = true;
952
          wmsOptions.ratio = 1;
953
        }
954

  
945 955
        return wmsOptions;
946 956
      };
947 957

  
......
956 966
       * @param Object projection
957 967
       *    A OpenLayers.Projection object
958 968
       */
959
      var createWMSLayer= function(name, url, params, projection, proj4js_def, units, maxExtent){
969
      var createWMSLayer= function(name, url, params, projection, proj4js_def, units, maxExtent, untiled){
960 970

  
961 971
        console.log("creating WMS Layer " + name);
962 972

  
963
        wmsOptions = makeWMSLayerOptions(projection, proj4js_def, maxExtent, units);
973
        var wmsOptions = makeWMSLayerOptions(projection, proj4js_def, maxExtent, units, untiled);
964 974

  
965
        wmsLayer = new OpenLayers.Layer.WMS(
975
        var wmsLayer = new OpenLayers.Layer.WMS(
966 976
            name,
967 977
            url,
968 978
            params,
modules/cdm_dataportal/settings.php
513 513
      'projection' => NULL,
514 514
      'proj4js_def' => NULL,
515 515
      'max_extent' => NULL,
516
      'units' => NULL
516
      'units' => NULL,
517
      'untiled' => FALSE
518
    ),
519
    'wms_overlay_layer' => array(
520
      'name' => NULL,
521
      'url' => NULL,
522
      'params' =>  NULL,
523
      'untiled' => FALSE
517 524
    ),
518 525
    'show_layer_switcher' => TRUE,
519 526
    'display_outside_max_extent' => FALSE,
......
3142 3149
  $form_elements['name'] = array(
3143 3150
    '#type' => 'textfield',
3144 3151
    '#title' => 'Layer name',
3145
    // Only line color by now.
3146 3152
    '#default_value' => $default_settings['name'],
3147 3153
    '#description' => 'A arbitrary name for the layer.',
3148 3154
  );
3149 3155
  $form_elements['url'] = array(
3150 3156
    '#type' => 'textfield',
3151 3157
    '#title' => 'WMS url',
3152
    // Only line color by now.
3153 3158
    '#default_value' => $default_settings['url'],
3154 3159
    '#description' => 'Base url for the WMS (e.g.  http://edit.africamuseum.be/geoserver/topp/wms, http://wms.jpl.nasa.gov/wms.cgi)'
3155 3160
  );
3161
  $form_elements['untiled'] = array(
3162
    '#type' => 'checkbox',
3163
    '#title' => 'Untiled',
3164
    '#default_value' => $default_settings['untiled'],
3165
    '#description' => 'If the layer contains labels you may want to check this option to avoid label duplication or erratic invisibility.'
3166
  );
3156 3167
  $form_elements['params'] = array(
3157 3168
    '#type' => 'textarea',
3158 3169
    '#title' => 'WMS parameters',
3159 3170
    '#element_validate' => array('form_element_validate_json'),
3160
    // Only line color by now.
3161 3171
    '#default_value' => $default_settings['params'],
3162 3172
    '#description' => 'An javasript object with key/value pairs representing the GetMap query string parameters and parameter values ('
3163 3173
      .l('Geoserver WMS parameter reference', 'http://docs.geoserver.org/stable/en/user/services/wms/reference.html#getmap' )
......
3176 3186
    $form_elements['projection'] = array(
3177 3187
      '#type' => 'textfield',
3178 3188
      '#title' => 'Projection',
3179
      // Only line color by now.
3180 3189
      '#default_value' => $default_settings['projection'],
3181 3190
      '#description' => 'The desired projection for the layer (e.g. EPSG:4326, EPSG:900913, EPSG:3857)'
3182 3191
    );
......
3184 3193
      '#type' => 'textfield',
3185 3194
      '#maxlength' => 256,
3186 3195
      '#title' => 'proj4js definition',
3187
      // Only line color by now.
3188 3196
      '#default_value' => $default_settings['proj4js_def'],
3189 3197
      '#description' => 'The <a href="http://trac.osgeo.org/openlayers/wiki/Documentation/Dev/proj4js">proj4js definition</a> for the projection named above.
3190 3198
              The definitions for
......
3230 3238
    $form_elements['max_extent'] = array(
3231 3239
      '#type' => 'textfield',
3232 3240
      '#title' => 'Maximum extent',
3233
      // Only line color by now.
3234 3241
      '#default_value' => $default_settings['max_extent'],
3235 3242
      '#description' => 'The maximum extent of the map as bounding box (left, bottom, right, top) in the units of the map.'
3236 3243
    );

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)