1
0
Fork 0

Show error when mapbox token doesn't exist

Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
merge-requests/797/head
Alfredos-Panagiotis Damkalis 2019-11-29 20:25:56 +02:00
parent 01e3493f9f
commit f8920087ba
1 changed files with 49 additions and 43 deletions

View File

@ -32,6 +32,11 @@ $(document).ready(function() {
$('#map-station').html('Map can\'t be rendered:<br/> Your browser does not support MapboxGL (WebGL required).');
} else {
var mapboxtoken = $('div#map-station').data('mapboxtoken');
if (!mapboxtoken) {
$('#map-station').addClass('error');
$('#map-station').addClass('alert-error');
$('#map-station').html('Map can\'t be rendered:<br/> Mapbox Token is not available.');
} else {
mapboxgl.accessToken = mapboxtoken;
var map = new mapboxgl.Map({
container: 'map-station',
@ -77,6 +82,7 @@ $(document).ready(function() {
map.repaint = true;
});
}
}
// Slider filters for pass predictions
var success_slider = new Slider('#success-filter', { id: 'success-filter', min: 0, max: 100, step: 5, range: true, value: [0, 100] });