SS5NGX map providers

StormStation 5 NGX comes with several map providers pre-configured. It is easy to add additional map styles by editing the javascript file mapProviders.js and adding one or more lines of code.

 

To add a new provider, open mapProviders.js in Notepad++ (or your favorite text editor) and disable word wrap (menu View->Word wrap) to display one line per map provider.

 

In this example we will add MtbMap which features topographic data for large parts of Europe. Additional map providers can be found by browsing on the Leaflet Provider Demo page.

 

In mapProviders.js  type the below on a new line (replace N with the next sequence number. If adding a map provider to mapProviders.js where the last index is 12 you would put the value 13 in place of N, then if adding an additional provider you would index it as 14, and so on);

 

mapProvider[N] = new

 

Now select everything after the equal sign on the provider demo page info overlay box, as shown in the image below, and copy this to your clipboard by pressing shortcut key CTRL+C:

 

 

 

Paste the copied text after 'new' and if you want to keep it clean you can remove any line breaks. The final result in our example would look like this:

 

mapProvider[13] = new L.tileLayer('http://tile.mtbmap.cz/mtbmap_tiles/{z}/{x}/{y}.png', { attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> &amp; USGS' });

 

All that remains now is to assign the new provider a sequence number which should be the number after the last provider in the list. In this example it is 13. Set the MapProvider configuration parameter in settings.json to 13. Once this is done and both the modified files are uploaded to the /options subfolder, reload your browser and you should see the map you just added in all its glory.

 

Note that some of the included map providers and others listed on the Leaflet provider demo page require a registration key and may have a limitation on map tile loads. Usually for non-commercial use obtaining a registration key is free of charge. More information can be found here.