[OpenLayers-Dev] problem with vector Layer Feature's geometry, that is null !

Alexandre Dube adube at mapgears.com
Thu Jan 28 08:44:05 EST 2010


Rohala,

I replied to your message from Nabble because I didn't see it in my 
OpenLayers-Dev Mailing-List mailbox. I guess it's because of the big 
image attached to it. I'll copy it here for convenience. See below.

BTW, your problem is more suitable for the users mailing list.

Regards,

Alexandre


Alexandre Dubé wrote:
> Rohala,
>
>   If you look at the Console tag, you can see the request sent.  From there,
> look a the response received.  Does the response have geometry ?  If it
> does, put a breakpoint on your format "read" method to see what happens and
> why the geometry isn't parsed.
>
> Regards,
>
> Alexandre
>   

Original message :

HHi guys
I use OpenLayers.Protocol.WFS approach for display a vector layer. this 
layer include points.
This is my code :

var saveStrategy = new OpenLayers.Strategy.Save();
EducationLayer = new OpenLayers.Layer.Vector("EducationLayer Ho ha ha", {
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
projection: new OpenLayers.Projection("EPSG:4326"),
styleMap: EduStyles,
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
srsName: "EPSG:4326",
url: "../../cgi-bin/mapserv.exe?map=../../apps/mashar/mashar.map&",
featureNS : "http://localhost:3000/mashar/wfs",
featureType: "Education",
featurePrefix: "MF",
schema: 
"http://localhost:3000/cgi-bin/mapserv.exe?map=../../apps/mashar/mashar.map&SERVICE=WFS&version=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=MF:Education 
<http://localhost:3000/cgi-bin/mapserv.exe?map=../../apps/mashar/mashar.map&SERVICE=WFS&version=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=MF:Education>" 

})
});

with this code i can see EducationLayer features retrieved to browser 
and loaded (I use Firefox with Firebug extension). but nothing displayed 
on map.

When i want to see geometry property of EducationLayer such as 
EducationLayer.Features[each number of array].geometry it retrieve null.

where is my wrong?

below picture explain more detail: [1]

I use Mapserver as WFS server with this configs in web section:
WEB
IMAGEPATH "./tmp/"
IMAGEURL "./tmp/"
METADATA
"wfs_title" "Mashar WFS Server"
"wfs_onlineresource" 
"http://localhost:3000/cgi-bin/mapserv.exe?map=../../apps/mashar/mashar.map& 
<http://localhost:3000/cgi-bin/mapserv.exe?map=../../apps/mashar/mashar.map&>" 

"wfs_srs" "EPSG:4326"
"wfs_abstract" "Some text"
"wfs_encoding" "UTF-8"
"wfs_namespace_uri" "http://localhost:3000/mashar/wfs"
"wfs_namespace_prefix" "MF"
END
END


And there is Layer definition section in map file:
LAYER
NAME "Education"
TYPE POINT
DATA "Education"
METADATA
"wfs_title" "Education"
"WFS_ABSTRACT" "Education WFS Layer"
"gml_include_items" "all"
END
STATUS DEFAULT
TRANSPARENCY 100
DUMP TRUE
CLASS
NAME 'Education'
STYLE
SYMBOL 'CIRCLE'
SIZE 2
OUTLINECOLOR 0 0 0
COLOR 45 220 182
END
END
END

This problem confused me very much. solving this problem is very 
important for me.
Thanks in advance!

[1] http://n2.nabble.com/file/n4472008/error.gif

-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the Dev mailing list