Where did I get mess up?

Here is my code inside the mapfile.map

    NAME "layername"
    DATA "data/sample.tif"

The code inside explorer.js from where I declare the openlayers.layer.wms

    var showlayer = new OpenLayers.Layer.WMS(
        "my Layer Title", 
            layers: 'layername',

            singleTile: false,
            maxExtent: my_MapExtent,
            isBaseLayer: false



When I open it in the browser here the error show's:

msWMSLoadGetMapParams(): WMS server error. Invalid layer(s)

any help or suggestion for this one?

  • Try first what happens with STATUS ON. – user30184 Dec 3 '14 at 7:45
  • @user30184 i already turn it on and off and still the same error message. – blinddevil Dec 3 '14 at 7:54
  • Try then to remove quotes around parameter format. See how transparent is used in dev.openlayers.org/docs/files/OpenLayers/Layer/WMS-js.html. But you should really use Firebug etc. so you can see what requests your application is sending. – user30184 Dec 3 '14 at 8:11
  • @user30184 i deed remove it like format: 'image/tiff' but still no hope. – blinddevil Dec 3 '14 at 8:15
  • There is always hope. People do use MapServer with OpenLayers. Don't guess, find the actual GetMap that is generated. You will see what is wrong and then will know where to fix. – user30184 Dec 3 '14 at 8:18