FROST-Server Documentation

Live documentation for the development version.

Creating a basic map

To set up a HTML page with a map in it, we first have to start with an empty HTML page:

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">

    <script src=""></script>

    <link rel="stylesheet" href=""
        crossorigin="" rel="stylesheet" />
    <script src=""

    <script src=""></script>
    <link href="" rel="stylesheet" />

    <script src=""></script>

        html, body {height:100%;}
        #mymap {
            height: 85%;
            width: 100%;
            background-color: #CCC;

    <title>Demo Map</title>

<h1>Demo Map</h1>

<div id="mymap"></div>

<script type="text/javascript">



This page has all the elements needed to show a map, but it does not actually initialise the map yet. Instead it only shows a gray placeholder where the map will be.

To activate the map, we have to add a bit of JavaScript in the <script> tag near the end of the file:

    var mymap ='mymap').setView([49.0, 8.4], 5);
    mymap.addControl(new L.Control.Fullscreen());
    L.tileLayer('https://{s}{z}/{x}/{y}.png', {
        attribution: 'Map data &copy; <a href="">OpenStreetMap</a> contributors',
        maxZoom: 18

This creates the map, and adds a OpenStreetMap background layer to it.

Next, we add a STAM layer that shows data from the AirQuality use case:

        baseUrl: "",
        cluster: true,
        clusterMin: 10,
        queryObject: {
            entityType: 'Things'

Clicking on a sensor, and opening a Datastream takes a long time, because STAM is loading almost three years of hourly data. Lets change that so it only loads the last month by using the plot section of the STAM configuration and adding a startDate. Don’t forget to add the , after the previous object in the JSON!

        plot: {
            startDate: new Date( - 1000*60*60*24*30),
            endDate: new Date()

Your map should now look like 1_BasicMapFinal.html and clicking a Datastream in a Station should give the last month of data.