Skip to content

Latest commit

 

History

History
69 lines (46 loc) · 1.07 KB

README.md

File metadata and controls

69 lines (46 loc) · 1.07 KB

Atlas

A simple map services engine developed for KATSANA™.

Installation

Coming soon!

Import

Once install, you should be able to easily import the library using the following:

const Atlas = require('./atlas.js');

window.Atlas = Atlas;

Configuration

Using Mapbox

L.mapbox.accessToken = 'xyz';

Atlas.config({
  mapbox: {
    accessToken: L.mapbox.accessToken,
    styles: {
      Street: 'mapbox.street'
    }
  }
})

Using Google

Coming soon!

Getting Driver

Atlas uses the concept of driver to make it easier for developer to swap between Google Map Developer API with Mapbox Developer API.

const google = (new Atlas()).driver('google');
const mapbox = (new Altas()).driver('mapbox');

Usages

Creating a Map

let canvas = mapbox.newCanvas('map', {});

Creating a Position

let position = mapbox.newPosition(3.161907, 101.617954)

Creating a Routing

let routing = mapbox.newRouting(canvas, {});
routing.start(position);