[Users] empty popup text
Robert Buckley
robertdbuckley at yahoo.com
Mon Oct 11 17:01:12 CEST 2010
Hi,
could anyone give me a tip how I can define a popup from my map to show a the
text "no data" when the popup is empty?
My code for the popup is here
// create the popup
var featureInfo = new OpenLayers.Control.WMSGetFeatureInfo({
queryVisible: true,
highlightOnly: true,
maxFeatures: 2,
layers: [layer_wea_f,layer_wea
,layer_suchraum_v1,layer_suchraum_v2
,layer_suchraum_v3,layer_suchraum_v4
,layer_tabu_wgs84
,layer_avifaun_brut,layer_avifaun_gast
,layer_biogas,layer_wasserkraft
,layer_kraftwerke]
});
featureInfo.events.on({
getfeatureinfo: function(e) {
new GeoExt.Popup({
title: "INFO",
width: 300,
height : 200,
autoHeight: true,
layout: 'fit',
bodyStyle: 'background-color:white;,font-size:14px;',
autoScroll: true,
maximizable: true,
map: mapPanel.map,
lonlat: mapPanel.map.getLonLatFromPixel(e.xy),
html: e.text,
anchored: true,
shadow: true,
listeners: {
close: function() {
// closing a popup destroys it, but our reference is
truthy
popup = null;
}
}
}).show();
}
});
More information about the Users
mailing list