Class: GeoJSON

GeoJSON

experimental new ol.format.GeoJSON(opt_options)

Provide access to features stored in the GeoJSON format.

Name Type Argument Description
options optional

Options.

Name Type Description
defaultProjection ol.proj.ProjectionLike

Default projection.

Extends

Methods

experimental readFeature(source){ol.Feature}

Read a feature from a GeoJSON Feature source. This method will throw an error if used with a FeatureCollection source.

Name Type Description
source ArrayBuffer | Document | Node | Object | string

Source.

experimental readFeatures(source){Array.<ol.Feature>}

Read all features from a GeoJSON source. Works with both Feature and FeatureCollection sources.

Name Type Description
source ArrayBuffer | Document | Node | Object | string

Source.

experimental readGeometry(source){ol.geom.Geometry}

Read a geometry from a GeoJSON source.

Name Type Description
source ArrayBuffer | Document | Node | Object | string

Source.

experimental readProjection(object){ol.proj.Projection}

Read the projection from the GeoJSON source file.

Name Type Description
object ArrayBuffer | Document | Node | Object | string

Source.

experimental writeFeature(feature){ArrayBuffer|Node|Object|string}

Encode a feature as a GeoJSON Feature object.

Name Type Description
feature ol.Feature

Feature.

experimental writeFeatures(features){ArrayBuffer|Node|Object|string}

Encode an array of features as GeoJSON.

Name Type Description
features Array.<ol.Feature>

Features.