new ol.format.GeoJSON(opt_options) experimental
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
options |
optional
Options.
|
||||||||||
Extends
Methods
-
readFeature(source){ol.Feature} experimental
-
Read a feature from a GeoJSON Feature source. This method will throw an error if used with a FeatureCollection source.
Name Type Description sourceArrayBuffer | Document | Node | Object | string Source.
Returns:
Feature.
-
readFeatures(source){Array.<ol.Feature>} experimental
-
Read all features from a GeoJSON source. Works with both Feature and FeatureCollection sources.
Name Type Description sourceArrayBuffer | Document | Node | Object | string Source.
Returns:
Features.
-
readGeometry(source){ol.geom.Geometry} experimental
-
Read a geometry from a GeoJSON source.
Name Type Description sourceArrayBuffer | Document | Node | Object | string Source.
Returns:
Geometry.
-
readProjection(object){ol.proj.Projection} experimental
-
Read the projection from the GeoJSON source file.
Name Type Description objectArrayBuffer | Document | Node | Object | string Source.
Returns:
Projection.
-
writeFeature(feature){ArrayBuffer|Node|Object|string} experimental
-
Encode a feature as a GeoJSON Feature object.
Name Type Description featureol.Feature Feature.
Returns:
Result.
-
writeFeatures(features){ArrayBuffer|Node|Object|string} experimental
-
Encode an array of features as GeoJSON.
Name Type Description featuresArray.<ol.Feature> Features.
Returns:
Result.
OpenLayers 3