[OpenLayers-Users] WMSGetFeatureInfo (popup) not working

Nomeneta Saili nome.saili at gmail.com
Tue Nov 5 06:20:04 PST 2013


Hi list,

I have followed the the example here
http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/getfeatureinfo-popup.html

Somehow the info does not popup when i click on the features of WMS
layers i have added to the map. My html is accessed from my laptop
that is outside of where the Geoserver with layers is hosted.

++++++++++++++++++++++++++++++++++++++++++
 <script type="text/javascript" src="OpenLayers.js"></script>

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

var info;

//layer
var wms_building = new
OpenLayers.Layer.WMS('Building','http://118.139.181.241:8040/geoserver/wms/building_footprint',{layers:
'building_footprint', transparent: true},{visibility: false});

//Getinfo
info = new OpenLayers.Control.WMSGetFeatureInfo({
url: 'http://118.139.181.241:8040/geoserver/wms', title: 'Identify
features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
map.addPopup(new OpenLayers.Popup.FramedCloud("chicken",
map.getLonLatFromPixel(event.xy),null,event.text,null,true));
}
}
});
map.addControl(info);
info.activate();

+++++++++++++++++++++++++++++++

Any advise/help appreciated.

Thanks,

Nome


More information about the Users mailing list