[OpenLayers-Users] trouble with WFS and Mapserver

Burgholzer,Robert rwburgholzer at deq.virginia.gov
Thu Sep 27 16:06:17 EDT 2007


I am having a hard time getting my mapserver to serve up WFS layers (or
accessing them via OpenLayers, I really don't know which).

 

I have tested the mapserver with WMS, and all is good. I am able to
retrieve WFS data from mapserver via an URL request for getfeature,
however, I get no success when trying to load it into openlayers via
WFS, just a blank map.  In the javascript error console, all I get is an
error that the "maxExtent has no properties", indicating that there are
no valid layers, I assume, which is of course evidenced by the fact that
my map is blank.

 

My creation statement and mapserver layer description is as follows:

 

OL:

            layer1 = new OpenLayers.Layer.WFS( "poli_bounds",

                    url, {'typename': 'poli_bounds'},

               {

                      typename: 'poli_bounds',

                      featureNS: 'http://www.openplans.org/topp',

                      extractAttributes: false

               } );

 

MAPFILE:

LAYER

   CONNECTIONTYPE postgis

   CONNECTION "host=localhost user=postgres password=*** dbname=wsp"

   NAME poli_bounds

   GROUP poli_bounds

   TYPE POLYGON

   STATUS DEFAULT

   DUMP TRUE

   DATA "the_geom from poli_bounds"

   FILTER "1 = 1"

   TEMPLATE drought.html

   #MINSCALE 1000

   #MAXSCALE 50000

   LABELITEM "name"

   CLASS

      NAME "Political Boundaries"

      SYMBOL 'circle'

      SIZE 3

      COLOR -1 -1 -1

      BACKGROUNDCOLOR 0 0 0

      OUTLINECOLOR 0 0 0

      LABEL

        COLOR 8 8 174

        #SHADOWCOLOR 218 218 218

        #SHADOWSIZE 2 2

        TYPE TRUETYPE

        FONT arial

        SIZE 7

        ANTIALIAS TRUE

        POSITION CC

        PARTIALS FALSE

        MINDISTANCE 300

        MINFEATURESIZE 30

        BUFFER 4

        #MINSCALE 1000

        #MAXSCALE 50000

      END # end of label

   END

   TOLERANCE 10

   PROJECTION

   # EPSG SRID = 4326

     "proj=latlong"

   END

   METADATA

    "DESCRIPTION"   "Political Boundaries"

    "RESULT_FIELDS" "name county state"

    "wfs_title"    "poli_bounds" ## REQUIRED

    "gml_featureid" "gid" ## REQUIRED

    "gml_include_items" "all"  ## Optional (serves all attributes for
layer)

      "title" "Political Boundaries"

      "tablename" "Political Boundaries"

   END

END

 

 

Robert W. Burgholzer

Surface Water Modeler

Office of Water Supply and Planning

Virginia Department of Environmental Quality

rwburgholzer at deq.virginia.gov

804-698-4405

Open Source Modeling Tools:

http://sourceforge.net/projects/npsource/

Web-Based Water Supply Planning Demo:

http://soulswimmer.dynalias.net/models/wsdemo/demo_hsi.php

 

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


More information about the Users mailing list