maplicate-core
v0.1.0
Published
library for collaborative map editing on IFPS
Downloads
9
Readme
maplicate-core
maplicate-core is a thin layer for OrbitDB, a distributed peer-to-peer database, with convenient APIs for working with geographic data and mapping library (like Leaflet). It is designed for building decentralized and offline-first map applications.
Each maplicate node is an OrbitDB DocStore, which provides:
- full CRUD functions for map features (in GeoJSON format)
- feature level events for feature edits
Example
const IPFS = require('ipfs');
const OrbitDB = require('orbit-db');
import { MaplicateNode } from 'maplicate-core';
const ipfs = new IPFS();
ipfs.on('ready', () => {
// initialize an OrbitDB instance
const orbitdb = new OrbitDB(ipfs);
// create a maplicate node instance with an address
const maplicateNode = new MaplicateNode(orbitdb, 'map_address');
maplicateNode.on('feature:added', (feature) => {
// update your map view when a map feature is added by other peers
});
});
For more details, see the API documentation and event guide.
To see an actual application, please take a look at Maplicate Editor.
License
MIT @ 2018