Install dependencies and build the library from the terminal
yarn install
yarn build
This will generate some files in the dist
folder.
To use the map import dist/main.js
script and initialize it with window.initMapApp(element)
<!-- The element we want to render the map to -->
<div id="root"></div>
<!-- Import the script -->
<script src="dist/main.js"></script>
<!-- Initialize it -->
<script>window.initMapApp(document.getElementById("root"))</script>
You can pass some options as the second argument of the initMapApp
method
Option | default | Description |
---|---|---|
width | 800 | The width of the map |
primaryColor | #213766 | The color used for the ui (buttons, texts, etc) |
colorRangeFrom | #EC770F | The color from which the range starts (used only in the map visualization) |
colorRangeTo | #3cd33e | The color from which the range ends (used only in the map visualization) |
An example of a use is:
window.initMapApp(el, {
width: 1200,
primaryColor: "#123123",
colorRangeFrom: "#00ff00",
primaryColor: "#ff0000",
});