[Users] geoext popup + geoserver content.ftl

Frederik Haefker fhaefker at uni-bonn.de
Tue Sep 3 17:28:13 CEST 2013


Hi,

its working by now. Just in case someone needs the idea:
if + feature request + indexOf solved the problem ...

controls.push(new OpenLayers.Control.WMSGetFeatureInfo({
autoActivate: true,
infoFormat: "application/vnd.ogc.gml",
maxFeatures: 3,
eventListeners:{
"getfeatureinfo": function(e){
var items = [];
Ext.each(e.features, function(feature){
items.push({
xtype: "propertygrid",
title: feature.fid,
source: feature.attributes});});
var varindexof=0;
var stationidpicture="";
Ext.each(e.features, function(feature){
var s=feature.fid;
var x=String(s);
varindexof=x.indexOf("points_database");
var 
stationid=String(feature.attributes.stationid).toUpperCase()
stationidpicture=String('<a 
href="http://xxx.xxx.xxx.xxx/Image/Data_Plot/'+stationid+'.jpg" 
target="_blank"><img 
src="http://xxx.xxx.xxx.xxx/Image/Data_Plot/'+stationid+'.jpg" 
width="250" height="250"></a>')});
if (varindexof == -1){
new GeoExt.Popup({
title: "Feature Info",
width: 200,height: 200,
layout: "accordion",
map: app.mapPanel,
location: e.xy,
items: items}).show();}
else{
new GeoExt.Popup({
title: "Feature Info",
width: 260,height: 305,
layout: "accordion",
map: app.mapPanel,
location: e.xy,
html: "click image for bigger version" + stationidpicture 
}).show();}}}}));

On Tue, 03 Sep 2013 13:50:15 +0200
  "Frederik Haefker" <fhaefker at uni-bonn.de> wrote:
> Hi everyone,
> 
> I am trying to include a jpg to a geoext popup.
> 
> There are various shapefiles, but only one needs to load 
>pictures. With only openlayers it was easy to do, I just 
>used the content.ftl from geoserver 2.4. However, we 
>switched to geoext and sadly I am not able to figure out 
>how to do it now.
> 
> Can somebody give me a hint how to force GeoExt.Popup to 
>use the different content.ftl of geoserver - or is there 
>another way?
> 
> Best Regards
>Frederik


More information about the Users mailing list