[OpenLayers-Users] Cannot see WFS layer

Damith Amarasena amarasenadamith at gmail.com
Wed Dec 9 04:04:55 EST 2009


Hi Lammie,

Thanks for your reply. You have mentioned about a proxy here. Does that mean
I have to use one? Sorry if you feel this as a dumb question, but I'm new to
openlayers and whole GIS stuff. Please guide me on this.

Regards,
damith

On Wed, Dec 9, 2009 at 2:02 AM, Lammie Jonson <jrubiando at gmail.com> wrote:

> //   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
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091209/e707d589/attachment.html


More information about the Users mailing list