| Line 197... |
Line 197... |
| 197 |
<div class="modal fade" id="liveTrackingModal" tabindex="-1" role="dialog">
|
197 |
<div class="modal fade" id="liveTrackingModal" tabindex="-1" role="dialog">
|
| 198 |
<div class="modal-dialog modal-lg" role="document" style="width:90%;">
|
198 |
<div class="modal-dialog modal-lg" role="document" style="width:90%;">
|
| 199 |
<div class="modal-content">
|
199 |
<div class="modal-content">
|
| 200 |
<div class="modal-header" style="background:#27ae60; color:white;">
|
200 |
<div class="modal-header" style="background:#27ae60; color:white;">
|
| 201 |
<button type="button" class="close" data-dismiss="modal" style="color:white;">×</button>
|
201 |
<button type="button" class="close" data-dismiss="modal" style="color:white;">×</button>
|
| 202 |
<h4 class="modal-title" id="liveTrackingModalTitle"><i class="fa fa-map-marker"></i> Live Tracking</h4>
|
202 |
<h4 class="modal-title" id="liveTrackingModalTitle"><img src="${rc.contextPath}/resources/images/Bike-Icon-SD.png" style="height:24px; vertical-align:middle; margin-right:6px;"> Live Tracking</h4>
|
| 203 |
</div>
|
203 |
</div>
|
| 204 |
<div class="modal-body" style="padding:0;">
|
204 |
<div class="modal-body" style="padding:0;">
|
| 205 |
<div id="liveTrackingInfo" style="padding:8px 15px; background:#f8f9fa; border-bottom:1px solid #ddd; font-size:13px;"></div>
|
205 |
<div id="liveTrackingInfo" style="padding:8px 15px; background:#f8f9fa; border-bottom:1px solid #ddd; font-size:13px;"></div>
|
| 206 |
<div id="liveTrackingMap" style="height:500px; width:100%;"></div>
|
206 |
<div id="liveTrackingMap" style="height:500px; width:100%;"></div>
|
| 207 |
</div>
|
207 |
</div>
|
| Line 616... |
Line 616... |
| 616 |
var lastPoint = pathCoords[pathCoords.length - 1];
|
616 |
var lastPoint = pathCoords[pathCoords.length - 1];
|
| 617 |
liveTrackingMap._currentMarker = new google.maps.Marker({
|
617 |
liveTrackingMap._currentMarker = new google.maps.Marker({
|
| 618 |
position: lastPoint,
|
618 |
position: lastPoint,
|
| 619 |
map: liveTrackingMap,
|
619 |
map: liveTrackingMap,
|
| 620 |
icon: {
|
620 |
icon: {
|
| 621 |
url: context + '/resources/images/Bike-Icon-SD.png',
|
621 |
url: '${rc.contextPath}/resources/images/Bike-Icon-SD.png',
|
| 622 |
scaledSize: new google.maps.Size(40, 40),
|
622 |
scaledSize: new google.maps.Size(40, 40),
|
| 623 |
anchor: new google.maps.Point(20, 20)
|
623 |
anchor: new google.maps.Point(20, 20)
|
| 624 |
},
|
624 |
},
|
| 625 |
title: 'Last Known Location',
|
625 |
title: 'Last Known Location',
|
| 626 |
zIndex: 999
|
626 |
zIndex: 999
|
| Line 670... |
Line 670... |
| 670 |
infoHtml += ' | Accuracy: <span class="label" style="' + accuracyBadge + ' color:white; padding:2px 8px; border-radius:3px; font-size:11px;">' + accuracyLabel + '</span> (' + avgAccuracy + 'm)';
|
670 |
infoHtml += ' | Accuracy: <span class="label" style="' + accuracyBadge + ' color:white; padding:2px 8px; border-radius:3px; font-size:11px;">' + accuracyLabel + '</span> (' + avgAccuracy + 'm)';
|
| 671 |
}
|
671 |
}
|
| 672 |
if (stopsDetected.length > 0) {
|
672 |
if (stopsDetected.length > 0) {
|
| 673 |
infoHtml += ' | <span style="color:#f39c12;"><i class="fa fa-pause-circle"></i></span> Stops: <strong>' + stopsDetected.length + '</strong>';
|
673 |
infoHtml += ' | <span style="color:#f39c12;"><i class="fa fa-pause-circle"></i></span> Stops: <strong>' + stopsDetected.length + '</strong>';
|
| 674 |
}
|
674 |
}
|
| 675 |
infoHtml += ' | <img src="' + context + '/resources/images/Bike-Icon-SD.png" style="height:16px; vertical-align:middle;"> Last Known';
|
675 |
infoHtml += ' | <img src="${rc.contextPath}/resources/images/Bike-Icon-SD.png" style="height:16px; vertical-align:middle;"> Last Known';
|
| 676 |
} else {
|
676 |
} else {
|
| 677 |
infoHtml += ' | <span style="color:#999;"><i class="fa fa-exclamation-triangle"></i> No GPS data yet</span>';
|
677 |
infoHtml += ' | <span style="color:#999;"><i class="fa fa-exclamation-triangle"></i> No GPS data yet</span>';
|
| 678 |
}
|
678 |
}
|
| 679 |
|
679 |
|
| 680 |
infoHtml += ' | <span style="color:#e74c3c;"><i class="fa fa-arrow-right" style="font-size:10px;"></i></span> GPS Trail';
|
680 |
infoHtml += ' | <span style="color:#e74c3c;"><i class="fa fa-arrow-right" style="font-size:10px;"></i></span> GPS Trail';
|
| 681 |
if (visitCoords.length > 1) {
|
681 |
if (visitCoords.length > 1) {
|
| 682 |
infoHtml += ' | <span style="background:#8e44ad; display:inline-block; width:14px; height:3px; vertical-align:middle; margin:0 2px;"></span> Route';
|
682 |
infoHtml += ' | <span style="background:#8e44ad; display:inline-block; width:14px; height:3px; vertical-align:middle; margin:0 2px;"></span> Route';
|
| 683 |
}
|
683 |
}
|
| - |
|
684 |
var locToggle = data.locationToggleCount || 0;
|
| - |
|
685 |
if (locToggle > 0) {
|
| - |
|
686 |
infoHtml += ' | <span class="label" style="background:#e74c3c; color:white; padding:2px 8px; border-radius:3px; font-size:11px;"><i class="fa fa-power-off"></i> Loc Off: ' + locToggle + '</span>';
|
| - |
|
687 |
}
|
| - |
|
688 |
|
| 684 |
infoHtml += ' | <span style="color:#999;">Updated: ' + timeStr + '</span>';
|
689 |
infoHtml += ' | <span style="color:#999;">Updated: ' + timeStr + '</span>';
|
| 685 |
|
690 |
|
| 686 |
$('#liveTrackingInfo').html(infoHtml);
|
691 |
$('#liveTrackingInfo').html(infoHtml);
|
| 687 |
|
692 |
|
| 688 |
// Low data warning
|
693 |
// Low data warning
|
| Line 726... |
Line 731... |
| 726 |
}
|
731 |
}
|
| 727 |
|
732 |
|
| 728 |
$(document).on('click.livetrack', '.live-tracking-btn', function () {
|
733 |
$(document).on('click.livetrack', '.live-tracking-btn', function () {
|
| 729 |
liveTrackingUserId = $(this).data('userid');
|
734 |
liveTrackingUserId = $(this).data('userid');
|
| 730 |
liveTrackingUsername = $(this).data('username');
|
735 |
liveTrackingUsername = $(this).data('username');
|
| 731 |
$('#liveTrackingModalTitle').html('<i class="fa fa-map-marker"></i> Live Tracking - ' + liveTrackingUsername);
|
736 |
$('#liveTrackingModalTitle').html('<img src="${rc.contextPath}/resources/images/Bike-Icon-SD.png" style="height:24px; vertical-align:middle; margin-right:6px;"> Live Tracking - ' + liveTrackingUsername);
|
| 732 |
$('#liveTrackingInfo').html('<div class="text-center"><i class="fa fa-spinner fa-spin"></i> Loading...</div>');
|
737 |
$('#liveTrackingInfo').html('<div class="text-center"><i class="fa fa-spinner fa-spin"></i> Loading...</div>');
|
| 733 |
$('#liveTrackingModal').modal('show');
|
738 |
$('#liveTrackingModal').modal('show');
|
| 734 |
|
739 |
|
| 735 |
setTimeout(function () {
|
740 |
setTimeout(function () {
|
| 736 |
liveTrackingMap = null;
|
741 |
liveTrackingMap = null;
|