[OpenLayers-Users] response in two different geojson layers

Pedro Costa pedrocostaarma at sapo.pt
Thu Jul 26 03:33:59 PDT 2012


Hello list,


I have one php file that send to my openlayers map a geojson layer  (lines).
Now i am trying to add also a point layer. To do this I edit my php file
like this;

http://pastebin.com/wLThyrg5

The problem is that the two layers (points and lines) are in a unique
response so i get an error.
My question what i have to do for the two layers go in separate responses?

In my html code i have this two data stores that have to receive the layers:

   // lines
         var store = new GeoExt.data.FeatureStore({layer: route_layer,
fields: [{name: "id"}],
             proxy: new GeoExt.data.ProtocolProxy({
             protocol: new OpenLayers.Protocol.HTTP({
             url: "./php/pacessiveis.php",
             format: new OpenLayers.Format.GeoJSON({
             internalProjection: epsg_900913,
             externalProjection: epsg_900913   })})})});




              // points
         var store2 = new GeoExt.data.FeatureStore({layer: points_rota,
fields: [{name: "id"}],
             proxy: new GeoExt.data.ProtocolProxy({
             protocol: new OpenLayers.Protocol.HTTP({
             url: "./php/pacessiveis.php",
             format: new OpenLayers.Format.GeoJSON({
             internalProjection: epsg_900913,
             externalProjection: epsg_900913    })})})});



Can somebody help me with that?


Thanks




More information about the Users mailing list