-
Notifications
You must be signed in to change notification settings - Fork 5
API
Tom edited this page Sep 21, 2021
·
7 revisions
Create a GBX instance
Name | Type | Description |
---|---|---|
options | Object | See options |
var GBX = new GBX({
data: myInput,
thumbnail: "base64",
onParse: function(metadata) {
console.log(metadata);
}
});
Name | Type | Default value | Description |
---|---|---|---|
data | File, Blob, Uint8Array | Required. Data to parse. | |
force | Boolean | false | If true , do not check whether data is using a supported type and parse anything. Important for Node.js usage. |
thumbnail | Boolean | false | If true , do not skip the thumbnail chunks and include them in the result. |
String | If base64 , convert the thumbnail output to base64 (not compatible with Node.js). |
||
onParse | Function | See onParse | |
onThumb | Function | See onThumb |
Executes after the parsing (without the thumbnail) has been completed.
Name | Type | Description |
---|---|---|
metadata | Array | An array composed with every information point of the headers parsed from the data. See the GBX Reference for a list. |
errorMsg | String | Returns empty, unless the parsing failed. Learn how to handle errors. |
headerChunks | Array | The compiled header chunks in an array. For debugging purposes. |
classID | Number | The class ID (identifies what GBX type the parser detected) used by the compiler. For debugging purposes. |
Executes after the thumbnail has been parsed. Only available if thumbnail
is not set to false
.
Name | Type | Description |
---|---|---|
thumbnail | Array | If thumbnail is true , it will return an Array with bytes composing the thumbnail of the map. |
String | If thumbnail is base64 , it will return a string useable as Data URL (not compatible with Node.js). |
|
thumbnailSize | Number | The size of the thumbnail in bytes. |
headerChunks | Array | The compiled header chunks in an array. For debugging purposes. |