Hello all,<div><br></div><div>I'm moving my whole project to the Drupal Framework and I'm using the services module who can send data in many format(xml, json, amfphp, etc etc).</div><div><br></div><div>Before using it, I was using simple php to send the data to my store, like this:</div>
<div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">        </font></span><font class="Apple-style-span" face="'courier new', monospace">MarkersStore = new GeoExt.data.FeatureStore({</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span><font class="Apple-style-span" face="'courier new', monospace">layer: MarkersLayer,</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span><font class="Apple-style-span" face="'courier new', monospace">proxy: new GeoExt.data.ProtocolProxy({</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                        </font></span><font class="Apple-style-span" face="'courier new', monospace">protocol: new OpenLayers.Protocol.HTTP({</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                                </font></span><font class="Apple-style-span" face="'courier new', monospace">url: get_markers.php,</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                                </font></span><font class="Apple-style-span" face="'courier new', monospace">format: new OpenLayers.Format.GeoJSON({</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                                        </font></span><font class="Apple-style-span" face="'courier new', monospace">'internalProjection': proj900913,</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                                        </font></span><font class="Apple-style-span" face="'courier new', monospace">'externalProjection': proj4326</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                                </font></span><font class="Apple-style-span" face="'courier new', monospace">}),</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                                </font></span><font class="Apple-style-span" face="'courier new', monospace">readWithPOST: true</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                        </font></span><font class="Apple-style-span" face="'courier new', monospace">})</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span><font class="Apple-style-span" face="'courier new', monospace">}),</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span><font class="Apple-style-span" face="'courier new', monospace">autoLoad: false,</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">        </font></span><font class="Apple-style-span" face="'courier new', monospace">});</font></div>
</div><div><br></div><div>Now I have to modify my code to get it working with the tools provided by this amazing framework.</div><div><br></div><div>My Json code look like this now:</div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace; white-space: pre; "><br>
</span></div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace; white-space: pre; ">{</span></div><div><pre><font class="Apple-style-span" face="'courier new', monospace"> "#error": false,
"#data": {
"type": "FeatureCollection",
"features": [
{
"geometry": {
"type": "Point",
"coordinates": [
4.35205865469,
50.8235093311
]
},
"properties": {
"img": "sites/default/modules/lukoil/lukoil.jpg",
"inf": "Lukoil ID 3",
"html": null
}
}]
}
}</font>
</pre><pre><br></pre></div><div>The FeatureCollection I use to parse is now embedded in another container.</div><div><br></div><div>That means that my old FeatureStore is no more working with those data and I don't know how to solve this.</div>
<div><br></div><div>Any idea ?</div><div><br></div><div>My store look like this now:</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">        </font></span><font class="Apple-style-span" face="'courier new', monospace">MarkersStore = new GeoExt.data.FeatureStore({</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span><font class="Apple-style-span" face="'courier new', monospace">layer: MarkersLayer,</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span><font class="Apple-style-span" face="'courier new', monospace">proxy: new GeoExt.data.ProtocolProxy({</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                        </font></span><font class="Apple-style-span" face="'courier new', monospace">protocol: new OpenLayers.Protocol.HTTP({</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                                </font></span><font class="Apple-style-span" face="'courier new', monospace">url: /services/json,</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                                </font></span><font class="Apple-style-span" face="'courier new', monospace">params: {'method':'\"markers.get\"'},</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                                </font></span><font class="Apple-style-span" face="'courier new', monospace">format: new OpenLayers.Format.GeoJSON({</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                                        </font></span><font class="Apple-style-span" face="'courier new', monospace">'internalProjection': proj900913,</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                                        </font></span><font class="Apple-style-span" face="'courier new', monospace">'externalProjection': proj4326</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                                </font></span><font class="Apple-style-span" face="'courier new', monospace">}),</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                                </font></span><font class="Apple-style-span" face="'courier new', monospace">readWithPOST: true</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                        </font></span><font class="Apple-style-span" face="'courier new', monospace">})</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span><font class="Apple-style-span" face="'courier new', monospace">}),</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">                </font></span><font class="Apple-style-span" face="'courier new', monospace">autoLoad: false,</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">        </font></span><font class="Apple-style-span" face="'courier new', monospace">});</font></div>
</div><div><br></div><div>Thanks for the help !</div><div><br></div><div><br></div><div>-Pol D.-<br>
</div>