[GIS] Single tiled Mapserver WMS to avoid Labels and features cut along tile borders and repeated labels

labelingmapserveropenlayers-2tileswms

I am using Mapserver-wms-openlayers for publishing maps. But there are some issues came across related to duplicate labeling for same feature in adjacent tiles, unwanted breaks in line features along tile borders, labels cut along tile boarders.
Not much documentations to clear this anywhere.
Can I create single tile using mapserver wms? Just increasing the tile-size to container (map-div) size is enough?

My code is:

map = new OpenLayers.Map('map',
  {zoomDuration: 1,projection: 'EPSG:3857'}
);

var mymap_all = new OpenLayers.Layer.WMS("EOL",
"http://192.168.0.233/cgi-bin/mapserv?map=/var/www/ms‌​test/test_plant.map",
  {'layers':"map_outline",
   'transparent':true,
   'format':'image/p‌​ng'},
  {isBaseLayer: false,opacity: 100},
  {singleTile: true, ratio: 1}
);

var gmap = new OpenLayers.Layer.Google("Google Streets", // the default
  {numZoomLevels: 25,visibility: false},
  {isBaseLayer: true}
);

map.addLayers([mymap_all,gmap]);

See the cut off and duplicate labels along tile birders

See an individual tile.

Best Answer

This is a comparison between multiple tiles and single tile using WMS in OpenLayers:

var map = new OpenLayers.Map({
    div: "mapDiv",
    layers: [
        new OpenLayers.Layer.WMS(
            "Single Tile", 
            "http://vmap0.tiles.osgeo.org/wms/vmap0",
            {layers: "basic"}, 
            {singleTile: true, ratio: 1}
        ), 
        new OpenLayers.Layer.WMS(
            "Multiple Tiles", 
            "http://vmap0.tiles.osgeo.org/wms/vmap0",
            {layers: "basic"}
        )
    ],
    center: new OpenLayers.LonLat(6.5, 40.5),
    zoom: 4
});

map.addControl(new OpenLayers.Control.LayerSwitcher());

Here is the example:

http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/single-tile.html

Since you are also dealing with Google basemaps, you need to add mercator projections to your mapfile, these posts can guide you to do so:

with WFS:

http://geographika.co.uk/mapserver-openlayers-and-the-wfs-maze

Basically you need to adapt your projection settings (in OL and MS) to allow the correct display of your layers together.

Since MapServer understands WMS, you just need to pass your map file data as WMS like here. About your labels, using PARTIALS may solve your issue.