Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

chronark/atlas

Repository files navigation

Atlas

Mapping library for jobs

Documentation

API documentation

Setup

Installing

  1. Build project
git clone https://github.com/chronark/atlas.git
npm install
npm run build
  1. Embed the scripts in your HTML.
<script type="text/javascript" src="vendors~main.atlas.js"></script>
<script type="text/javascript" src="atlas.js"></script>
  1. Add a div with an id. You can choose the id but remember it for later.
<div id="map-container"></div>

Setup

From your javascript code create a new map by using the id from earlier:

const map = new Map("map-container")

Initial State

Map() accepts a config object as second parameter where you can specify an initial viewport either via latitute/longitude or an extent.

By LatLon

const mapConfig = {
  view: {
    lat: 0,
    lon: 45,
    zoom: 2,
  },
}

const map = new Map("id", mapConfig)

By Extent

const mapConfig = {
  extent: [1, 2, 3, 4],
}

const map = new Map("id", mapConfig)

If you supply both a view and extent object, it will use only the view configuration.