cgeo / cgeo

c:geo - The powerful Android geocaching app.
www.cgeo.org
Apache License 2.0
1.39k stars 567 forks source link

Make map lines more customizable #8416

Closed moving-bits closed 4 years ago

moving-bits commented 4 years ago

Triggered by https://github.com/cgeo/cgeo/issues/8393#issue-627869974 by @MagpieFourtyTwo (among others):

Please make track line slimmer again (was perfectly fine before, at least for me) or it's width (and/or transparency) even configurable.

Reasoning behind this is that you won't find a "one size fits all" approach across different maps, map styles, themes, screen dimensions, not to mention personal preferences, so make width and color of the most common map lines configurable, with current settings as defaults. Configurability should include direction/navigation line, route line, history line and the upcoming track line.

MagpieFourtyTwo commented 4 years ago

Upcoming track line? From imported tracks? BTW: Would it be a big deal to implement an export of the history line track as gpx? Would be a perfect helper for OSM edits ...

moving-bits commented 4 years ago

Upcoming track line? From imported tracks?

Yes, that's #8376, scheduled for a post 2020-06-release.

BTW: Would it be a big deal to implement an export of the history line track as gpx? Would be a perfect helper for OSM edits ...

Shouldn't be too hard to implement. But should be accompanied with a larger trail history length - currently history trail gets cut off after 700 entries, which is memory saving, but by far not enough for a day trip. Maybe needs to be made configurable, so that someone with enough RAM can set this to a higher value.

MagpieFourtyTwo commented 4 years ago

Upcoming track line? From imported tracks?

Yes, that's #8376, scheduled for a post 2020-06-release.

Missed this completely. Thx for pointing me to it. Great stuff! :)

MagpieFourtyTwo commented 4 years ago

Customization of line colors and widths is cool stuff, but esp. the configurable opaqueness is really great, thanks for it. Only issue right now: The history line's "opaqueness" just seems to change the border color - the line itself stays white and 100 % opaque, thus hiding the road/trail underneath it completely.

BTW: Could possibly the zoom factor be considered for calculating a variable line width? Cause right now the lines stay unchanged, thus a line set to e. g. 20, which is the minimum over here to still be able to see it at zoom level 50 m, it (still) covers even a highway completely, if zoom level is set to 500 m or more.

Last but not least: The defaults for line widths of 4 to 6 were completely invisible over here (high resolution screen :) or :/ ). 15 to 20 would be ok, I think, although right now I ended up at 50 (opaqueness 100) for now, so I in fact get kind of an outer glow of e. g. the routed roads, and on some zoom levels even up to 100 would be good. But I'm still experimenting. ;)

MagpieFourtyTwo commented 4 years ago

And a little bit irritating is, that the "points" in e. g. the route and direction lines appear darker than the connecting line itself (perhaps cause the "points" in fact consist of two overlapping lines?). This makes it hard (at least for me) to find a good setting for opaqueness, which works for all zoom levels.

moving-bits commented 4 years ago

The history line's "opaqueness" just seems to change the border color - the line itself stays white and 100 % opaque, thus hiding the road/trail underneath it completely.

Yes, the history line itself is not customizable yet, just stays at white / fully opaque. Only the "history shadow line" ist customizable currently.

What would be better?

(Width is always set to be half of the shadow's width. - Don't think that we need to make this customizable as well.)

BTW: Could possibly the zoom factor be considered for calculating a variable line width? Cause right now the lines stay unchanged, thus a line set to e. g. 20, which is the minimum over here to still be able to see it at zoom level 50 m, it (still) covers even a highway completely, if zoom level is set to 500 m or more.

That's strange. I'm currently multiplying the set width with a screen density factor Android provides, so it should be the same size independent of map zoom factor. (And it's working this way in the emulator.)

In what way could zoom level be considered? What could be influencing factors (and in what direction)?

Last but not least: The defaults for line widths of 4 to 6 were completely invisible over here (high resolution screen :) or :/ ).

Strange again. 4 (history trail) and 6 (others) should lead to the same results we had before this PR due to the internal formulas.

15 to 20 would be ok, I think, although right now I ended up at 50 (opaqueness 100) for now, so I in fact get kind of an outer glow of e. g. the routed roads, and on some zoom levels even up to 100 would be good. But I'm still experimenting. ;)

Max limit currently is set to 50, but I can increase that easily.

MagpieFourtyTwo commented 4 years ago

As for the history line: white with 100 % opaque would be the worst option, was in fact the reason for the issue I initially had, cause it completely covers the map information (esp. difference between roads and tracks, i. e. driving vs. walking). Same opaqueness as shadow would be a bit better, but still hard to read, cause when set to a value where one can see the road type, shadow and line will both vanish. ;)

So I would prefer to be able to set at least the line's opaqueness, cause then you can e. g. set line to "invisible" and shadow to e. g. 50 % opaque and with that get a real bread crumb line, which allows to a) see the track and b) see the road/track type, too. Nevertheless color would be good, too, cause then you can even make a consistent blue line, as it was before.

This drawing strategy would in fact be "best" (can just talk for me, of course :) ) for all line types, cause even a route line does not really help, if it covers the road/track type. Therefore I would consider it as optimal, when either a bread crumb trail can be displayed (esp for tracks, aka history lines) or just shadow, thus drawing a line where just the right and left border (shadow) are shown and the middle is transparent, to show the road/track type. Being able to set both would meet everyone's preference, I would say.

As for the screen densitiy: Perhaps it's hardware resp. brand dependent, too? Over here it's Huawei ...

In what way could zoom level be considered? What could be influencing factors (and in what direction)?

Right now the widths of the lines seem to be pretty constant, no matter which zoom level is set. Although I have the impression that there is a minimum width, which leads to a way more prominent visible line when zoom level is set to 1 km or even more (more = 2 km, 5 km ...).

My idea was: Apart from screen densitiy the width could possibly be kind of divided by the zoom level, thus getting narrower when zoom level goes up, so if you set it to a width where it may cover half of a highway at 50 m zoom, it still just covers half of the highway at 500 m - and not, like it seems to be right now, all of the highway, poss. incl. the parking lot you just missed ... ;)

Hope to have described it more understandable now ...? :)

MagpieFourtyTwo commented 4 years ago

Ah, max val: Right now I'm using width 20, opaqueness 150, but if the "real glow" (i. e. with transparent center of the line) will be possible, and perhaps even zoom level will be considered, I guess up to 100 would be good (at least for Huawei ;) ).

MagpieFourtyTwo commented 4 years ago

Observations from yesterday's caching life: :)

BTW: Currently working with width 12, opaqueness 128, still experimenting.

moving-bits commented 4 years ago

Just a quick partial reply: Route = individual routes => see #8158. This is completely independent from direction/navigation line.

MagpieFourtyTwo commented 4 years ago

Aaaah! Ok, have not created an individual route since the new settings came up. Thx! Nevertheless, I would suggest a more specific menu entry. ;)

moving-bits commented 4 years ago

Therefore I would consider it as optimal, when either a bread crumb trail can be displayed (esp for tracks, aka history lines)

you mean something like a dotted line?

or just shadow, thus drawing a line where just the right and left border (shadow) are shown and the middle is transparent, to show the road/track type. Being able to set both would meet everyone's preference, I would say.

I've searched around a bit but could not find a solution where just the borders of a line get drawn. Looks like they all treat a line as a single entity, having width / color / pattern (for dotted lines), but no concept of a "fill" here.

What c:geo currently does with the history trail is double-painting - first paint the shadow line, then the trail on top of it, covering part of the shadow and by this creating the illusion of what you described above. But also covering the original map twice.

moving-bits commented 4 years ago

This drawing strategy would in fact be "best" (can just talk for me, of course :) ) for all line types, cause even a route line does not really help, if it covers the road/track type.

Additional info: History trail is the only line type which we draw in this two step way ("shadow first", then the line itself, at half width). All other lines only consist of a single line.

Having said this, a different option could be to change the history trail to a single line only, having no "shadow" any more.

moving-bits commented 4 years ago

In what way could zoom level be considered? What could be influencing factors (and in what direction)?

Right now the widths of the lines seem to be pretty constant, no matter which zoom level is set. Although I have the impression that there is a minimum width, which leads to a way more prominent visible line when zoom level is set to 1 km or even more (more = 2 km, 5 km ...).

My idea was: Apart from screen densitiy the width could possibly be kind of divided by the zoom level, thus getting narrower when zoom level goes up, so if you set it to a width where it may cover half of a highway at 50 m zoom, it still just covers half of the highway at 500 m - and not, like it seems to be right now, all of the highway, poss. incl. the parking lot you just missed ... ;)

Hope to have described it more understandable now ...? :)

Not sure if I already understand... You mean like:

MagpieFourtyTwo commented 4 years ago

[bread crumb line]

you mean something like a dotted line?

Yep, that's the way, Garmin displayed them "in the earlies". ;)

I've searched around a bit but could not find a solution where just the borders of a line get drawn

Ah, ok - so I obviously misunderstood your "shadow": I implicitly assumed there is a frame color and additionally a fill color, as it usually is with nearly all vectorized drawing objects. Sorry for the confusion. But - you mentioned pattern style? Could this be a possibility to get what I described?

Ok, other way round: The problem I would like to solve is, that the more visible route and track lines get, the more important map information they hide (like track type, surface and stuff). So I would prefer a line style where both can be seen: route resp. track and map info. Like with e. g. a line with transparent center or even a dotted one. Whereas the latter should not just consist of start, end and curve points, as the distance between these may be too far to still recognize them as a (virtually) connected line.

As for the "double painting": This I would consider as overdone, as all this takes CPU time, memory and battery. Most probably not that much, but "many a mickle makes a muckle". ;) Even more if not just the history line, but all four lines do it that way.

So possibly go with the line pattern style ...? If can be done with reasonable effort, of course.

Not sure if I already understand... You mean like:

  • zoomlevel 20 (10m or so, depending on map) - line width = 100%
  • zoomlevel 1 ("world view") - line width = 15% (= much thinner)

Yep. Like roads change their width, too, when zoom level changes. Cause if the line has the same width (in pixels) in all zoom levels, a line with a width of 10 pixel (approx. 1 mm), which would be perfectly fine in zoom level 16 (~100 m?), as it still leaves enough parts visible from the underlaying track type etc, can barely be seen in zoom level 20, cause it's too narrow then, but will probably cover half of Saarland in zoom level 1 (exaggerated ;) ).

moving-bits commented 4 years ago

@MagpieFourtyTwo

I consider the last proposal very specific. After having some experience with the current customizations: Ok for you to close this issue?

MagpieFourtyTwo commented 4 years ago

Yep.