[OpenLayers-Users] Re: Mapserver untiled problem

Saka Royban sakaroyban at yahoo.com
Tue May 24 11:38:09 EDT 2011


hello again
I setup wms server but still i get 2 tile of 256*256 pixel via openlayers (as i 
was getting through OpenLayers.Layer.Mapserver). I've no idea what's wrong. this 
is at the time of specifying size paramater in mapfile to be 800*400.
When i test wms  server using urls provided in mapserver manual, everything goes 
right i.e. an image output with size of 800*400.
Any idea?

Best regards




________________________________
From: Slawomir Messner <slawomir.messner at staff.uni-marburg.de>
To: Saka Royban <sakaroyban at yahoo.com>
Cc: openlayers-users at lists.osgeo.org
Sent: Mon, May 23, 2011 2:09:48 AM
Subject: Re: [OpenLayers-Users] Re: Mapserver untiled problem

 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 <sakaroyban at yahoo.com>
>To: openlayers-users at lists.osgeo.org
>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 
>Users at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/openlayers-users 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110524/8f477cd9/attachment-0001.html


More information about the Users mailing list