Hi List,<div><br></div><div>I've recently started playing with GWT-OpenLayers and it seems to be quite good. However, when I write this code:</div><div><div><br></div><div><font face="courier new, monospace">        VectorOptions vOptions = new VectorOptions();</font></div>
<div><font face="courier new, monospace">        Strategy strategies[] = {new BBoxStrategy()};</font></div><div><font face="courier new, monospace">        WFSProtocolOptions pOptions = new WFSProtocolOptions("wfs", "<a href="http://www.opengis.net/gml">http://www.opengis.net/gml</a>", "postgis:maori_land_wgs84");</font></div>
<div><font face="courier new, monospace">        pOptions.setVersion("1.1.0");</font></div><div><font face="courier new, monospace">        pOptions.setSrsName("EPSG:2193");</font></div><div><font face="courier new, monospace">        GeoJSON format = new GeoJSON();</font></div>
<div><font face="courier new, monospace">        pOptions.setFormat(format);</font></div><div><font face="courier new, monospace">        Protocol prot = new WFSProtocol(pOptions);</font></div><div><font face="courier new, monospace">        vOptions.setStrategies(strategies);</font></div>
<div><font face="courier new, monospace">        vOptions.setProtocol(prot);</font></div><div><font face="courier new, monospace">        vectorLayer = new Vector("features", vOptions);</font></div><div><font face="courier new, monospace">        </font></div>
<div><font face="courier new, monospace">        map.addLayer(vectorLayer);</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">I get an exception in OpenLayers-2.12 release on this line:</font></div>
<div><font face="courier new, monospace"><div>    read: function(options) {</div><div>        OpenLayers.Protocol.prototype.read.apply(this, arguments);</div><div>        options = OpenLayers.Util.extend({}, options);</div>
<div>        OpenLayers.Util.applyDefaults(options, this.options || {});</div><div>        var response = new OpenLayers.Protocol.Response({requestType: "read"});</div><div>        </div><div>        var data = OpenLayers.Format.XML.prototype.write.apply(</div>
<div>            this.format, [this.format.writeNode("wfs:GetFeature", options)] <font color="#990000">// THIS LINE</font></div><div>        );</div></font></div><div><br></div><div>this.format.writeNode is undefined. First I was blaming GWT and thinking it might not be as good as they say, but now, looking at the OpenLayers code a bit more, it looks to me as an OpenLayers bug or at least it means that the GeoJSON format is not supported.</div>
<div><br></div><div>It looks to me as though only XML formats are supported. Is that correct?</div><div><br></div><div>Please correct me if I'm wrong or if I should attempt to fix it properly within OpenLayers.</div><div>
<br></div><div>Kind regards,</div><div>Tim</div><div><br></div>Tim-Hinnerk Heuer<br><br>Twitter: @geekdenz<br><div>Blog: <a href="http://www.thheuer.com/" target="_blank">http://www.thheuer.com</a></div><br>
</div>