[Users] display popup content in a panel
François Boussuges
f.boussuges at gmail.com
Tue May 25 16:00:43 CEST 2010
Unbellievable!! it's work perfectly, thank you very much for this tip, I
have think use a lot of difficult technic but with this two lines of
script all it's ok!!
thank's!
Ryan Williams a écrit :
> I've tried this out before, and know this one method works:
>
> Add an Ext.Panel (for this example, lets call it "results", so "var
> results = new Ext.Panel({ ..... }); " )
> then, where your code currently adds your popup,
> something like :
>
> " new GeoExt.Popup({
> ...
> html: event.text
> ...
> }); "
>
> replace that all with
> "
> var eText = event.text
> results.body.update(eText);
> "
>
> Ryan
>
> On 5/25/2010 7:23 AM, François Boussuges wrote:
>
>> Hello, I have GeoExt popup to display attributes of WFS clusters layer.
>> But I have a lots (more than 10) attributes to display, the popup is not
>> very efficient. I want to display this attributs in a panel (Ext.Panel
>> or other) in the south of my map but I dont know what I should do.
>> this is my script:
>>
>> var medicago = new OpenLayers.Layer.Vector(
>> "Medicago",{
>> extractAttributes: true,
>> strategies : [ new OpenLayers.Strategy.BBOX(),
>> new OpenLayers.Strategy.Fixed()
>> ,new OpenLayers.Strategy.Cluster({distance: 0.01})],
>> protocol: new OpenLayers.Protocol.HTTP(
>> {url : "http://localhost:8090/geoserver/wfs?",
>> params: {format:"WFS",
>> service: "WFS",
>> version: "1.0.0",
>> request: "GetFeature",
>> typename: "MEDICAGO_VIEW",
>> SRS: "EPSG:4326"},
>> format : new OpenLayers.Format.GML()
>> }),
>> geometryName : "GEOMETRY",
>> styleMap: accession_style1
>>
>> });
>>
>> var selectControl1 = new OpenLayers.Control.SelectFeature(
>> medicago);
>> map.addControl(selectControl1);
>> selectControl1.activate();
>>
>> medicago.events.on({
>> featureselected: function(e) {
>> if(typeof(popup) != "undefined"){
>> popup.destroy();
>> }
>> var content ="<html><body><table cellspacing=10
>> cellpading=10><tr><td>NOM ACCESSION</td><td>NUMERO ACCESSION</td><td>NOM
>> SITE</td><td>TYPE DE SITE</td><tr>" ;
>> for (var i=0; i< e.feature.cluster.length; ++i)
>>
>> content+="<tr><td>"+e.feature.cluster[i].attributes.NOM_ACCESSION+"</td><td>"+e.feature.cluster[i].attributes.NUMERO_ACCESSION+"</td><td>"+e.feature.cluster[i].attributes.NOM_DU_SITE+"</td><td>"+e.feature.cluster[i].attributes.TYPE_SITE+"</td></tr>";
>> content+="</table></body></html>"
>>
>> popup = new GeoExt.Popup({
>> feature : e.feature,
>> html: content,
>> collapsible: true
>> ,width : 600
>> ,height : 250
>> ,anchored : true
>>
>> });
>> popup.show();
>> }
>> });
>>
>> I try to display the html attributes in a Ext.Panel but with no result....
>> One ideas?
>> _______________________________________________
>> Users mailing list
>> Users at geoext.org
>> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>
>
More information about the Users
mailing list