Class: FileBinder

vef.map.importer.binder.FileBinder()

load file based layers (gejson, csv)

Constructor

new FileBinder()

Source:

Methods

(static) getFileContents(file) → {Promise}

Parameters:
Name Type Description
file File | String file or URL
Source:
Returns:
Type
Promise

(static) guessFileType(filename) → {string}

Guess file type based on the filename
Parameters:
Name Type Description
filename string
Source:
Returns:
type
Type
string

(static) loadDshipLayer(json, title) → {object}

Creates a GeoJsonLayer from a DShip JSOn export
Parameters:
Name Type Description
json object | string geojson object
title string layer title (optional)
Source:
Returns:
{structure, layers}
Type
object

(static) loadFileLayer(file, options, mode) → {MeasurementsLayer|Array.<MeasurementsLayer>}

Creates a Layer from csv or geojson. Automatically tries to set the type based on the filename
Parameters:
Name Type Description
file File | string File object or a path to a file
options object
mode string geojson or csv
Source:
Returns:
layers
Type
MeasurementsLayer | Array.<MeasurementsLayer>

(static) loadGeoJsonLayer(json, title) → {object}

Creates a Layer from a GeoJson source that is already parsed into a JavaScript object.
Parameters:
Name Type Description
json object | string geojson object
title string layer title (optional)
Source:
Returns:
{structure, layers}
Type
object

(static) loadQGisProject(text) → {Promise}

Creates layers from a QGis project
Parameters:
Name Type Description
text string xml text
Source:
Returns:
{structure, layers}
Type
Promise