Leaflet control for changing date and time for Leaflet layers supporting this feature.
bower install https://github.com/FCOO/leaflet-control-datetime.git --save
http://FCOO.github.io/leaflet-control-datetime/demo/
Install the dependencies and include the Javascript and CSS file in this repository in your application (note that the CSS file uses an image from the images directory):
var myDates = [
new Date(2015,2,26,1,0,0,0),
new Date(2015,2,26,3,0,0,0),
new Date(2015,2,26,6,0,0,0),
new Date(2015,2,26,9,0,0,0),
new Date(2015,2,27,3,0,0,0)];
var $info_elem = $('#info');
var myCallback = function(event_type, current_date) {
$info_elem.html("Event type = " + event_type + '<br />Current date = ' + current_date);
}
map.addControl(new L.Control.Datetime({'datetimes': myDates,
'callback': myCallback}));
This plugin is licensed under the MIT license.
Copyright (c) 2015 FCOO
Jesper Larsen jla@fcoo.dk