Hi,
we don't use the Ol.Layer.MapServer class for our MapServer layers but
OL.Layer.WMS and it works fine.
I assume it would look like this with your parameters:
new OpenLayers.Layer.WMS("World Map", "http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/apps/ms101/htdocs/ms101.map",
{"layers": "continents","format":"image/png"}, {singleTile: true});
As you see we tell the server which layers to request, maybe this is
what's missing in your code and you should use the whole path to the
mapfile or hide the mapserver behind a proxy which hides/masks the path.
I hope it helps.
Regards
Slawomir
Am 23.05.2011 10:24, schrieb Saka Royban:
Am i posting in wrong section? Should i post in mapserver mailing list
------------------------------------------------------------------------
*From:* Saka Royban <[email protected]>
*To:* [email protected]
*Sent:* Thu, May 19, 2011 11:42:48 PM
*Subject:* Mapserver untiled problem
Hi all.
I'm gonna use a mapserver untiled layer but the result just fills
heart of produced image and near borders it is filled by background
color. this is javascript code:
function init(){
map = new OpenLayers.Map("map");
layer = new OpenLayers.Layer.MapServer( "World
Map",
"http://localhost/cgi-bin/mapserv.exe", {map:
'/ms4w/apps/ms101/htdocs/ms101.map'},
{singleTile: true} );
layer.ratio=1;
map.addLayer(layer);
map.zoomToMaxExtent();
}
It sounds the problem is with extent because FireBug shows:
imgext|-281.25 -140.625 281.25 140.625
|
mapext|-281.25 -140.625 281.25 140.625|
while my mapfile is as follows:
MAP
NAME "MS101"
EXTENT -180 -90 180 90 # Geographic
SIZE 800 400
IMAGECOLOR 128 128 255
SHAPEPATH '../data'
FONTSET '../fonts/fonts.list'
IMAGETYPE png24
PROJECTION
"init=epsg:4326"
END
LEGEND
STATUS on
LABEL
TYPE TRUETYPE
FONT vera_sans
COLOR 0 0 0
SIZE 8
ANTIALIAS TRUE
END
END
LAYER # World polygon classified by continents begins here
NAME continents
DATA 'shapefile/Countries_area'
STATUS default
TYPE POLYGON
PROJECTION
"init=epsg:4326"
END
CLASSITEM 'NA3DESC'
LABELITEM 'NA3DESC'
CLASS
NAME 'Africa'
EXPRESSION 'Africa'
STYLE
COLOR 255 128 128
END
LABEL
COLOR 64 64 64
OUTLINECOLOR 212 212 212
TYPE TRUETYPE
FONT vera_sans-bold-italic
SIZE 12
ANTIALIAS TRUE
POSITION CC
PARTIALS FALSE
MINDISTANCE 250
BUFFER 4
END
END
CLASS
NAME 'Antarctica'
EXPRESSION /Antarctic./ #'Antarctic Area'
STYLE
COLOR 128 255 128
END
LABEL
COLOR 64 64 64
OUTLINECOLOR 212 212 212
TYPE TRUETYPE
FONT vera_sans-bold-italic
SIZE 10
ANTIALIAS TRUE
POSITION CC
PARTIALS FALSE
MINDISTANCE 250
BUFFER 4
END
END
CLASS
NAME 'Asia'
EXPRESSION 'Asia'
STYLE
COLOR 0 0 255
END
LABEL
COLOR 64 64 64
OUTLINECOLOR 212 212 212
TYPE TRUETYPE
FONT vera_sans-bold-italic
SIZE 10
ANTIALIAS TRUE
POSITION auto
PARTIALS FALSE
MINDISTANCE 250
BUFFER 4
END
END
CLASS
NAME 'Oceania'
EXPRESSION /Australia*/ #'Australian Area'
STYLE
COLOR 255 255 128
END
LABEL
COLOR 64 64 64
OUTLINECOLOR 212 212 212
TYPE TRUETYPE
FONT vera_sans-bold-italic
SIZE 10
ANTIALIAS TRUE
POSITION CC
PARTIALS FALSE
MINDISTANCE 250
BUFFER 4
END
END
CLASS
NAME 'Europe'
EXPRESSION 'Europe'
STYLE
COLOR 255 128 255
END
LABEL
COLOR 64 64 64
OUTLINECOLOR 212 212 212
TYPE TRUETYPE
FONT vera_sans-bold-italic
SIZE 10
ANTIALIAS TRUE
POSITION CC
PARTIALS FALSE
MINDISTANCE 250
BUFFER 4
END
END
CLASS
NAME 'North America'
EXPRESSION 'North America'
STYLE
COLOR 128 255 255
END
LABEL
COLOR 64 64 64
OUTLINECOLOR 212 212 212
TYPE TRUETYPE
FONT vera_sans-bold-italic
SIZE 10
ANTIALIAS TRUE
POSITION CC
PARTIALS FALSE
MINDISTANCE 250
BUFFER 4
END
END
CLASS
NAME 'South America'
EXPRESSION 'South America'
STYLE
COLOR 255 192 96
END
LABEL
COLOR 64 64 64
OUTLINECOLOR 212 212 212
TYPE TRUETYPE
FONT vera_sans-bold-italic
SIZE 10
ANTIALIAS TRUE
POSITION CC
PARTIALS FALSE
MINDISTANCE 250
BUFFER 4
END
END
END # World polygon classified by continents ends here
LAYER # World polygon layer begins here
NAME world_poly
GROUP world
DATA 'shapefile/Countries_area.shp'
STATUS ON
TYPE LINE
PROJECTION
"init=epsg:4326"
END
CLASS
NAME 'The World'
STYLE
COLOR 220 220 220
END
END
END # World polygon layer ends here
END
Thanks in advance
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users