[OpenLayers-Users] wfs markers without the redraw?

Eric Lemoine eric.c2c at gmail.com
Wed Aug 13 02:42:43 EDT 2008


On Wed, Aug 13, 2008 at 6:51 AM, Brenningmeyer, Todd
<tbrenningmeyer at maryville.edu> wrote:
> Thanks Eric.  I'm including the html page.  Hopefully this will help.  I'm adding two WMS layers and then would like to add the markers layer to symbolize Greek villages that we surveyed several years ago.  Thanks again,
> Todd

See my comment inline in the code.

>
> <html xmlns="http://www.w3.org/1999/xhtml">
>  <head>
>    <link rel="stylesheet" href="OpenLayers-2.6/theme/default/style.css" type="text/css" />
>    <script src="OpenLayers-2.6/lib/OpenLayers.js"></script>
>    <script src="testStyleMap.js"></script>
>    <script src="OpenLayers-2.6/lib//Firebug/firebug.js"></script>
>    <script type="text/javascript">
>
>        var map, selectControl, selectedFeature;
>        var lon = 544134;
>        var lat = 4183845;
>        var zoom = 4;
>        var Layer;
>        function init(){
>            map = new OpenLayers.Map( 'map', {
>              maxResolution: 200,
>              maxExtent: new OpenLayers.Bounds(426367,3991789,756976,4312918),
>              units: 'm',
>              projection: 'EPSG:32634'
>              } );
>
>            baseLayer = new OpenLayers.Layer.WMS( "Greece",
>                    "http://localhost/cgi-bin/mapserv.exe", {
>                     layers: "ocean,country,hillshade_mask,provinces_utm,roads_utm",
>                     map: "../htdocs/amap/amap.map",
>                     transparent: "false",
>                     format: "image/png" },
>                     {singleTile: false}
>                     );
>            labelLayer = new OpenLayers.Layer.WMS( "labels",
>                    "http://localhost/cgi-bin/mapserv.exe", {
>                     layers: "provinces_label",
>                     map: "../htdocs/amap/amaplabels.map",
>                     transparent: "true",
>                     format: "image/png" },
>                     {singleTile: true}
>                     );
>
>           gmlLayer = new OpenLayers.Layer.GML( "villages",
>                "http://localhost/cgi-bin/mapserv.exe",{
>                map:"../htdocs/amap/sites_wfs.map",
>                typename: "villages",
>               outputformat: "gml2"}//
>            );

You cannot pass params in this way. With Layer.GML you must do:

gmlLayer = new OpenLayers.Layer.GML("villages",
    "http://localhost/cgi-bin/mapserv.exe?map=../htdocs/amap/sites_wfs.map&typename=villages&outputformat=gml2");

In addition, don't you miss the service, version and request params to
make it an actual WFS request?

gmlLayer = new OpenLayers.Layer.GML("villages", [
    "http://localhost/cgi-bin/mapserv.exe",
    "?map=../htdocs/amap/sites_wfs.map",
    "SERVICE=WFS",
    "VERSION=1.0.0",
    "REQUEST=GetFeature",
    "&typename=villages"
    "&outputformat=gml2"].join(",")
);

But I don't that will fix the getSize problem, which I currently don't
see where it comes from. Sorry.

--
Eric



More information about the Users mailing list