<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000;">Hello all<br><br><span>I am a new bee in open source development, for learning i start with the basic examples. I download the proxy.cgi, change it to proxy.py (Working with IIS), implemented each and every step on net. but I am unable to use proxy.py. when i check manually (<a target="_blank" href="http://localhost:80/proxy.py">http://localhost:80/proxy.py</a>) it is giving </span><pre>Some unexpected error occurred. Error text was: <urlopen error (10061, 'Connection refused')><br><br>Iam using my college internet for this, which may contain firewalls. I kno it is a TCP/IP error.<br><br>My Question is can we use localhost as the proxy server.<br><br>below is my code, Thanks for any help in advance. As it keep my interest in Open source development<br>& learning
<br></pre><span> I try calling WMS from both Geoserver on <a target="_blank" href="http://localhost:85">http://localhost:85</a> & from remote WMS also.</span><br><br>code:<br><span></span><br> <head><br> <link rel="stylesheet" href="../OpenLayers-2.10/theme/default/style.css type="text/css" /><br> <link rel="stylesheet" href="style.css" type="text/css" /><br> <title>WFS: GetFeature Example (GeoServer)</title><br><br><span> <script src="%3Ca%20target=%27_blank%27%20href=%27http://www.openlayers.org/api/OpenLayers.js%27%3Ehttp://www.openlayers.org/api/OpenLayers.js%3C/a%3E"></script></span><br> <script type="text/javascript"><br> var map, layer, select, hover, control;<br><br> function init(){<br>
OpenLayers.ProxyHost= "/cgi-bin/proxy.py?url=";<br> map = new OpenLayers.Map('map', {<br> controls: [<br> new OpenLayers.Control.PanZoom(),<br> new OpenLayers.Control.Permalink(),<br> new OpenLayers.Control.Navigation()<br> ]<br> });<br> layer =
new OpenLayers.Layer.WMS(<br> "States WMS/WFS",<br><span> "<a target="_blank" href="http://v2.suite.opengeo.org/geoserver/ows">http://v2.suite.opengeo.org/geoserver/ows</a>",</span><br> {layers: 'usa:states', format: 'image/gif'}<br> );<br> layer2 = new OpenLayers.Layer.WMS( "India ",<br><span> "<a target="_blank"
href="http://localhost:8080/geoserver/wms">http://localhost:8080/geoserver/wms</a>",</span><br> { "layers": "india_gc:ind_g_polygon",<br> "format": "image/png",<br> "version": "1.1.1",<br>
"transparent": "TRUE",<br> "SLD_BODY": theSLD_BODY<br> });<br> select = new OpenLayers.Layer.Vector("Selection", {styleMap:<br> new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"])<br> });<br><br> hover = new OpenLayers.Layer.Vector("Hover");<br> map.addLayers([layer, hover,
select]);<br><br> control = new OpenLayers.Control.GetFeature({<br> protocol: OpenLayers.Protocol.WFS.fromWMSLayer(layer),<br> box: true,<br> hover: true,<br> multipleKey: "shiftKey",<br> toggleKey: "ctrlKey"<br> });<br> control.events.register("featureselected", this, function(e)
{<br> select.addFeatures([e.feature]);<br> });<br> control.events.register("featureunselected", this, function(e) {<br> select.removeFeatures([e.feature]);<br> });<br> control.events.register("hoverfeature", this, function(e) {<br> hover.addFeatures([e.feature]);<br> });<br>
control.events.register("outfeature", this, function(e) {<br> hover.removeFeatures([e.feature]);<br> });<br> map.addControl(control);<br> control.activate();<br><br> map.setCenter(new OpenLayers.Bounds(-140.444336,25.115234,-44.438477,50.580078).getCenterLonLat(), 3);<br> }<br> </script><br> </head><br><br> <body onload="init()"><br><h1 id="title">WFS GetFeature Example (GeoServer)</h1><br><br><div id="tags"><br>WFS, GetFeature<br></div><br><br><p id="shortdesc"><br>
Shows how to use the GetFeature control to select features from a WMS layer.<br></p><br><br><div id="map" class="smallmap"></div><br><br><div id="docs"><br><br> <p><br> click<br> </p><br></div><br> </body><br></html><br><br><br><br></div><br><br><div> </div>--<br>With Regards<br>veenu</div><br>
</body></html>