<html>
<head>
</head>
<body class='hmmessage'><div dir='ltr'>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
<div dir="ltr"> <br>Hi All,<br><br>I am new in open layers and I am trying to demonstrate my mapfile with Open layers. Can some one helm me about this please? Code lines are below:<br><br><br><!-- MapServer Template --> <br> <html><br><head><br> <title>OpenLayers Example</title><br> <script src="http://openlayers.org/api/OpenLayers.js"></script><br> </head><br> <body><br> <div style="width:100%; height:100%" id="map"></div><br> <script defer="defer" type="text/javascript"><br> var map = new OpenLayers.Map('map');<br> var wms = new OpenLayers.Layer.MapServer( "QGIS-MAP",<br> "http://localhost/cgi-bin/wms?MODE=map&MAP=C:/wwwroot/QGISMap/QGISMap.map", {layers: 'province_dd'} );<br> map.addLayer(wms);<br> map.zoomToMaxExtent();<br> </script><br><br></body><br></html><br><br><br><br><br># Map file created from QGIS project file<br># Edit this file to customize for your map interface<br># (Created with PyQgis MapServer Export plugin)<br>MAP<br> NAME "QGIS-MAP"<br> # Map image size<br> SIZE 500 500<br> UNITS meters<br>STATUS ON<br> EXTENT -2400000 -900000 3100000 4000000<br> FONTSET "/wwwroot/fonts/fontset.txt"<br> SYMBOLSET '../symbols/symbols.sty'<br> PROJECTION<br> "proj=lcc"<br> "ellps=GRS80"<br> "lat_0=49"<br> "lon_0=-95"<br> "lat_1=49"<br> "lat_2=77"<br> "datum=NAD83"<br> "units=m"<br> "no_defs <>"<br> END <br><br> SYMBOL<br> NAME "S3"<br> TYPE pixmap<br> IMAGE '/wwwroot/symbols/S3.png'<br> END # SYMBOL<br><br> # Background color for the map canvas -- change as desired<br> IMAGECOLOR 0 0 255<br> IMAGEQUALITY 95<br> IMAGETYPE png<br>CONFIG "CGI_CONTEXT_URL" "1"<br> OUTPUTFORMAT<br> NAME agg<br> DRIVER AGG/PNG<br> IMAGEMODE RGB<br> END<br><br><br> QUERYMAP<br> STATUS ON <br> SIZE 500 500 # sets the map to be queryable<br> STYLE HILITE # the selected object is highligthed<br> COLOR 0 255 0<br> END # End for QueryMap<br><br> SCALEBAR<br> STATUS EMBED<br> UNITS KILOMETERS<br> INTERVALS 3<br> TRANSPARENT TRUE<br> OUTLINECOLOR 0 0 0<br> END # End for scalebar<br><br> # Legend<br> LEGEND<br> IMAGECOLOR 255 255 255<br> STATUS ON<br> KEYSIZE 18 12<br> LABEL<br> TYPE BITMAP<br> SIZE MEDIUM<br> COLOR 0 0 89<br> END<br> END<br><br> # Web interface definition. Only the template parameter<br> # is required to display a map. See MapServer documentation<br> WEB<br> # Set IMAGEPATH to the path where MapServer should<br> # write its output.<br> IMAGEPATH '/ms4w/tmp/ms_tmp/'<br><br> # Set IMAGEURL to the url that points to IMAGEPATH<br> # as defined in your web server configuration<br> IMAGEURL '/ms_tmp/'<br><br> HEADER "header.html"<br> FOOTER "footer.html"<br> EMPTY "/maps/QGISMap/blank.html"<br><br> # WMS server settings<br> METADATA<br> 'ows_title' 'QGIS-MAP'<br> 'ows_onlineresource' 'localhost/cgi-bin/mapserv.exe?map=C:/wwwroot/QGISMap/QGISMap.map'<br> 'ows_srs' 'EPSG:4326'<br> END<br><br> #Scale range at which web interface will operate<br> # Template and header/footer settings<br> # Only the template parameter is required to display a map. See MapServer documentation<br> TEMPLATE 'global.html'<br> END<br><br> LAYER<br> NAME 'province_dd'<br> TYPE POLYGON<br> DUMP false<br> CONNECTION "http://localhost/cgi-bin/wms?"<br> CONNECTIONTYPE WMS<br><br> EXTENT -148.317097 42.348600 -55.567680 86.032387<br> DATA '../../../wwwroot/Data/province_dd.shp'<br> METADATA<br> 'wms_onlineresource' 'http://localhost/cgi-bin/mapserv.exe?map=wms.map&'<br> "wms_srs" "EPSG:4326"<br> "wms_name" "province_dd"<br> "wms_server_version" "1.1.1"<br> "wms_format" "image/gif"<br> #'ows_title' 'province_dd'<br> END<br> STATUS ON<br> TRANSPARENCY 100<br> PROJECTION<br> 'proj=longlat'<br> 'datum=WGS84'<br> 'no_defs'<br> END<br> LABELITEM 'NAME_ENG'<br> CLASSITEM 'NAME_ENG' <br> CLASS<br> NAME "Alberta" <br> EXPRESSION "Alberta" <br> STYLE<br> WIDTH 0.91 <br> OUTLINECOLOR 0 0 0<br> COLOR 130 9 169<br> END<br> <br> END<br> CLASS<br> NAME "British Columbia" <br> EXPRESSION "British Columbia" <br> STYLE<br> WIDTH 0.91 <br> OUTLINECOLOR 0 0 0<br> COLOR 62 106 166<br> END <br> END<br> CLASS<br> NAME "Manitoba" <br> EXPRESSION "Manitoba" <br> STYLE<br> WIDTH 0.91 <br> OUTLINECOLOR 0 0 0<br> COLOR 176 232 23<br> END <br> END<br> CLASS<br> NAME "New Brunswick" <br> EXPRESSION "New Brunswick" <br> STYLE<br> WIDTH 0.91 <br> OUTLINECOLOR 0 0 0<br> COLOR 248 188 159<br> END <br> END<br> CLASS<br> NAME "Newfoundland" <br> EXPRESSION "Newfoundland" <br> STYLE<br> WIDTH 0.91 <br> OUTLINECOLOR 0 0 0<br> COLOR 172 33 56<br> END <br> END<br> CLASS<br> NAME "Northwest Territories" <br> EXPRESSION "Northwest Territories" <br> STYLE<br> WIDTH 0.91 <br> OUTLINECOLOR 0 0 0<br> COLOR 123 03 213<br> END <br> END<br> CLASS<br> NAME "Nova Scotia" <br> EXPRESSION "Nova Scotia" <br> STYLE<br> WIDTH 0.91 <br> OUTLINECOLOR 0 0 0<br> COLOR 187 66 185<br> END <br> END<br> CLASS<br> NAME "Nunavut" <br> EXPRESSION "Nunavut" <br> STYLE<br> WIDTH 0.91 <br> OUTLINECOLOR 0 0 0<br> COLOR 171 222 109<br> END <br> END<br> CLASS<br> NAME "Ontario" <br> EXPRESSION "Ontario" <br> STYLE<br> WIDTH 0.91 <br> OUTLINECOLOR 0 0 0<br> COLOR 250 20 201<br> END<br> END<br> CLASS<br> NAME "Prince Edward Island" <br> EXPRESSION "Prince Edward Island" <br> STYLE<br> WIDTH 0.91 <br> OUTLINECOLOR 0 0 0<br> COLOR 69 153 254<br> END<br> END<br> CLASS<br> NAME "Quebec" <br> EXPRESSION "Quebec" <br> STYLE<br> WIDTH 0.91 <br> OUTLINECOLOR 0 0 0<br> COLOR 6 170 235<br> END<br> END<br> CLASS<br> NAME "Saskatchewan" <br> EXPRESSION "Saskatchewan" <br> STYLE<br> WIDTH 0.91 <br> OUTLINECOLOR 0 0 0<br> COLOR 251 167 144<br> END<br> END<br> CLASS<br> NAME "Yukon Territory" <br> EXPRESSION "Yukon Territory" <br> STYLE<br> WIDTH 0.91 <br> OUTLINECOLOR 0 0 0<br> COLOR 26 34 69<br> END<br> END<br> END<br><br> LAYER<br> NAME province_labels<br> TYPE ANNOTATION<br> STATUS ON<br> DATA '../../../wwwroot/Data/province_dd.shp'<br> LABELITEM 'NAME_ENG'<br> CLASS<br> LABEL<br> TYPE truetype<br> FONT "calibri"<br> SIZE 9<br> COLOR 255 255 255<br> OUTLINECOLOR 0 0 0<br> POSITION CC<br> MINFEATURESIZE 100<br> END # End for label <br> END # end for class<br> PROJECTION<br> "proj=latlong"<br> "ellps=WGS84"<br> END # End for projection<br> END # End for layer<br><br> LAYER<br> NAME 'mjrroads'<br> TYPE LINE<br> DUMP false<br> EXTENT -148.317097 42.348600 -55.567680 86.032387<br> DATA '../../../wwwroot/Data/mjrroads.shp'<br> METADATA<br> 'ows_title' 'mjrroads'<br> END<br> STATUS ON<br> TRANSPARENCY 100<br> PROJECTION<br> 'proj=longlat'<br> 'datum=WGS84'<br> 'no_defs'<br> END<br> CLASSITEM 'TYPE' <br> <br> HEADER "mjrroads_header.html"<br> FOOTER "mjrroads_footer.html"<br><br> TOLERANCE 5<br> TOLERANCEUNITS PIXELS<br> <br><br> CLASS<br> NAME "Primary Highway" <br> EXPRESSION "Primary Highway"<br> MAXSCALE 2500000 <br> TEMPLATE "mjrroads_query.html"<br> <br> STYLE <br> WIDTH 1 <br> COLOR 0 0 0<br> END<br> END<br> CLASS<br> TEMPLATE "mjrroads_query.html"<br> NAME "Expressway" <br> EXPRESSION "Expressway" <br> STYLE <br> WIDTH 2 <br> COLOR 255 0 0<br> END<br> END<br> END<br><br> LAYER<br> NAME major_city_labels<br> TYPE ANNOTATION<br> STATUS ON<br> MAXSCALE 1000000<br> DATA '../../../wwwroot/Data/mjcities'<br> LABELITEM 'NAME'<br> CLASS<br> LABEL<br> TYPE truetype<br> FONT "calibri"<br> SIZE 8<br> COLOR 0 0 0<br> OUTLINECOLOR 255 255 255<br> POSITION CC<br> MINFEATURESIZE 100<br> END # End for label<br> END # end for class<br> PROJECTION<br> "proj=latlong"<br> "ellps=WGS84"<br> END # End for projection<br> END # End for layer<br><br> LAYER<br> NAME 'mjcities'<br> TYPE POINT<br> DUMP false<br> EXTENT -148.317097 42.348600 -55.567680 86.032387<br> DATA '../../../wwwroot/Data/mjcities.shp'<br> METADATA<br> 'ows_title' 'mjcities'<br> END<br><br> STATUS ON<br> MAXSCALE 2500000 <br> TRANSPARENCY 100<br> PROJECTION<br> 'proj=longlat'<br> 'datum=WGS84'<br> 'no_defs'<br> END<br> CLASS<br> NAME 'mjcities'<br> STYLE<br> SYMBOL "S3" <br> SIZE 17<br> OUTLINECOLOR 0 0 0<br> COLOR 0 0 255<br> END<br> <br> END<br> END<br> END</div>
</div></body>
</html>