Geo view using Mapbox

Mapbox is a service that provides beautiful customizable maps. To be able to use Mapbox with Centreon Map, you’ll have to :

  • Create an account on Mapbox
  • Retrieve a private key on your Mapbox account and add it to Centreon Map server’s configuration

Your account comes with a free limited usage of the service : 50k tiles/month and you may upgrade your account if you need more (pricing). A tile is an image used to compose the geographic view

So first create your account on Mapbox.

Once the account created, go to your Mapbox account page. , then click on “Access token” and finally on “Create a new token”.

../../_images/mapbox-create-token.png

A popup window appears, asking you to select some properties. Select the following ones:

  • Public scopes : styles:read and styles:tiles
  • Secret scopes: styles:list
../../_images/mapbox-token-scope.png

Once created, your token appears. Copy it.

Warning

Once you leave the webpage, you will not be able to see your token again. So copy it somewhere because you will need it to configure your Centreon Map server.

On the Centreon Map 4 machine

Insert the token and your Mapbox account name (username) in the file /etc/centreon-studio/studio-config.properties.

##### GEO
mapbox.token=sk.xxxxxxxx

Then restart Tomcat.

# service tomcat6 start

Creating a Mapbox view

Now that everything is configured, let’s create a geographic view.

  1. Open your desktop client
  2. Open a view
  3. Right click on the background of the view and select “Edit”
  4. Check the checkbox : Geographic
../../_images/mapbox-change-style.png

Your view will now have a geographic background on which you can zoom and move around.

You noticed that, by default, you see the whole world and, everytime you open the view, the zoom is set to its default value : 1 Don’t worry ! You can change this settings.

Navigate on your view, zoom and go to the exact point where you want your view to open every time. Once you are there, use the « Set current lat / long / zoom as defaut » button, on the top of your desktop client

../../_images/set_current_lat_long.png

Now, whenever you open this view, might it be through the desktop or the web client, you will always be located there.