Hi Lammie,<br><br>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.<br>
<br>Regards,<br>damith<br><br><div class="gmail_quote">On Wed, Dec 9, 2009 at 2:02 AM, Lammie Jonson <span dir="ltr"><<a href="mailto:jrubiando@gmail.com">jrubiando@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
// Here's is how I did this. <br><br>// You need to use the openlayers proxy:<br><br> OpenLayers.ProxyHost="proxy.cgi?url=";<br><br>// WFS layer points to geoserver or your host<br><br> state_layer = new OpenLayers.Layer.WFS( "States WFS",<br>
"<a href="http://yourhost:8080/geoserver/wfs" target="_blank">http://yourhost:8080/geoserver/wfs</a>",<br> { typename: 'topp:states'} );<br><br>===============<br><br>
I'm using rails, so I create a sort of fake proxy in config/routes.rb<br>
<br> map.connect '/proxy.cgi',<br> :controller => 'wfs',<br> :action => 'myproxy'<br><br>Then inside the myproxy() action:<br><br>if url =~ /geoserver/<br> # geo server WFS data<br>
uri = URI.parse(url)<br> resp = Net::HTTP.get_response(uri)<br> send_data(resp.body, :type => 'text/xml')<br> end<br>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
<br></blockquote></div><br>