[OpenLayers-Users] WMSGetFeatureInfo (popup) not working
Arnd Wippermann
arnd.wippermann at web.de
Tue Nov 5 10:04:22 PST 2013
If you request for the same url as your wms, then it should work.
//Getinfo
info = new OpenLayers.Control.WMSGetFeatureInfo({
url: 'http://118.139.181.241:8040/geoserver/wms/building_footprint', title:
'Identify features by clicking',
queryVisible: true,
...
Regards,
Arnd
-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von Nomeneta
Saili
Gesendet: Dienstag, 5. November 2013 15:20
An: openlayers-users at lists.osgeo.org
Betreff: [OpenLayers-Users] WMSGetFeatureInfo (popup) not working
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/b
uilding_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
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users
More information about the Users
mailing list