[Users] insert a map in a tree node

bartvde at osgis.nl bartvde at osgis.nl
Tue Aug 18 10:37:17 CEST 2009


Hi,

try visibility:true instead of false on your vector layer.

Best regards,
Bart

> 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
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>




More information about the Users mailing list