[OpenLayers-Users] (no subject)

Özkan, Ayhan oezkan at bi.bisnode.de
Fri Mar 12 04:34:21 EST 2010


Hello Everyone,

 

I'm trying to show a layer from an UMN Mapserver onto

my OpenLayers html page. The image from the mapfile is displayed very well

if i request '/cgi-bin/mapserv?map=/srv/www/htdocs/landkreise.map' this url.

 

But if i wan't to show this layer via Openlayers there is a white image.

I think there is something fundamentally wrong I'm doing.

 

Below is the code for both the mapfile and the html page. Please help me

out.

 

Script -Tag in the HTML:

-------------------------------------------------------------------

<script defer="defer" type="text/javascript">

 

var proj4326  = new OpenLayers.Projection('EPSG:4326');

var projmerc  = new OpenLayers.Projection('EPSG:900913');

 

            var options = {

    numZoomLevels: 19,

    projection: proj4326,

    displayProjection: proj4326,

                        controls:[

                                   new OpenLayers.Control.Navigation(),

                                   new OpenLayers.Control.PanZoomBar(),

                                   new OpenLayers.Control.LayerSwitcher(),

                                   new OpenLayers.Control.MousePosition(),

                                   new OpenLayers.Control.Scale('scale'),

                                   new OpenLayers.Control.Permalink('permalink')

                        ],

                        eventListeners : {

                                   "zoomend" : handleZoomend,

                                   "moveend" : handleMoved,

                                   "mousemove" : handleMousemove

                        }

            };

 

  var map = new OpenLayers.Map('map', options);

  

  var germany = new OpenLayers.Layer.OSM(

    "Geografische Karte",

    "http://primus.tiles.dev.bisnode.de/${z}/${x}/${y}.png",

                        {isBaseLayer: true}

  );

 

  var landkreis = new OpenLayers.Layer.WMS( "Landkreise",

          "http://da-appserv30/cgi-bin/mapserv?",

          {map: '/srv/www/htdocs/landkreise.map',

                                                           layers: 'k09gk3_testdaten',

                                                           format: 'png',

                                                           transparent: true},

          {maxExtent: new OpenLayers.Bounds(3449180.611900,5509043.433700,3503706.767400,5549850.938100),

          scales: [5000,10000,25000,50000,100000,250000,500000,

                   1000000,2500000,5000000,10000000,25000000,50000000,100000000],

          units: 'm',

          projection:new OpenLayers.Projection("EPSG:31467"),

          gutter:0,

          ratio:1,

          wrapDateLine: true,

          isBaselayer:false,

          singleTile:true,

          transitionEffect:'resize',

                                                           numZoomLevels: 19

                                                           } );

 

  map.addLayers([germany,landkreis,wms]);

            var lonLat = new OpenLayers.LonLat(8.65, 49.81).transform(

                         proj4326, map.getProjectionObject()

            );

 

            map.setCenter (lonLat,9);

 

</script>

-------------------------------------------------------------------

 

MAPFILE

###############################################

 

MAP

  NAME LAND

  EXTENT 3449180.611900 5509043.433700 3503706.767400 5549850.938100

  SIZE 600 600

  SHAPEPATH "data"

 

            WEB

                IMAGEPATH "/srv/www/htdocs/work/"

                IMAGEURL "/work/"

 

                METADATA

                    WMS_TITLE "UMN MAP Server"

                    WMS_SRS "epsg:31467"

                    LABELCACHE_MAP_EDGE_BUFFER "-10"  #This will ensure that no labels are drawn within 10 pixels of a tile boundary

                END

            TEMPLATE example3.html

            END

            DEBUG 10

            

            #CONFIG "PROJ_LIB" "/srv/www/htdocs/test/mapserver-utils"

            CONFIG "PROJ_LIB" "/usr/share/proj/"

            CONFIG "MS_ERRORFILE" "/srv/www/htdocs/work/ms_error.txt"

 

            PROJECTION

                        "init=epsg:31467"

            END

 

  LAYER

    NAME "k09gk3_testdaten"

    #FILTER ("[KGS5]" == "06432")

    DATA k09gk3_testdaten

    STATUS DEFAULT

    TYPE POLYGON

 

                        PROJECTION

                                   "init=epsg:31467"

                        END

                        

                        CLASS

                                   NAME "Kreise"

                                   EXPRESSION ("[KGS5]" != "06432")

      OUTLINECOLOR "#C60F0F"

      COLOR 50 50 50

    END

 

    CLASS

            EXPRESSION ("[KGS5]" == "06432")

            NAME "Da-Di"

      STYLE

          OUTLINECOLOR "#2427AA"

          COLOR 150 50 50

          OPACITY 5

      END

    END

  END

 

END

 

 

###############################################

 

OGRINFO of the shapfiles

 

INFO: Open of `k09gk3_testdaten.shp'

      using driver `ESRI Shapefile' successful.

 

Layer name: k09gk3_testdaten

Geometry: Polygon

Feature Count: 3

Extent: (3449180.611900, 5509043.433700) - (3503706.767400, 5549850.938100)

Layer SRS WKT:

PROJCS["DHDN_3_Degree_Gauss_Zone_3",

    GEOGCS["GCS_Deutsches_Hauptdreiecksnetz",

        DATUM["Deutsches_Hauptdreiecksnetz",

            SPHEROID["Bessel_1841",6377397.155,299.1528128]],

        PRIMEM["Greenwich",0.0],

        UNIT["Degree",0.0174532925199433]],

    PROJECTION["Transverse_Mercator"],

    PARAMETER["False_Easting",3500000.0],

    PARAMETER["False_Northing",0.0],

    PARAMETER["Central_Meridian",9.0],

    PARAMETER["Scale_Factor",1.0],

    PARAMETER["Latitude_Of_Origin",0.0],

    UNIT["Meter",1.0]]

V_LFD: Integer (4.0)

V_DAT: String (4.0)

KGS5: String (5.0)

KRS_NAME: String (70.0)

 

 

#########

 

Does anybody have a clue on what I'm doing wrong?

 

Thanks in advance

Ayhan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100312/8389f7df/attachment.html


More information about the Users mailing list