[OpenLayers-Users] problem with WFS Features

Pedrazzi Gelsomini pedrazzi.gelsomini at gmail.com
Fri Sep 21 20:30:30 EDT 2007


Hi to everyone...

I have a seriouse problem with my WFS layer.
I m going to explian before the context of my project.
I have developed a web application that has a map built using OpenLayer.
This map is created overlapping three different layers:
- Google
- WMS
- WFS
Here the code.

-------------------
var satellite = new OpenLayers.Layer.Google( \"Google Satellite\" , {type:
G_SATELLITE_MAP, 'minZoomLevel': myminZoomLevel, 'maxZoomLevel':
mymaxZoomLevel, layers: 'basic'});

var openspace_wms = new OpenLayers.Layer.WMS( \"Openspace\",
\"".MAPSERVER_URL."\", {map: '".MAPFILE_PATH."', transparent:'true', layers:
'openspace', 'format':'png'});

var explore_wfs = new OpenLayers.Layer.WFS( \"Soundscapes\",
\"".MAPSERVER_URL."\",         {map: '".MAPFILE_PATH."', typename:
\"explorePoints\"}, { featureClass: OpenLayers.Feature.WFS});
-------------------

The WFS layer is composed by round icons (dots): I get the coordinates of my
dots from my database throught a mapserver request. Mapserver returns the
dots in a gml code and I use the function processXMLNode in order to build
the markers representing my dots.
Some days ago, everything was working... now, apparently without reasons,
the WFS layer is not overlapped on my map. I can see the data returned from
MapServer (the data are not null) but I cannot see the markers on the map.
I really don't know what could be happened... Someone knows if it is
possible that some gml reference is changed?
I don't know very well the subject (gml version, etc) so I don't know if the
problem could be linked to something like that.

Here the function that processes my data: is it right to use the web site
http://www.opengis.net/gml and
http://ogc.dmsolutions.ca/gml/2.1.2/feature.xsd as I do?
I repeat, I have not changed anything in my code and the only thing that I
can think it is that some external source is changed.....

processXMLNode: function(xmlNode) {

var point = OpenLayers.Ajax.getElementsByTagNameNS(xmlNode, "
http://www.opengis.net/gml", "gml", "Point");

var mysql = OpenLayers.Ajax.getElementsByTagNameNS(xmlNode, "
http://ogc.dmsolutions.ca/gml/2.1.2/feature.xsd", "MYSQL", "points");

var text_gml  = OpenLayers.Util.getXmlNodeValue(
OpenLayers.Ajax.getElementsByTagNameNS(point[0],
"http://www.opengis.net/gml","gml",
"coordinates")[0]);

var floats = text_gml.split(",");

var id_point_mysql  = OpenLayers.Util.getXmlNodeValue(
OpenLayers.Ajax.getElementsByTagNameNS(mysql[0], "
http://ogc.dmsolutions.ca/gml/2.1.2/feature.xsd","MYSQL", "fid")[0]);

var id_color_mysql = OpenLayers.Util.getXmlNodeValue(
OpenLayers.Ajax.getElementsByTagNameNS(mysql[0], "
http://ogc.dmsolutions.ca/gml/2.1.2/feature.xsd","MYSQL",
"des_color_id")[0]);

data = {lonlat: new
OpenLayers.LonLat(parseFloat(floats[0]),parseFloat(floats[1])),id:
parseInt(id_point_mysql), color_id:
parseInt(id_color_mysql)};

  return data;
},

Any idea?
Thanks very much for every kind of help!
It is very important!
F. P.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070922/3eaf4293/attachment.html


More information about the Users mailing list