Hello Eric, all,<div><br></div><div>I tried your advice and it doesn't work here.</div><div><br></div><div>I join you 2 screenshots where you can see what I'm doing.</div><div><br></div><div>I'm really lost into this, I've tried with different versions of firefox, always the same result...</div>
<div><br></div><div>Thanks for helping!</div><div><br></div><div>-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 08:57, 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 Wed, Sep 15, 2010 at 8:21 AM, Pol <<a href="mailto:d.paolino@gmail.com">d.paolino@gmail.com</a>> wrote:<br>
> Yes I tried also to do that, but the thing that worry me the most is that<br>
> console.log() do not display anything...<br>
<br>
</div>This is weird.<br>
<br>
Overriding read works for me. In the FireBug console:<br>
<br>
>>> var f = new OpenLayers.Format.GeoJSON({read: function(str) { console.log(str); }});<br>
>>> f.read("foo");<br>
foo<br>
<br>
Likewise the following patch to the feature-grid.html example works for me:<br>
<br>
diff --git examples/feature-grid.js examples/feature-grid.js<br>
index 04cf945..d9419e6 100644<br>
--- examples/feature-grid.js<br>
+++ examples/feature-grid.js<br>
@@ -48,7 +48,12 @@ Ext.onReady(function() {<br>
<div class="im"> proxy: new GeoExt.data.ProtocolProxy({<br>
protocol: new OpenLayers.Protocol.HTTP({<br>
</div> url: "data/summits.json",<br>
- format: new OpenLayers.Format.GeoJSON()<br>
+ format: new OpenLayers.Format.GeoJSON({<br>
+ read: function() {<br>
+ console.log("in read");<br>
+ return<br>
OpenLayers.Format.GeoJSON.prototype.read.apply(this, arguments);<br>
+ }<br>
+ })<br>
})<br>
}),<br>
autoLoad: true<br>
<div class="im"><br>
<br>
> I've modified my code like 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>
> console.log("testing...");<br>
> var obj = OpenLayers.Format.JSON.read.apply(this,<br>
> arguments);<br>
> return OpenLayers.Format.GeoJSON.read.apply(this, obj['#data']);<br>
> },<br>
> 'internalProjection': proj900913,<br>
> 'externalProjection': proj4326<br>
> }),<br>
> readWithPOST: true<br>
> })<br>
> }),<br>
> autoLoad: true,<br>
> });<br>
> Any idea?<br>
<br>
<br>
</div>Patching the feature-grid.html example has made me realize that<br>
there's something wrong in the above code. The read method is<br>
obviously set in the prototype, so OpenLayers.Format.JSON.read should<br>
be OpenLayers.Format.JSON.prototype.read, and likewise for<br>
Format.GeoJSON.<br>
<font color="#888888"><br>
<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></div>