dpi independent map/theme

Started by SwissPoPo, July 12, 2015, 12:26:47

0 Members and 1 Guest are viewing this topic.

SwissPoPo

Is there a way to create a dpi independent map/theme?

The mapsforge-maps in Locus looks different on every device. I can define some dpi dependent scale in the theme (adding dp to the value). It works but it produce an unusable view on higher dpi devices, because the map itself does not scale.

How can I create a theme which looks on every device identical? A have only found a solution which I am not happy with it: Remove all dpi scaling features from the theme and manual configure "Settings > Map - advanced > Change map resolution: Enable; and Set resolution: 2x or higher".
Disadvantage: Manual user task, Bitmap Scaling even for fonts or svg. It looks ugly.

Could the dpi dependent scaling of the whole map added as option to the theme?
Is there a solution where I have not yet discovered?


Some pictures:
160dpi

240dpi


I have tested the line stroke-width with and without dp.
With 160dpi I don't expect any difference. And yes, everything looks fine.
With 240dpi the streets are scaled with the dp parameter. But it look ugly because the map itself isn't scaled. On 320 or 480dpi devices you won't see any details from the round about. I expect a smaller map view/extract. The android and locus Interface are scaled.

Remark: These screenshots have all the same resolution but on a hardware device the 240dpi pictures are much smaller.
  •  

jusc

I don´t have a solution, but why do you not set 200 - 240 dpi as reference?
This screenshot is taken from my Note 2 with 267dpi.

Regards J.
  •  

SwissPoPo

A reference of 200-240 dpi? A simple standard smartphone with 5" and Full HD has 440dpi.
So, a theme must work at 480dpi. But with Locus it does not and I can't optimize a theme for 480dpi.

I made another screenshot to explain the issue:



These screenshots are made with an android emulator and reduced in size by 50%.
The pixels on these pictures have all the same size. On a real 480dpi-device the picture is 3x smaller than on a 160dpi-device.
This require that you draw it 3x bigger so that you're capable to read or recognize something.

Column A: A Theme which does not scale by device density. Simple values or values with "px".
From 160 to 480: The pictures becomes smaller and smaller (on a real device!). You can't read anything.

Column B: A Theme which does zoom scale elements (lines, symbols, text) by device density. Values with "dp".
From 160 to 480: The text is scaling well, but the streets need too much space, they overlapping. Issue: The areas, the map itself does not scale.

Column C: A Theme which does not scale by device density. Simple values or values with "px". The scaling is manually set to 1x, 1.5x, 2x, or 3x.
From 160 to 480: The pictures have all the same size (on a real device!). Great or not? No, because it must manually set and the map is pixelated. It is not rendered at that resolution.

I expect that Locus will behave like column C automatically and without pixelating.
A normal user does not try to find this option somewhere in the settings and nobody wants to see pixels on his high dpi phone.

  •  

john_percy

Surely you should zoom in or out accordingly? What happens with your column B images if you zoom in at higher resolution, so the same area of real life is shown on the screen?
Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  

SwissPoPo

Zooming does not resolve it.

All picuture above are at zooming level 18.
I made a picture with theme B - 480dpi zooming level 19.


The areas are still to small, or the lines to big. Details are lost.

  •  

jusc

Sorry, I can´t follow.
How would you explain the difference between your 240 dpi screenshot in first post and my screenshot in seond post?
Perhaps you can let us test your theme? But I have to say, I don´t have a 480 dpi phone.
Regards J.
  •  

SwissPoPo

Yes it is not easy to understand the issue when you don't have a 480dpi device. With a 240dpi device you can recognize it, but it will not bother you. On a 480dpi device Locus becomes unusable (not the user interface, only the map).
It is also not easy to explain the issue, because all screenshots in this thread have the same pixel size (your local display define the size). You have to imagine that on a real 480dpi-device the picture is 3x smaller than on a 160dpi-device.

