forked from dwilhelm89/LeafletSlider
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
I managed it to work with some changes to the code:
}else if(_options.sameDate){
//it is actually the date that I want to isolate and compare
var currentDate;
if (_options.markers[ui.value].feature !== undefined) {
//we have to use the user defined timeAttribute
currentDate = _options.markers[ui.value].feature.properties[_options.timeAttribute].substring(0,10);
console.log('feature date : ' + currentDate);
} else {
//I don't know this case, but it should also be considered in the if statement below
currentDate = _options.markers[ui.value].options.time.substring(0,10);
console.log('options date : ' + currentDate);
}
for (i = _options.minValue; i <= _options.maxValue; i++) {
if(_options.markers[i].feature.properties[_options.timeAttribute].substring(0,10) == currentDate){
markers.push(_options.markers[i]);
map.addLayer(_options.markers[i]);
}
}
}else{
but still we have to consider the markers on the slider to be reduced to only distinct dates.
(wanted result)
| Timestamp in JSON | Result Slide Markers | Layers showing |
| 13/2/19 14.01 | 13/02/2019 | 2 |
| 13/2/19 14.02 | 14/02/2019 | 2 |
| 14/2/19 14.22 | 15/02/2019 | 2 |
| 14/2/19 14.22 | 16/02/2019 | 3 |
| 15/2/19 14.29 | ||
| 15/2/19 14.30 | ||
| 16/2/19 14.48 | ||
| 16/2/19 14.49 | ||
| 16/2/19 14.50 |
I don't know yet if I'm going to fix this by myself later on.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels