[Users] insert a map in a tree node
ivan marchesini
ivan.marchesini at gmail.com
Tue Aug 18 10:57:46 CEST 2009
Hi Eric and others,
> <http://geoext.org/lib/GeoExt/widgets/form/FormPanel.html>
>
> Register an actioncomplete listener on the form panel. The listener
> receives in its second argument a reference to the search action,
> which itself includes a reference to the OpenLayers.Protocol.Reponse
> instance associated with the request. Example:
>
> listeners: {
> actioncomplete: function(form, action) {
> var features = action.response.features;
> layer.addFeatures(features);
> }
> }
>
> Hope this helps,
As you suggested I have tested this code:
________________________________
var styleMap = new OpenLayers.StyleMap(OpenLayers.Util.applyDefaults(
{fillColor: "green", fillOpacity: 1, strokeColor: "black"},
OpenLayers.Feature.Vector.style["default"]));
var formPanel = new GeoExt.form.FormPanel({
//renderTo: "formpanel",
region: 'south',
width: 600,
height: 75,
protocol: new OpenLayers.Protocol.WFS({
url: "http://geoserver.irpi.cnr.it/geoserver/wfs",
featureType: "peric_tem",
featureNS: "http://geoserver.irpi.cnr.it/geoserver/irpi" }),
items: [{
xtype: "textfield",
name: "NOME_AREA__like",
value: "Marsica"
}, {
xtype: "numberfield",
name: "lambda__ge",
value: "0.01"
}],
layout: 'anchor',
listeners: {
actioncomplete: function(form, action) {
var layer = new OpenLayers.Layer.Vector("query_result",
{isBaseLayer:false, visibility:false}, {styleMap: styleMap},
{projection: new OpenLayers.Projection("EPSG:900913")});
var features = action.response.features;
layer.addFeatures(features);
mappa.addLayer(layer);
}
}
});
formPanel.addButton({
text: "search",
handler: function() {
this.search();
},
scope: formPanel
});
________________________________
what happen is:
- features seems to be correcly obtained by means of FWS call
- the vector map (query_result) is correctly loaded into the mapPanel
and in the layer tree
- but I can'see the vector layer with added features on the map
this is the page:
http://alderaan.irpi.cnr.it/test_geoext/test_geoext9e.html
many thanks...
It will take some time before I can be able to solve all this problems
by miself... :-(
--
Ti prego di cercare di non inviarmi files .dwg, .doc, .xls, .ppt.
Preferisco formati liberi.
Please try to avoid to send me .dwg, .doc, .xls, .ppt files.
I prefer free formats.
http://it.wikipedia.org/wiki/Formato_aperto
http://en.wikipedia.org/wiki/Open_format
Ivan Marchesini
Perugia (Italy)
Socio fondatore GFOSS "Geospatial Free and Open Source Software" http://www.gfoss.it
e-mail: marchesini at unipg.it
ivan.marchesini at gmail.com
fax (home): +39(0)5782830887
jabber: geoivan73 at jabber.org
skype: geoivan73
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Questa =?ISO-8859-1?Q?=E8?= una parte del messaggio
firmata digitalmente
Url : http://www.geoext.org/pipermail/users/attachments/20090818/5475e46a/attachment.pgp
More information about the Users
mailing list