jusc, you asking about the difference between the two screenshots (first & second post):
Your theme is V-Scale2 right? My theme is fzk-outdoor-contrast which I am currently trying to make it more useful with Locus. The unedited version is available on the webpage freizeitkarte-osm.de.
As I have seen, your theme has no density scaling features, so the theme is similar my screenshots on the left side of the first post, or column A of third post. Both themes are unusable at 480dpi. Everything is too small.
The initial size of the street and text are a slightly bigger, but not enough that you can read it at 480dpi. This bigger size of the streets has also a disadvantage, because they overlapping with the buildings. This overlapping gets extreme when you use the density scaling features (right side first post, column B third post).

Get a 480dpi device and try it out. ;)
I hope menion has one.


  •  

Menion

Unfortunately I don't. And this is a problem why I not yet noticed any problems with themes. You (and others with such high DPI devices) will have to wait till Q4 of this year, when I plan to purchase something ...
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

john_percy

What happens with a scalable theme like my Voluntary UK, where everything is defined in terms of dp?
Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  

Tobias

Quote from: john_percy on August 19, 2015, 22:06:36
What happens with a scalable theme like my Voluntary UK, where everything is defined in terms of dp?
Same as in column B. Everything with dp gets scaled, but not the tile size which is fixed at 256px. The problem is that lines are getting thicker, but areas stay the same (and are disappearing with too much scaling).

There's two solutions:

- scale tile size with dpi (as mapsforge did starting with 0.4, 256px for 160dpi, 512px for 320dpi etc.), not implemented in Locus (and most other apps)

- use different zoom levels for comparison (e.g. one tile at ZL15 at 160dpi=256px is equal to four tiles at ZL16 at 320dpi=512px) and adapt you theme files accordingly, e.g. extra files for different dpi (disadvantage: zoom-min/max in theme files have also to be adjusted for real conversion, and zoom-appear in map files can't be adjusted)
developer of Elevate mapstyle for OpenAndroMaps
  •  

fzk

Quote from: menion on August 19, 2015, 21:22:49
Unfortunately I don't. And this is a problem why I not yet noticed any problems with themes. You (and others with such high DPI devices) will have to wait till Q4 of this year, when I plan to purchase something ...
Mapsforge 0.5 has already implemented a dpi dependent scaling feature. But I have learned from another thread that this isn't an option for Locus. So I wonder what you intend to buy and how will this solve the problem?

Klaus
  •  

SwissPoPo

Klaus, I don't think that you motivate menion to solve the problem when you point to mapsforge.

...I hope he gets his new toy long before Christmas. ;D
  •  

jusc

Quote from: SwissPoPo on August 19, 2015, 20:11:50
Get a 480dpi device and try it out. ;)

Only to get some strange looking maps?  ;D
But what about Johns question: "What happens with a scalable theme like my Voluntary UK, where everything is defined in terms of dp?"
Can you show us some screenshots with his theme too, please? I don´t have this possibility.
Regards J.
  •  

SwissPoPo

You not only get strange looking maps, you also get a very powerful phone. ;) Since over two years most flagship phones have a display density of 400 and above.

Johns question was already answered by Tobias, it looks the same as in column B (Post #3). "dp" in the theme only scales the lines, text, and icons but not the map itself (areas/buildings).
Here a screenshot at 480dpi Zoom 18 (file reduced by 50%).


You can test with the free Goggle Android Emulator (part of AndroidStudio). There also exists more comfortable emulators from others.
  •  

Viajero Perdido

#14
Quote from: john_percy on August 19, 2015, 22:06:36
What happens with a scalable theme like my Voluntary UK, where everything is defined in terms of dp?
Everything is readable!

I can finally turn off the "Change map resolution" feature (which magnifies the display by some factor), and still have very readable vector maps.  The only trouble is, with that setting off, the *online* tiled maps now look unusable.  So it's a hassle to switch between online and offline, because offline maps (with Voluntary UK) handle the high DPI, but online ones don't, and to switch I need to keep toggling the change-resolution setting.  So I mostly just stay in offline mode with Voluntary UK, or rather, my derivative version.

As a bonus, when you zoom right in, hard-to-see things like POI icons get bigger, exactly as you'd expect.

This is with a Nexus 5 with crazy-high DPI.  (Which, combined with Locus, beats the pants off a Garmin in every way.)
  •