An open API service indexing awesome lists of open source software.

https://github.com/codingmiao/giscat-js

js util for giscat
https://github.com/codingmiao/giscat-js

Last synced: 7 days ago
JSON representation

js util for giscat

Awesome Lists containing this project

README

          

# insert

```shell
npm i giscatjs
```

or

```html

```

# ProtoFeature bytes to geojson object

```js
function sendGet() {
const req = new XMLHttpRequest();
req.open("GET", "./data/testbytes.pbf", true);
req.responseType = "arraybuffer";

req.onload = () => {
const arrayBuffer = req.response;
if (arrayBuffer) {
const bytes = new Uint8Array(arrayBuffer);// ProtoFeature bytes
const fc = giscat.pojo.ProtoFeatureConverter.proto2featureCollection(bytes);
console.log(fc) // obj
console.log(JSON.stringify(fc)) // string
}
};
req.send();
}

sendGet()
```