- I have python2.7 and apache installed in my computer.
- In proxy.cgi, I included in topline :
#!/usr/bin/env python.exe -u;
- I also added 'localhost:8080/geoserver' and 'localhost:80 in allowedhosts.
- I moved the OpenLayers files to htdocs folder of apache.
- I copied the cgi file to apche/cgi-bin.
- Now, when I click on feature, popup appears but is empty.
Please help!! where my code went wrong? Given below is my code:
<script type="text/javascript" src="http://localhost:8080/recipes/resources/ext/ext-all.js"></script>
<link rel="stylesheet" type="text/css" href="http://localhost:8080/recipes/resources/ext/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="http://localhost:8080/recipes/resources/ext/resources/css/xtheme-gray.css" />
<link rel="stylesheet" href="http://localhost:8080/recipes/resources/openlayers/theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="http://localhost:8080/recipes/resources/app/theme/style.css" type="text/css" />
<link rel="stylesheet" href="http://localhost:8080/recipes/resources/geoext/resources/css/gxtheme-gray.css" type="text/css" />
<script src="http://localhost:8080/recipes/resources/openlayers/build/OpenLayers.js"></script>
<script src="http://localhost:8080/recipes/resources/geoext/build/GeoExt.js"></script>
<script>
OpenLayers.ImgPath = "http://localhost:8080/recipes/resources/openlayers/img/";
// the `panel` and `popup` variables are declared here for easy debugging
var panel, popup;
Ext.onReady(function() {
OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";
// queryable WMS layer
var zoning = new OpenLayers.Layer.WMS(
"railroads",
"http://localhost:8080/geoserver/usa/wms",
{layers: "usa:states", format: "image/gif", transparent: "true"}
);
panel = new GeoExt.MapPanel({
title: "MapPanel",
renderTo: "map-id",
height: 300,
width: "100%",
layers: [
new OpenLayers.Layer.WMS(
"Global Imagery",
"http://maps.opengeo.org/geowebcache/service/wms",
{layers: "openstreetmap", format: "image/png"}
),
zoning
],
center: [-122.87, 42.34],
zoom: 13
});
// create a control to get feature info from queryable layers
var control = new OpenLayers.Control.WMSGetFeatureInfo({
url: "http://localhost:8080/geoserver/usa/wms"
title: 'Identify features by clicking',
layers: [zoning],
});
panel.map.addControl(control);
control.activate();
// register a listener for the getfeatureinfo event on the control
control.events.on({
getfeatureinfo: function(event) {
// close existing popup
if (popup) {
popup.destroy();
}
popup = new GeoExt.Popup({
title: "Popup",
map: panel.map,
lonlat: panel.map.getLonLatFromPixel(event.xy),
width: 250,
autoScroll: true,
collapsible: true,
bodyStyle: {padding: 5},
html: event.text
});
popup.show();
}
});
});
</script>
After changing the path to wamp/www and still I am getting this new following error: