new geojsonReader(arg) → {geo.geojsonReader}
- Description:
Create a new instance of class geo.geojsonReader.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
arg |
geo.fileReader.spec |
Returns:
- Type
- geo.geojsonReader
Extends
Members
idle
- Description:
Getter for the idle state. Read only.
- Source:
- Inherited From:
Properties:
Name | Type | Description |
---|---|---|
idle |
boolean |
|
Getter for the idle state. Read only.
Methods
addPromise(promise) → {this}
- Description:
Add a new promise object preventing idle event handlers from being called until it is resolved.
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
promise |
Promise | A promise object. |
Returns:
- Type
- this
canRead(file) → {boolean}
- Description:
Tells the caller if it can handle the given file by returning a boolean.
- Source:
- Overrides:
Parameters:
Name | Type | Description |
---|---|---|
file |
File | Blob | string | object | This is either a |
Returns:
true
if this reader can read a file.
- Type
- boolean
geoIsOn(event, handleropt) → {boolean}
- Description:
Report if an event handler is bound to this object.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
event |
string | Array.<string> | An event or list of events to check. |
|
handler |
function |
<optional> |
A function that might be bound. If
|
Returns:
true if any of the specified events are bound to the specified handler.
- Type
- boolean
geoOff(eventopt, argopt, nullable) → {this}
- Description:
Remove handlers from one event or an array of events. If no event is provided all handlers will be removed.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
event |
string | Array.<string> |
<optional> |
An event or a list of events from
|
arg |
function | Array.<function()> |
<optional> <nullable> |
A function or array of functions to remove from the events or a falsy value to remove all handlers from the events. |
Returns:
- Type
- this
geoOn(event, handler) → {this}
- Description:
Bind an event handler to this object.
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
event |
string | An event from |
handler |
function | A function that is called when |
Returns:
- Type
- this
geoOnce(event, handler) → {function}
- Description:
Bind an event handler to this object that will fire once and then deregister itself.
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
event |
string | An event from |
handler |
function | A function that is called when |
Returns:
The actual bound handler. This is a wrapper around the handler that was passed to the function.
- Type
- function
geoTrigger(event, argsopt) → {this}
- Description:
Trigger an event (or events) on this object and call all handlers.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
event |
string | Array.<string> | An event or list of events from
|
|
args |
object |
<optional> |
Additional information to add to the
|
Returns:
- Type
- this
layer() → {geo.featureLayer}
- Description:
Get the feature layer attached to the reader.
- Source:
- Inherited From:
Returns:
The layer associated with the reader.
- Type
- geo.featureLayer
modified() → {this}
- Description:
Update the timestamp to the next global timestamp value.
- Source:
- Inherited From:
Returns:
- Type
- this
onIdle(handler) → {this}
- Description:
Bind a handler that will be called one time when all internal promises are resolved. If there are no outstanding promises, this is invoked synchronously.
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
handler |
function | A function taking no arguments. |
Returns:
- Type
- this
read(file, doneopt, progressopt) → {Promise}
- Description:
Reads the file and optionally calls a function when finished. The
done
function is called with a list ofgeo.feature
on success orfalse
on failure.
- Source:
- Overrides:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
file |
File | Blob | string | object | This is either a |
|
done |
function |
<optional> |
An optional callback function when the read is
complete. This is called with |
progress |
function |
<optional> |
A function which is passed |
Returns:
A Promise
that resolves with a list of
geo.feature
or is rejected if the reader fails.
- Type
- Promise
removePromise(promise) → {this}
- Description:
Mark a promise as no longer required to resolve before the idle state is reached.
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
promise |
Promise | A promise object. |
Returns:
- Type
- this
timestamp() → {number}
- Description:
Get time.
- Source:
- Inherited From:
Returns:
The timestamp. This is 0 if the timestamp has never been modified.
- Type
- number
Type Definitions
spec
- Description:
Object specification for a geojsonReader.
- Source:
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
pointStyle |
geo.pointFeature.styleSpec |
<optional> |
Default style for points. |
lineStyle |
geo.pointFeature.styleSpec |
<optional> |
Default style for lines. |
polygonStyle |
geo.pointFeature.styleSpec |
<optional> |
Default style for polygons. |
layer |
geo.featureLayer |
<optional> |
The target feature layer. |
Object specification for a geojsonReader.