Class: TopoJSON

ol/format/TopoJSON~TopoJSON


import TopoJSON from 'ol/format/TopoJSON';

Feature format for reading data in the TopoJSON format.

new TopoJSON(opt_options)

format/TopoJSON.js, line 47
Name Type Description
options

Options.

Name Type Default Description
dataProjection module:ol/proj~ProjectionLike 'EPSG:4326'

Default data projection.

layerName string

Set the name of the TopoJSON topology objects's children as feature property with the specified name. This means that when set to 'layer', a topology like

{
  "type": "Topology",
  "objects": {
    "example": {
      "type": "GeometryCollection",
      "geometries": []
    }
  }
}

will result in features that have a property 'layer' set to 'example'. When not set, no property will be added to features.

layers Array.<string>

Names of the TopoJSON topology's objects's children to read features from. If not provided, features will be read from all children.