Coder Social home page Coder Social logo

sigfox-maps's Introduction

Sigfox-maps

This project is an example of how to use the Sigfox backend API to display your own maps.

There are 2 layers demonstrated in this project:

  • Public map
  • Monarch coverage map

Technologies

This application is a simple nodeJs server application which uses Express for routing and Pug for templating. The simple frontend uses Leaflet to display maps.

Prerequisites

To run/use this sample project, you will need git and nodejs (at least v8.10.0) installed.

If you really do not want to install git, just hit the download button, to retrieve a tarball of the whole repository.

Configuration

To configure properly the application, you need to rename the config.js.sample to config.js and edit this file to provide your own setup.

const config = {
    sigfoxApiUser: "yourSigfoxApiUser",
    sigfoxApiPassword: "yourSigfoxApiPassword",
    sigfoxApiSite: "api.sigfox.com",
    publicMapPath: "/v2/tiles/public-coverage",
    monarchMapPath: "/v2/tiles/monarch",
    https: true,
    
    //---- For MapBox background map
    backgroundMapType: "Basic",
    backgroundMap: "https://api.mapbox.com/v4/mapbox.light/{z}/{x}/{y}.png?access_token={yourToken}"
}

In production situation, you should only set your own credentials to access the Sigfox API and set your background map URL according to your map provider.

The example above showcases a Mapbox map with a light style (you'll have to set your own token). To sum up, the backgroundMap property expects a TMS URL. You can use other background map providers by switching properties (Jawg, Here, Google or Bing).

In test situation, you might want to mock the Sigfox Backend. In order to do this, you can edit the other properties :

  • sigfoxApiSite to specify the base URL of your mock (including the http(s) prefix)
  • publicMapPath to specify the endpoint. To provide a compatible endpoint, check the documentation of the Sigfox API v2
  • monarchMapPath to specify the endpoint. To provide a compatible endpoint, check the documentation of the Sigfox API v2
  • https to specify if your mock is deployed on https context (set it to true), or http (set it to false)

How to run

You just have to do a simple : npm install && npm start On Windows the && operator might not work, so, launch in sequence

npm install
npm start

Open the url http://localhost:3000/ on your browser.

sigfox-maps's People

Contributors

cblain avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sigfox-maps's Issues

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.