Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/build/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resources/assets/sass/app.scss": {
"file": "assets/app-F8GDFh2T.css",
"file": "assets/app-DsJ8rwW1.css",
"src": "resources/assets/sass/app.scss",
"isEntry": true
},
Expand Down
94 changes: 50 additions & 44 deletions public/js/customMap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
L.custom = {
init: function(obj, params){ // this method is run as soon as the core loading process is loaded
init: function (obj, params) { // this method is run as soon as the core loading process is loaded

window.map = L.map(obj, {
center: [48, 4],
Expand All @@ -15,7 +15,7 @@ L.custom = {

var success = function (data) {

var markerOnClick = function(e){
var markerOnClick = function (e) {
var id = e.target.options.id;
$.ajax({
dataType: "json",
Expand All @@ -27,66 +27,73 @@ L.custom = {
'<img src="' + event.picture + '" class="img-polaroid marker-buble-img" style="width:100px;height:100px;">' +
'<p style="overflow:hidden;">' + event.description + '</p>';

var popup = L.popup({maxWidth:600})
var popup = L.popup({ maxWidth: 600 })
.setContent(content)

e.target.bindPopup(popup).openPopup();
}
});
}

if (markersCountryLayers.length > 0){
$.each(markersCountryLayers, function (key, countryLayer) {
countryLayer.clearLayers();
})
// Clear previous layers if needed
if (markersCountryLayers.length > 0) {
$.each(markersCountryLayers, function (key, layer) {
layer.clearLayers();
map.removeLayer(layer);
});
markersCountryLayers = [];
}

// Create ONE global cluster group
var allMarkersClusterGroup = L.markerClusterGroup({
showCoverageOnHover: false,
maxClusterRadius: 120,
chunkedLoading: true,
iconCreateFunction: function (cluster) {
var total = cluster.getAllChildMarkers().length;
var iconSize;
var className = "mycluster ";
if (total <= 10) {
iconSize = L.point(30, 30);
className += "size1";
} else if (total <= 100) {
iconSize = L.point(35, 35);
className += "size2";
} else if (total <= 1000) {
iconSize = L.point(40, 40);
className += "size3";
} else if (total <= 10000) {
iconSize = L.point(45, 45);
className += "size4";
} else {
iconSize = L.point(50, 50);
className += "size5";
}
return L.divIcon({ html: '<div>' + total + '</div>', className: className, iconSize: iconSize });
}
});

// Add ALL markers to ONE cluster group
$.each(data, function (key, country) {
var markersListPerCountry = [];
$.each(country, function (key, val) {
var coordinates = val.geoposition.split(',');
var marker = L.marker(L.latLng(coordinates[0], coordinates[1]), {id: val.id});
var marker = L.marker(L.latLng(coordinates[0], coordinates[1]), { id: val.id });
marker.on('click', markerOnClick);
markersListPerCountry.push(marker);
allMarkersClusterGroup.addLayer(marker);
});
var markers = L.markerClusterGroup({
showCoverageOnHover: false,
maxClusterRadius: 120,
chunkedLoading: true,
iconCreateFunction: function(cluster) {
var total = cluster.getAllChildMarkers().length;
var iconSize;
var className = "mycluster ";
if (total<= 10){
iconSize = L.point(30, 30);
className += "size1";
}else if(total <=100){
iconSize = L.point(35, 35);
className += "size2";
}else if(total <= 1000) {
iconSize = L.point(40, 40);
className += "size3";
}else if(total <= 10000) {
iconSize = L.point(45, 45);
className += "size4";
}else {
iconSize = L.point(50, 50);
className += "size5";
}
return L.divIcon({ html: '<div>'+total+'</div>', className: className, iconSize: iconSize });
}
});
markers.addLayers(markersListPerCountry);
markersCountryLayers.push(markers);
map.addLayer(markers);
});

// Add the global cluster group to the map
map.addLayer(allMarkersClusterGroup);

// Save reference
markersCountryLayers.push(allMarkersClusterGroup);

// process next components
$wt._queue("next");
}

$('#id_year').on('change', function () {
//window.location = window.App.url + '/events?year=' + this.value;
getEvents(this.value);
});

Expand All @@ -97,13 +104,12 @@ L.custom = {
function getEvents(year) {
$.ajax({
dataType: "json",
url: "api/event/list?year="+ year,
url: "api/event/list?year=" + year,
success: success
});
}

var year = param('year') ? param('year') : 2019;
getEvents(year);

}
}
}
6 changes: 5 additions & 1 deletion resources/views/errors/403.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
</div>
<div class="error-box">
<h1>Error!</h1>
<p>User does not have the right roles.</p>
@if($exception->getMessage())
<p>{{ $exception->getMessage() }}</p>
@else
<p>You are not authorized to perform this action!</p>
@endif
<a href="/">Go back to homepage</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/errors/404.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</div>
<div class="error-box">
<h1>Error!</h1>
<p>User does not have the right roles.</p>
<p>Page not found</p>
<a href="/">Go back to homepage</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/errors/500.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</div>
<div class="error-box">
<h1>Error!</h1>
<p>User does not have the right roles.</p>
<p>Oops! Something is not working. Try again in a bit!</p>
<a href="/">Go back to homepage</a>
</div>
</div>
Expand Down