new TXT()
- Source:
- mapspace/format/txtfile.js
Extends
Methods
-
createVectorSources(name, data)
-
Returns a Promise that creates an array of
source
.Parameters:
Name Type Description name
string Name for the source.
data
Object | string Input content.
- Inherited From:
- Source:
- mapspace/format/localfile.js
Returns:
A Promise that returns an array of
source
created using the input for the resolve function and an Error for the reject function.- Type
- Promise
-
getFeatures(content)
-
Returns an array of
ol.Feature
processing the input content. Depending on the current internal format reader, content can be different inputs. For example, for GeoJSON content can be a string with the json or the json object.Parameters:
Name Type Description content
Object | string Input content.
- Inherited From:
- Source:
- mapspace/format/localfile.js
Returns:
- Type
- Array.<ol.Feature>
-
getProjectionInfo(content)
-
Returns a
Mapspace.ProjectionInfo
from the content. Depending on the current internal format reader, content can be different inputs. For example, for GeoJSON content can be a string with the json or the json object. For other formats overwrite this function.Parameters:
Name Type Description content
Object | string Input content.
- Inherited From:
- Overrides:
- Source:
- mapspace/format/localfile.js
Returns:
Projection info with nullable code.
-
read(input)
-
Returns a Promise that creates an array of
source
.Parameters:
Name Type Description input
File | string | Object | Buffer | ArrayBuffer Input content. It can be a File, a string, an object, a Buffer or an ArrayBuffer.
- Inherited From:
- Source:
- mapspace/format/localfile.js
Returns:
A Promise that returns an array of
source
for the resolve function and an Error for the reject function.- Type
- Promise
-
readFile(file, asText)
-
Returns a Promise that reads a file and returns its content.
Parameters:
Name Type Description file
File File to read.
asText
boolean If read file as text or as an array buffer.
- Inherited From:
- Source:
- mapspace/format/localfile.js
Returns:
A Promise that returns a string with the content of the file for the resolve function and an Error for the reject function.
- Type
- Promise