OpenLayers JavaScript Mapping Library |
OpenLayers. Format. GeoJSONRead and write GeoJSON. Create a new parser with the OpenLayers.Format.GeoJSON constructor. Inherits fromSummary
read
Deserialize a GeoJSON string. Parameters
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. If type is “GeometryCollection”, the input json must represent a geometry collection, and the return will be an array of OpenLayers.Geometry. write
Serialize a feature, geometry, array of features, or array of geometries into a GeoJSON string. Parameters
Returns{String} The GeoJSON string representation of the input geometry, features, array of geometries, or array of features. |
Deserialize a GeoJSON string.
read: function( json, type, filter )
Serialize a feature, geometry, array of features, or array of geometries into a GeoJSON string.
write: function( obj, pretty )