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. parseFeature
Convert a feature object from GeoJSON into an OpenLayers.Feature.Vector. Parameters
Returns{OpenLayers.Feature.Vector} A feature. parseGeometry
Convert a geometry object from GeoJSON into an OpenLayers.Geometry. Parameters
Returns{OpenLayers.Geometry} A geometry. parseCoords. pointConvert a coordinate array from GeoJSON into an OpenLayers.Geometry. Parameters
Returns{OpenLayers.Geometry} A geometry. parseCoords. multipointConvert a coordinate array from GeoJSON into an OpenLayers.Geometry. Parametersarray {Object} The coordinates array from the GeoJSON fragment. Returns{OpenLayers.Geometry} A geometry. parseCoords. linestringConvert a coordinate array from GeoJSON into an OpenLayers.Geometry. Parameters
Returns{OpenLayers.Geometry} A geometry. parseCoords. multilinestringConvert a coordinate array from GeoJSON into an OpenLayers.Geometry. Parameters
Returns{OpenLayers.Geometry} A geometry. parseCoords. polygonConvert a coordinate array from GeoJSON into an OpenLayers.Geometry. Returns{OpenLayers.Geometry} A geometry. parseCoords. multipolygonConvert a coordinate array from GeoJSON into an OpenLayers.Geometry. Parameters
Returns{OpenLayers.Geometry} A geometry. parseCoords.boxConvert a coordinate array from GeoJSON into an OpenLayers.Geometry. Parameters
Returns{OpenLayers.Geometry} A 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. createCRSObject
Create the CRS object for an object. Parameters
Returns{Object} An object which can be assigned to the crs property of a GeoJSON object. extract. featureReturn a partial GeoJSON object representing a single feature. Parameters
Returns{Object} An object representing the point. extract. geometryReturn a GeoJSON object representing a single geometry. Parameters
Returns{Object} An object representing the geometry. extract.poinReturn an array of coordinates from a point. Parameters
Returns{Array} An array of coordinates representing the point. extract. multipointReturn an array of point coordinates from a multipoint. Parameters
Returns{Array} An array of point coordinate arrays representing the multipoint. extract. linestringReturn an array of coordinate arrays from a linestring. Parameters
Returns{Array} An array of coordinate arrays representing the linestring. extract. multilinestringReturn an array of linestring arrays from a linestring. Parameters
Returns{Array} An array of linestring arrays representing the multilinestring. extract. polygonReturn an array of linear ring arrays from a polygon. Parameters
Returns{Array} An array of linear ring arrays representing the polygon. extract. multipolygonReturn an array of polygon arrays from a multipolygon. Parameters
Returns{Array} An array of polygon arrays representing the multipolygon |
Deserialize a GeoJSON string.
read: function( json, type, filter )
Check if a GeoJSON object is a valid representative of the given type.
isValidType: function( obj, type )
Convert a feature object from GeoJSON into an OpenLayers.Feature.Vector.
parseFeature: function( obj )
Convert a geometry object from GeoJSON into an OpenLayers.Geometry.
parseGeometry: function( obj )
Serialize a feature, geometry, array of features, or array of geometries into a GeoJSON string.
write: function( obj, pretty )
Create the CRS object for an object.
createCRSObject: function( object )