|
|
@ -16,13 +16,30 @@ var goldIcon = new L.Icon({ |
|
|
|
shadowSize: [41, 41] |
|
|
|
shadowSize: [41, 41] |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var bluePlayerIcon = new L.Icon({ |
|
|
|
|
|
|
|
iconUrl: '/static/assets/leaflet/images/person-marker-icon-2x-blue.png', |
|
|
|
|
|
|
|
shadowUrl: '/static/assets/leaflet/images/marker-shadow.png', |
|
|
|
|
|
|
|
iconSize: [25, 41], |
|
|
|
|
|
|
|
iconAnchor: [12, 41], |
|
|
|
|
|
|
|
popupAnchor: [1, -34], |
|
|
|
|
|
|
|
shadowSize: [41, 41] |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var greenPlayerIcon = new L.Icon({ |
|
|
|
|
|
|
|
iconUrl: '/static/assets/leaflet/images/person-marker-icon-2x-green.png', |
|
|
|
|
|
|
|
shadowUrl: '/static/assets/leaflet/images/marker-shadow.png', |
|
|
|
|
|
|
|
iconSize: [25, 41], |
|
|
|
|
|
|
|
iconAnchor: [12, 41], |
|
|
|
|
|
|
|
popupAnchor: [1, -34], |
|
|
|
|
|
|
|
shadowSize: [41, 41] |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
function addObjectiveMarker(map, objective){ |
|
|
|
function addObjectiveMarker(map, objective){ |
|
|
|
var objectiveMarker = L.marker([ |
|
|
|
var objectiveMarker = L.marker([ |
|
|
|
objective['latitude'], |
|
|
|
objective['latitude'], |
|
|
|
objective['longitude'] |
|
|
|
objective['longitude'] |
|
|
|
]) |
|
|
|
], {icon: greenIcon}) |
|
|
|
if(objective['found']){ |
|
|
|
if(objective['found']){ |
|
|
|
console.log('test') |
|
|
|
|
|
|
|
objectiveMarker.setIcon(goldIcon) |
|
|
|
objectiveMarker.setIcon(goldIcon) |
|
|
|
} |
|
|
|
} |
|
|
|
objectiveMarker.addTo(map); |
|
|
|
objectiveMarker.addTo(map); |
|
|
@ -35,11 +52,11 @@ function addObjectiveMarker(map, objective){ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function addPlayerMarker(map, player){ |
|
|
|
function addPlayerMarker(map, player, icon=bluePlayerIcon){ |
|
|
|
var playerMarker = L.marker([ |
|
|
|
var playerMarker = L.marker([ |
|
|
|
player['latitude'], |
|
|
|
player['latitude'], |
|
|
|
player['longitude'] |
|
|
|
player['longitude'] |
|
|
|
], {icon: greenIcon}).addTo(map); |
|
|
|
], {icon: icon}).addTo(map); |
|
|
|
var timestamp_utc = moment.utc(player['timestamp_utc']).toDate() |
|
|
|
var timestamp_utc = moment.utc(player['timestamp_utc']).toDate() |
|
|
|
var timestamp_local = moment(timestamp_utc).local().format('YYYY-MM-DD HH:mm'); |
|
|
|
var timestamp_local = moment(timestamp_utc).local().format('YYYY-MM-DD HH:mm'); |
|
|
|
playerMarker.bindTooltip(`<b>${player['username']}</b><br>
|
|
|
|
playerMarker.bindTooltip(`<b>${player['username']}</b><br>
|
|
|
|