Skip to content

sameDate not working as expected #2

@mwithi

Description

@mwithi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions