//   Here's is how I did this.

// You need to use the openlayers proxy:

     OpenLayers.ProxyHost="proxy.cgi?url=";

// WFS layer points to geoserver or your host

            state_layer = new OpenLayers.Layer.WFS( "States WFS",
                  "http://yourhost:8080/geoserver/wfs";,
                    { typename: 'topp:states'} );

===============

I'm using rails, so I create a sort of fake proxy in config/routes.rb

 map.connect '/proxy.cgi',
    :controller => 'wfs',
    :action => 'myproxy'

Then inside the myproxy() action:

if url =~ /geoserver/
     # geo server WFS data
     uri = URI.parse(url)
     resp = Net::HTTP.get_response(uri)
     send_data(resp.body, :type => 'text/xml')
 end
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to