Commit c9df0150 authored by Elias Englmeier's avatar Elias Englmeier
Browse files

added fields to map

parent ccd5bd43
...@@ -42,17 +42,17 @@ $(document).ready(function(){ ...@@ -42,17 +42,17 @@ $(document).ready(function(){
markerGroup.addLayer(loadedMarker); markerGroup.addLayer(loadedMarker);
loadedMarker.dbId = value.id; loadedMarker.dbId = value.id;
loadedMarker.bindTooltip(value.title).openTooltip(); loadedMarker.bindTooltip(value.title).openTooltip();
loadedMarker.bindPopup(getMarkerPopUp(value.id,value.title,value.shortdescription,value.pageUrl)); loadedMarker.bindPopup(getMarkerPopUp(value.id,value.title,value.userName,value.pageUrl,value.rating));
map.addLayer(loadedMarker); map.addLayer(loadedMarker);
//map.panTo(latlng);
} }
}); });
map.fitBounds(markerGroup.getBounds().pad(0.5)); map.fitBounds(markerGroup.getBounds().pad(0.5));
}else{ }else{
map.setView([51.312066, 9.492901],12) map.setView([51.312066, 9.492901],12)
} }
function getMarkerPopUp(id, title, description,link){ function getMarkerPopUp(id, title, username,link,votes){
return "<h4>" + title + "</h4>" + "<p>" + description + "</p><br>" + "<a href=" + link + ">Goto</a>"; var votescount = votes.split(",");
return "<h4>" + title + "</h4>" + "<p> Eingereicht von " + username + "</p>" + "<p> Stimmen: " + votescount.length + "</p><br>" + "<a href=" + link + ">Details</a>";
} }
}); });
</script> </script>
\ No newline at end of file
...@@ -42,17 +42,17 @@ $(document).ready(function(){ ...@@ -42,17 +42,17 @@ $(document).ready(function(){
markerGroup.addLayer(loadedMarker); markerGroup.addLayer(loadedMarker);
loadedMarker.dbId = value.id; loadedMarker.dbId = value.id;
loadedMarker.bindTooltip(value.title).openTooltip(); loadedMarker.bindTooltip(value.title).openTooltip();
loadedMarker.bindPopup(getMarkerPopUp(value.id,value.title,value.shortdescription,value.pageUrl)); loadedMarker.bindPopup(getMarkerPopUp(value.id,value.title,value.userName,value.pageUrl,value.rating));
map.addLayer(loadedMarker); map.addLayer(loadedMarker);
//map.panTo(latlng);
} }
}); });
map.fitBounds(markerGroup.getBounds().pad(0.5)); map.fitBounds(markerGroup.getBounds().pad(0.5));
}else{ }else{
map.setView([51.312066, 9.492901],12) map.setView([51.312066, 9.492901],12)
} }
function getMarkerPopUp(id, title, description,link){ function getMarkerPopUp(id, title, username,link,votes){
return "<h4>" + title + "</h4>" + "<p>" + description + "</p><br>" + "<a href=" + link + ">Goto</a>"; var votescount = votes.split(",");
return "<h4>" + title + "</h4>" + "<p> Eingereicht von " + username + "</p>" + "<p> Stimmen: " + votescount.length + "</p><br>" + "<a href=" + link + ">Details</a>";
} }
}); });
</script> </script>
\ No newline at end of file
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