<meta charset="utf-8"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Yes I tried also to do that, but the thing that worry me the most is that console.log() do not display anything...<div>
<br></div><div>I've modified my code like this:</div><div><br></div><div><div class="im" style="color: rgb(80, 0, 80); "><div><span style="white-space: pre-wrap; "><font face="'courier new', monospace"><font class="Apple-style-span" color="#000000">        </font></font></span><font face="'courier new', monospace"><font class="Apple-style-span" color="#000000">MarkersStore = new GeoExt.data.FeatureStore({</font></font></div>
<div><span style="white-space: pre-wrap; "><font face="'courier new', monospace"><font class="Apple-style-span" color="#000000">                </font></font></span><font face="'courier new', monospace"><font class="Apple-style-span" color="#000000">layer: MarkersLayer,</font></font></div>
<div><span style="white-space: pre-wrap; "><font face="'courier new', monospace"><font class="Apple-style-span" color="#000000">                </font></font></span><font face="'courier new', monospace"><font class="Apple-style-span" color="#000000">proxy: new GeoExt.data.ProtocolProxy({</font></font></div>
<div><span style="white-space: pre-wrap; "><font face="'courier new', monospace"><font class="Apple-style-span" color="#000000">                        </font></font></span><font face="'courier new', monospace"><font class="Apple-style-span" color="#000000">protocol: new OpenLayers.Protocol.HTTP({</font></font></div>
<div><span style="white-space: pre-wrap; "><font face="'courier new', monospace"><font class="Apple-style-span" color="#000000">                                </font></font></span><font face="'courier new', monospace"><font class="Apple-style-span" color="#000000">url: marker_api_url,</font></font></div>
<div><span style="white-space: pre-wrap; "><font face="'courier new', monospace"><font class="Apple-style-span" color="#000000">                                </font></font></span><font face="'courier new', monospace"><font class="Apple-style-span" color="#000000">format: new OpenLayers.Format.GeoJSON({</font></font></div>
<div><span style="white-space: pre-wrap; "><font face="'courier new', monospace"><font class="Apple-style-span" color="#000000">                                        </font></font></span><font face="'courier new', monospace"><font class="Apple-style-span" color="#000000">read: function() {</font></font></div>
</div><div><span style="white-space: pre-wrap; "><font face="'courier new', monospace">                                                </font></span><font face="'courier new', monospace">console.log("testing...");</font></div><div class="im">
<div><span style="white-space: pre-wrap; "><font face="'courier new', monospace">                        </font></span><font face="'courier new', monospace"> var obj = OpenLayers.Format.JSON.read.apply(this, arguments);</font></div>
</div><div><span style="white-space: pre-wrap; "><font face="'courier new', monospace">                        </font></span><font face="'courier new', monospace"> </font><span style="white-space: pre-wrap; "><font face="'courier new', monospace">                        </font></span><font face="'courier new', monospace">return OpenLayers.Format.GeoJSON.read.apply(this, obj['#data']);</font></div>
<div class="im"><div><span style="white-space: pre-wrap; "><font face="'courier new', monospace">                         </font></span><font face="'courier new', monospace"> },</font></div><div><span style="white-space: pre-wrap; "><font face="'courier new', monospace">                                         </font></span><font face="'courier new', monospace">'internalProjection': proj900913,</font></div>
<div><span style="white-space: pre-wrap; "><font face="'courier new', monospace">                                        </font></span><font face="'courier new', monospace">'externalProjection': proj4326</font></div><div><span style="white-space: pre-wrap; "><font face="'courier new', monospace">                                </font></span><font face="'courier new', monospace">}),</font></div>
<div><span style="white-space: pre-wrap; "><font face="'courier new', monospace">                                </font></span><font face="'courier new', monospace">readWithPOST: true</font></div><div><span style="white-space: pre-wrap; "><font face="'courier new', monospace">                        </font></span><font face="'courier new', monospace">})</font></div>
<div><span style="white-space: pre-wrap; "><font face="'courier new', monospace">                </font></span><font face="'courier new', monospace">}),</font></div></div><div><span style="white-space: pre-wrap; "><font face="'courier new', monospace">                </font></span><font face="'courier new', monospace">autoLoad: true,</font></div>
<div><span style="white-space: pre-wrap; "><font face="'courier new', monospace">        </font></span><font face="'courier new', monospace">});</font></div></div><div><br></div><div>Any idea?</div></span>-Pol D.-<br>
<a href="http://www.google.com/profiles/110003197662276240659" target="_blank">http://www.google.com/profiles/110003197662276240659</a><br>
<br><br><div class="gmail_quote">On Wed, Sep 15, 2010 at 07:51, Eric Lemoine <span dir="ltr"><<a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tuesday, September 14, 2010, Pol <<a href="mailto:d.paolino@gmail.com">d.paolino@gmail.com</a>> wrote:<br>
> I also tried this:<br>
> MarkersStore = new GeoExt.data.FeatureStore({<br>
> layer: MarkersLayer,<br>
> proxy: new GeoExt.data.ProtocolProxy({<br>
> protocol: new OpenLayers.Protocol.HTTP({<br>
> url: marker_api_url,<br>
> format: new OpenLayers.Format.GeoJSON({<br>
> read: function() {<br>
> var obj = OpenLayers.Format.JSON.read.apply(this, arguments);<br>
> console.log(obj);<br>
> return OpenLayers.Format.GeoJSON.read.apply(this, [obj]);<br>
> },<br>
> 'internalProjection': proj900913,<br>
> 'externalProjection': proj4326<br>
> }),<br>
> readWithPOST: true<br>
> })<br>
> }),<br>
> autoLoad: false,<br>
> });<br>
><br>
> But it doesn't works. I never get anything in the log.<br>
> Can you show me an example ?<br>
<br>
</div>You should do<br>
<br>
return OpenLayers.Format.GeoJSON.read.apply(this, [obj["#data"]]);<br>
<br>
But you have another problem since console.log doesn't display<br>
anything. What if you add a console.log at the beginning of the read<br>
function?<br>
<font color="#888888"><br>
--<br>
</font><div><div></div><div class="h5">Eric Lemoine<br>
<br>
Camptocamp France SAS<br>
Savoie Technolac, BP 352<br>
73377 Le Bourget du Lac, Cedex<br>
<br>
Tel : 00 33 4 79 44 44 96<br>
Mail : <a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a><br>
<a href="http://www.camptocamp.com" target="_blank">http://www.camptocamp.com</a><br>
</div></div></blockquote></div><br>