Hello all,<br><br>I'm trying to create a vector layer based on a php query (which includes the_geom) encoded in JSON. Until the moment i haven't been able to achieve this.<br>Following, is the relevant part of the code:<br>
<br>var connect = new Ext.data.Connection();<br>connect.request({<br> url: 'mfbase/geoquery.php',<br> params: {<br> species: species,<br> datai: datai,<br> dataf: dataf<br> },<br> success: function(response){<br>
var resp = response.responseText;<br> var json = new OpenLayers.Format.JSON();<br> var data = json.read(resp);<br> //console.log(data[0].the_geom);<br> <br> var querylayer1 = new OpenLayers.Layer.Vector(<br>
'Query1',<br> {<br> isBaseLayer: false,<br> projection: wgs,<br> geometryName: 'the_geom',<br> }<br> );<br> <br>
querylayer1.addFeatures(data);<br> map.addLayer(querylayer1);<br> }<br>})<br clear="all"><br>Any suggestions are more than welcomed :)<br>Thanks to you all!<br><br>Cheers,<br><br><br>-- <br>Hugo Martins<br>
FMV-UTL<br>CIISA-Epidemiologia e Saúde Pública Veterinária<br>Av. da Universidade Técnica<br>1300-477 Lisboa<br>N 38°42'49.54", W 9°11'43.42"<br>