Commit 590e11df authored by Elias Englmeier's avatar Elias Englmeier
Browse files

map is now always showing Kassel if there are no markers to be displayed

parent 724b2a2f
......@@ -30,8 +30,10 @@ $(document).ready(function(){
id: 'mapbox.streets',
accessToken: 'your.mapbox.access.token'
}).addTo(map);
//load markers from server
var ideasJsonArray = JSON.parse('${allIdeas}');
if(ideasJsonArray.length > 0){
var markerGroup = new L.featureGroup();
$.each(ideasJsonArray, function (index, value) {
if(value.isVisibleOnMap){
......@@ -46,7 +48,9 @@ $(document).ready(function(){
}
});
map.fitBounds(markerGroup.getBounds().pad(0.5));
}else{
map.setView([51.312066, 9.492901],12)
}
function getMarkerPopUp(id, title, description,link){
return "<h4>" + title + "</h4>" + "<p>" + description + "</p><br>" + "<a href=" + link + ">Goto</a>";
}
......
......@@ -30,8 +30,10 @@ $(document).ready(function(){
id: 'mapbox.streets',
accessToken: 'your.mapbox.access.token'
}).addTo(map);
//load markers from server
var ideasJsonArray = JSON.parse('${allIdeas}');
if(ideasJsonArray.length > 0){
var markerGroup = new L.featureGroup();
$.each(ideasJsonArray, function (index, value) {
if(value.isVisibleOnMap){
......@@ -46,7 +48,9 @@ $(document).ready(function(){
}
});
map.fitBounds(markerGroup.getBounds().pad(0.5));
}else{
map.setView([51.312066, 9.492901],12)
}
function getMarkerPopUp(id, title, description,link){
return "<h4>" + title + "</h4>" + "<p>" + description + "</p><br>" + "<a href=" + link + ">Goto</a>";
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment