Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sameDate not working as expected #2

Open
mwithi opened this issue Jun 14, 2020 · 2 comments
Open

sameDate not working as expected #2

mwithi opened this issue Jun 14, 2020 · 2 comments

Comments

@mwithi
Copy link

mwithi commented Jun 14, 2020

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.

@Falke-Design
Copy link
Owner

Yeah I see that there is a bug. I fixed this already local.
But what exactly do you want to achieve? I don't understand what you mean with but still we have to consider the markers on the slider to be reduced to only distinct dates. and is the table the wanted result or the current result?

@mwithi
Copy link
Author

mwithi commented Jun 19, 2020

Hi, the table in the example is the wanted result.
Look at the steps on the slider, the same layers are showed for subsequent steps on the slider because they share the same date (but not time); the expected result (IMO) is that on the slider we should have only dates (without time) since we are asking to combine "sameDate" jsons

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants