Adding date picker for the full history view.

revert-dabc3590
sinthuja 8 years ago
parent 0810928e0e
commit 8b7be8db38

@ -69,6 +69,12 @@
<!--TODO: use http://requirejs.org/ for better performance, now we have too many imports -->
<!-- C3 chart library styles-->
<link rel="stylesheet" href="css/d3/c3.css" type="text/css"/>
<link rel="stylesheet" href="css/bootstrap-datepicker.min.css" type="text/css"/>
<style>
.datepicker-inline {
margin:0 auto;
}
</style>
<!-- JAVASCRIPT -->
@ -85,7 +91,17 @@
<script src="js/jquery/jquery-2.1.1.min.js"></script>
<script src="js/jquery/jquery-ui.min.js"></script>
<script src="js/bootstrap/bootstrap.min.js"></script>
<script src="js/bootstrap-datepicker.min.js"></script>
<script>
$(function() {
$("#timeFrom").datepicker({
orientation: 'top'
});
$("#timeTo").datepicker({
orientation: 'top'
});
});
</script>
<!--bootstrap-application-wizard-->
<script src="js/bootstrap-wizard-lib/bootstrap-wizard.js"></script>

@ -327,25 +327,31 @@ function notifyError(message) {
function enableRealTime() {
document.getElementById('realTimeShow').style.display = 'none';
spatialObject = currentSpatialObjects[selectedSpatialObject];
spatialObject.removePath();
spatialObject.marker.closePopup();
if (spatialObject) {
spatialObject.removePath();
spatialObject.marker.closePopup();
}
selectedSpatialObject = null;
clearFocus();
clearMap();
document.getElementById('objectInfo').style.display = 'none';
isBatchModeOn = false;
}
function focusOnHistorySpatialObject(objectId, timeFrom, timeTo) {
if (!timeFrom) {
notifyError('No start time provided to show history. Please provide a suitable value' + timeFrom);
} else if (!timeTo) {
notifyError('No end time provided to show history. Please provide a suitable value' + timeTo);
} else {
$('#dateRangePopup').dialog('close');
document.getElementById('realTimeShow').style.display = 'block';
isBatchModeOn = true;
clearFocus(); // Clear current focus if any
clearMap();
var tableData = getProviderData(timeFrom, timeTo);
var fromDate = new Date(timeFrom);
var toDate = new Date(timeTo);
var tableData = getProviderData(fromDate.valueOf() / 1000, toDate.valueOf() / 1000);
for (var i = 0; i < tableData.length; i++) {
var data = tableData[i];
var geoMessage = {
@ -401,7 +407,6 @@ function focusOnHistorySpatialObject(objectId, timeFrom, timeTo) {
createChart();
chart.load({columns: [spatialObject.speedHistory.getArray()]});
}, 100);
$('#dateRangePopup').dialog('close');
}
}

Loading…
Cancel
Save