[OpenLayers-Users] Problems with maxExtent and blank images (Mapserver and Mapnik)

Jay Douillard jay.douillard at ubc.ca
Thu Mar 19 12:36:50 EDT 2009


Martin, 

Take a look at the request url that openlayers is sending to mapserver(using firebug). I've had some issues with floating point rounding errors and missing tiles. Try converting your bounds to integers and see if that fixes the problem.

jay


----- Original Message -----
From: "\"tschobber tschöbbi\"" <tschobber at gmx.at>
To: users at openlayers.org
Sent: Thursday, March 19, 2009 4:14:54 AM GMT -08:00 US/Canada Pacific
Subject: [OpenLayers-Users] Problems with maxExtent and blank images (Mapserver and Mapnik)

Hi,

I have two layers in Openlayers - one is for rendering Mapnik maps and the other for rendering with Mapserver. Both have the same data from a postgis database and I declare maxExtent (in map options) with the following values: 

var mapOptions = {maxExtent: new OpenLayers.Bounds(384619.116883103,467965.222077892,505102.701298797,534231.193506524),
                                maxResolution:1.6,
                                numZoomLevels:21);

The problem is if maxExtent is declared I can only see the Mapnik generated map but the map generated with Mapserver just stays blank. Otherwise when I remove the maxExtent attribute I'm able to see the Mapserver generated map but not the Mapnik map.
For Mapnik I'm using a xml file but there is just this line at the beginning that could change anything:

"<Map bgcolor="steelblue" srs="+proj=latlong +datum=WGS84">"

Here is the beginning of the Mapserver mapfile:

MAP

  NAME "Map Viewer"
  STATUS ON
  SIZE 2400 1200
  EXTENT -180 -90 180 90                                                         
  SHAPEPATH "data/"
  IMAGECOLOR 255 255 255
  UNITS DD
  OUTPUTFORMAT
                NAME png
                DRIVER "GD/PNG"                                                  
                MIMETYPE "image/png"
                IMAGEMODE RGB
                EXTENSION "png"
        END
        PROJECTION
                "init=epsg:4326"
        END

        WEB
 IMAGEPATH "/tmp/ms_tmp/"
        IMAGEURL "/ms_tmp/"
                METADATA
                "wms_title"     "Map Viewer"
                        "wms_onlineresource"    "http://gaia.geo.at/cgi-bin/mapserv?map=/srv/www/cgi-bin/data/wms.map"
                        "wms_srs"       "EPSG:4326"
        END
        END


LAYER
    CONNECTION "user=root password=pg dbname=air host=titan.geo.at"
    CONNECTIONTYPE POSTGIS
    DATA "the_geom from gd_line_007_3"
      METADATA
      END
    NAME "fluss01"
    PROJECTION
      "init=epsg:31297"
    END
    SIZEUNITS PIXELS
    STATUS ON
    TOLERANCEUNITS PIXELS
    TRANSPARENCY 100
    TYPE LINE
    UNITS METERS
    CLASS
      NAME "class0"
      METADATA
      END
        STYLE
        ANGLE 360
        COLOR 107 174 214
        WIDTH 1
#        SYMBOL 1
      END
    END
  END
                                                      



Below are the two layers defined in Openlayers script:

var mapserver_agg = new OpenLayers.Layer.WMS("AGG Mapserver","http://gaia.geo.at/cgi-bin/mapserv?map=/srv/www/cgi-bin/data/wms3.map",{map_imagetype:'AGG',layers: ['land_grenzen01','layer_mapany_080305_3ba6226287c1622', 'bezirk_grenzen_01', 'land_grenzen01','staat01','fluss01', 'stadt01'],format: 'image/png'},{isBaseLayer:false},{singleTile: true});


var mapnikwms = new OpenLayers.Layer.WMS("MapnikWMS","http://gaia.geo.at/cgi-bin/mapnikwms.py?",{
layers:['land_grenzen01','staat01','fluss01','bezirk_grenzen01'],
styles:['land_grenzen01','staat01','fluss01','bezirk_grenzen01'],
format:'image/png'});


Hope you can help me!

thanks + regards

Martin
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger01
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users



More information about the Users mailing list