read: function( | json, | | type, | | filter | ) |
|
Deserialize a GeoJSON string.
Parameters
json | {String} A GeoJSON string |
type | {String} Optional string that determines the structure of the output. Supported values are “Geometry”, “Feature”, and “FeatureCollection”. If absent or null, a default of “FeatureCollection” is assumed. |
filter | {Function} A function which will be called for every key and value at every level of the final result. Each value will be replaced by the result of the filter function. This can be used to reform generic objects into instances of classes, or to transform date strings into Date objects. |
Returns
{Object} The return depends on the value of the type argument. If type is “FeatureCollection” (the default), the return will be an array of OpenLayers.Feature.Vector. If type is “Geometry”, the input json must represent a single geometry, and the return will be an OpenLayers.Geometry. If type is “Feature”, the input json must represent a single feature, and the return will be an OpenLayers.Feature.Vector.