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

Make plane lines more distinct/visible on the map #138

Open
paalbra opened this issue Jul 14, 2021 · 1 comment
Open

Make plane lines more distinct/visible on the map #138

paalbra opened this issue Jul 14, 2021 · 1 comment
Labels
web Stuff for the web team to look at

Comments

@paalbra
Copy link

paalbra commented Jul 14, 2021

Hi! I'm not familiar with OpenLayers. Please bear with me and my lack of knowledge.

I think the altitude color added to the plane lines are very nice. But some times, depending on the background map, I find it hard to see the line. E.g. when you have green on green, or blue on blue.

I think that maybe some sort of outer stroke added to the line could help make them more distinct in these cases.

I've tried to experiment by adding a second stroke to the altitudeLines:

// return the styling of the lines based on altitude
PlaneObject.prototype.altitudeLines = function(altitude) {
var colorArr = this.getAltitudeColor(altitude);
return new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'hsl(' + (colorArr[0]/5).toFixed(0)*5 + ',' + (colorArr[1]/5).toFixed(0)*5 + '%,' + (colorArr[2]/5).toFixed(0)*5 + '%)',
width: 2
})
})
}

E.g something like:

// return the styling of the lines based on altitude
PlaneObject.prototype.altitudeLines = function(altitude) {
    var colorArr = this.getAltitudeColor(altitude);
    var color_bg = new ol.style.Style({
        stroke: new ol.style.Stroke({
            color: 'rgba(0, 0, 0, 0.2)',
            width: 4
        })
    });
    var color_fg = new ol.style.Style({
        stroke: new ol.style.Stroke({
            color: 'hsl(' + (colorArr[0]/5).toFixed(0)*5 + ',' + (colorArr[1]/5).toFixed(0)*5 + '%,' + (colorArr[2]/5).toFixed(0)*5 + '%)',
            width: 2
        })
    });
    return [color_bg, color_fg];
}

Some variations (current behavior/look on top):

image

I think the joints/point where lines connect look really bad here. It's very visible with the black stroke/the lower example.

Since I don't know OpenLayers, I don't know if it's possible to make these joints look good somehow?

Any thoughts?

@paalbra
Copy link
Author

paalbra commented Jul 14, 2021

I found this example which I feel is kind of related(?): https://viglino.github.io/ol-ext/examples/style/map.style.flowline.html

I've done some live changes to this example to illustrate that an outer stroke makes the line easier to see:

image

This example doesn't have the same problem with the joints, for some reason I do not know.

@mutability mutability added the web Stuff for the web team to look at label Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web Stuff for the web team to look at
Projects
None yet
Development

No branches or pull requests

2 participants