<div>Hello,</div><div><br></div><div>I succeded to get it working in firebug, I was using Firefox Beta 4 and Firebug is having some issues with it.</div><div><br></div><div>Check this: <a href="http://img163.imageshack.us/img163/5491/screenshot20100928at100.png">http://img163.imageshack.us/img163/5491/screenshot20100928at100.png</a></div>
<div><br></div><div>The code related to that screenshot is there: <a href="http://gist.github.com/600596">http://gist.github.com/600596</a> or here:</div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace; white-space: pre-wrap; "><br>
</span></div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace; white-space: pre-wrap; ">        MarkersStore = new GeoExt.data.FeatureStore({</span></div><div><span class="Apple-style-span" style="font-family: Times; font-size: medium; "><pre style="word-wrap: break-word; white-space: pre-wrap; ">
<font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-size: small;">                layer: MarkersLayer,
                proxy: new GeoExt.data.ProtocolProxy({
                        protocol: new OpenLayers.Protocol.HTTP({
                                url: marker_api_url,
                                params:{'method':'\"markers.get\"'},
                                format: new OpenLayers.Format.GeoJSON({
                                        read: function() {
                                                console.log("var This: " + this);
                                                console.log("var arguments: " + arguments);
                         var obj = OpenLayers.Format.JSON.prototype.read.apply(this, arguments);
                                                 console.log("var obj: " + obj);
                                                return OpenLayers.Format.GeoJSON.prototype.read.apply(this, obj["#data"]);
                         },
                                        'internalProjection': proj900913,
                                        'externalProjection': proj4326
                                }),
                                readWithPOST: true
                        })
                }),
                autoLoad: true,
        });</span></font></pre></span></div>
<div>The var obj is always NULL... can you help me please ?</div><div><br></div><div>Thanks...</div><div><br></div><div><br></div><div>-Pol D.-</div><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 Fri, Sep 17, 2010 at 10:15, Pol <span dir="ltr"><<a href="mailto:d.paolino@gmail.com">d.paolino@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>It seems that screenshots are not allowed, so I made a link to imageshack here:</div><div><br></div><div>First: <a href="http://img713.imageshack.us/i/screenshot20100917at935.png/" target="_blank">http://img713.imageshack.us/i/screenshot20100917at935.png/</a></div>
<div>Second: <a href="http://img96.imageshack.us/i/screenshot20100917at936.png/" target="_blank">http://img96.imageshack.us/i/screenshot20100917at936.png/</a></div><div class="im"><div> </div><div><br></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><div><div></div><div class="h5"><div class="gmail_quote">On Fri, Sep 17, 2010 at 09:40, Pol <span dir="ltr"><<a href="mailto:d.paolino@gmail.com" target="_blank">d.paolino@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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><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><div><div></div><div><div class="gmail_quote">On Wed, Sep 15, 2010 at 08:57, Eric Lemoine <span dir="ltr"><<a href="mailto:eric.lemoine@camptocamp.com" target="_blank">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>On Wed, Sep 15, 2010 at 8:21 AM, Pol <<a href="mailto:d.paolino@gmail.com" target="_blank">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> 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><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>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" target="_blank">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></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br>