Display WMS layer within Openlayers when STATUS set to ON

View: New views
1 Messages — Rating Filter:   Alert me  

Display WMS layer within Openlayers when STATUS set to ON

by Paul Curran :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, I have been struggling with this problem for a while now.
 
My WMS layer will only display if STATUS is set to DEFAULT within the mapfile. If status is set to ON, i get following error message within OL Map window. "WMSLoadGetMapParams(): WMS Server Error". What am i missing to call the layer within openlayers? The reason i want it set to ON is i eventually want to have several layers and call them for a particular zoom level.
 
My Code is as follows:
 
      var bounds = new OpenLayers.Bounds(0, 0, 660046, 1229782);
      var map, layer1, layer2;
      var options = { maxExtent: bounds, maxResolution: 1000, numZoomLevels: 10};
 
     
     
      function init(){
          map = new OpenLayers.Map('map', options);
 
      layer1 = new OpenLayers.Layer.WMS("OpenLayers WMS",
      "http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/apps/openlayers-2.8/data/uk2.map", { layers: "250" },
      {gutter: 15});
 
      map.addLayer(layer1);
      map.zoomToMaxExtent();
 
 
And my mapfile looks as follows:
 
NAME UK1
 PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'datum=WGS84'
    'no_defs'
    ''
    END 
    SIZE 1600 1200
    IMAGECOLOR  -1 -1 -1
    IMAGETYPE JPEG
    SHAPEPATH "http://localhost/openlayers/data/"
    #QGIS
    #EXTENT  -837824 -111116 1677552 1232884
    #Port Talbot
    #EXTENT 272000 187000 278000 193000
    #UK
    EXTENT  0 0 660046 1240000
    UNITS METERS
   
 
 WEB
   TEMPLATE "http://localhost/openlayers/examples/uktest.html"
   LOG "\ms4w\tmp\ms_tmp\log.txt"
      IMAGEPATH "\ms4w\tmp\ms_tmp\"
      IMAGEURL "/ms_tmp/"
      METADATA
  'wms_title' "map"
        'wms_onlineresource'  "http://127.0.0.1./cgi-bin/mapserv?map=uk2.map"
      END
 END
 
 LAYER
 
    NAME "250"
    METADATA
      '250' "wms_demo"
    END
    STATUS DEFAULT
    TYPE raster
    TILEINDEX "250K"
    TILEITEM "Location"
    PROJECTION
  'proj=longlat'
  'ellps=WGS84'
  'datum=WGS84'
  'no_defs'
  ''
    END
    CLASS
      STYLE
       COLOR 0 0 0
      END
      LABEL
       COLOR 0 0 0
       SIZE SMALL
      END
       
    END
 
Thanks for any help in advance

_______________________________________________
wms-dev mailing list
wms-dev@...
http://lists.eogeo.org/mailman/listinfo/wms-dev