[OpenLayers-Users] Question about GML/WFS compatibility and Styling

Aaron_Gundel at sjwater.com Aaron_Gundel at sjwater.com
Thu Aug 13 12:44:32 EDT 2009


Sorry Christopher, I replied to you but I don't think I cc'd the list. 
Anyway...

Yes, my html is hosted at a different origin.  Yes, I am using a proxy. 
Yes, firebug is showing the file loading up.  The URL does contain the 
requested data and the features are contained within the GML. 
Unfortunately no, there's no url to this right now as it's an intranet 
site. 

Poking around at this further, it looks to be some kind of namespace issue 
with what's coming out of geoserver not being read by openlayers.  I know 
that the basic geometry is valid now, I swapped out some of the elements 
[for some I knew that worked, as per the gml example] and changed some 
namespace attributes and got it to work.  But I can't serve this up from 
geoserver, hence the problem.  Any idea how to work around this?

Aaron





Christopher Schmidt <crschmidt at metacarta.com> 
08/12/2009 06:46 PM

To
Aaron_Gundel at sjwater.com
cc
users at openlayers.org
Subject
Re: [OpenLayers-Users] Question about GML/WFS compatibility and Styling






On Wed, Aug 12, 2009 at 03:57:23PM -0700, Aaron_Gundel at sjwater.com wrote:
> Hello,
> 
> I am fairly new to the vector layers within openlayers and I had a 
> question about their usage.  I'm trying to use the gml layer to display 
> data from a wfs.  (If you're wondering why I'm not using the wfs layer, 
> it's because I couldn't find a method to change the wfs url and reload 
the 
> layer in the wfs layer -- whereas such a method exists within the gml 
> layer, seturl).  It's not working.  I'm using geoserver for the wfs and 
> getting a single feature which I want to display in the gml layer.  I 
> don't know if this is just some inherent incompatibility or if I'm not 
> styling the gml layer properly (I've been experimenting with points that 

> are being retrieved through the wfs.) 
> 
>   var style = new OpenLayers.Style();
>   var rule = new OpenLayers.Rule(
>   {
>        symbolizer: {pointRadius: 10, fillColor: "green", fillOpacity: 
0.5, 
> strokeColor: "black"}
>   });
>   style.addRules([rule]);
>   var gmlLayer = new OpenLayers.Layer.GML("GML","http://mywfscall/wfs",
>           {styleMap:new OpenLayers.StyleMap(style)});
>   return gmlLayer;
> 
> Anyway, I've confirmed that my wfs call is definitely returning gml -- I 

> just can't get it to display.  Can anyone help me out here?

is your HTML page hosted at http://mywfscall/htmlpage.html? That is, does 
it
share the same origin -- protocol (http), domain (mywfscall), port (80)?

Does Firebug show the remote file getting loaded via XMLHttpRequest?
Does the URL that is requestd contain data?
Does the layer.features property have anything in it? 
Can you provide a link?

If not, then you are violating the same origin policy, and need to set up
a proxy: 

  http://faq.openlayers.org/proxyhost/all/


Regards,
-- 
Christopher Schmidt
MetaCarta

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


More information about the Users mailing list