Mapping library for jobs
- Build project
git clone https://github.com/chronark/atlas.git
npm install
npm run build
- Embed the scripts in your HTML.
<script type="text/javascript" src="vendors~main.atlas.js"></script>
<script type="text/javascript" src="atlas.js"></script>
- Add a div with an id. You can choose the id but remember it for later.
<div id="map-container"></div>
From your javascript code create a new map by using the id from earlier:
const map = new Map("map-container")
Map() accepts a config object as second parameter where you can specify an initial viewport either via latitute/longitude or an extent.
const mapConfig = {
view: {
lat: 0,
lon: 45,
zoom: 2,
},
}
const map = new Map("id", mapConfig)
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.