Support for custom custom HDPI online maps

Martin Ždila shared this idea 4 months ago
Completed

Hello,

We'd like to use HDPI tiles in Locus.

Our TMS comply with standard /{z}/{x}/{y}{r} where {r} can be omited or it can define tile scale like @3x. In that case tiles are 3x bigger. We still need to keep <tileSize>256</tileSize> even the real size is 768 and we need to turn on map scaling to 300% to see map texts and elements properly.

Isn't there a more straight approach to achieve that - without need to scale the map manually? Iteally there could also be some negotiation with TMS server to find out which scales does it support and then Locus could match device's DPI with that and provide scaling automatically. But I am afraid there is no standard for that.

Tile sample: http://tiles-ng.freemap.sk/15/18288/11266@3x

I've also attached custom map definitions.

Thanks in advance.

Files: fm.xml

Comments (8)

photo
1

Good day Martin,

really interesting. I was little worried that such map comes soon or later :).

What should be from your point of view correct app behaviour how to use and display such maps? As I think about it, best should be if map should have defined base scale that will be used for display. All maps currently have base scale defined to 100%. For your 3x maps, it should be set as 300%. Will it then work?

Current Locus Map does not support such "custom scaling". Anyway I'm for a few months working on new map core for whole application and with it will be possible to set custom scaling for every single map.

Let me know if there are any better approaches that I do not see, thanks.

photo
1

Hi Menion,

Actually I think Locus should pre-set global map scaling according to display density of the device.

Currently the default scaling is always 100% and it makes elements of all raster maps look very small, ofter unreadable, regardless of whether the map is HDPI or not.

So if I have HDPI device and I install Locus, I'd like to have it set to 300% for all raster maps. Then I would see non-HDPI maps little blurred, but elements would be readable. And I would see HDPI maps sharp and readable. Actually that's how web maps (eg. based on Leaflet) work - browsers upscale low resolution images (regular map tiles) so they are not small on HDPI displays.

Vector maps are now displayed correctly - Locus renders them according to display DPI. Actually when I am switching between vector and raster maps I always must adjust scaling back and forth.

photo
1

Hi Martin,

fine so you confirmed my solution, perfect.

What you wrote make sense and it is also one of main reasons, why I in September decided to rewrite app map core. The current system does not allow to set a different scale for raster maps and a different scale for vector maps, which is a serious problem. As you wrote, the vector maps look good with 100% scale because they automatically rescale based on DPI. With raster maps ... as you wrote.

I would like to publish a new map core into some alpha test probably during February. It will anyway still needs to add an additional parameter to the XML file. I'll mark this topic and let you know when the solution on Locus Map side is ready to test/use.

photo
1

Great, I am looking forward to test it :-)

photo
1

Good day Martin,

info about the version for test: https://forum.locusmap.eu/index.php?topic=6471.0 (so not yet published) anyway to close this topic in my TODO list, I'm writing here now.

In attachment is modified the configuration for your map. Key information:

  • {ts} in the url - internally called TileScale parameter. Needed to support custom scaling
  • "tileSize" - base tile value for 1x scale, so usually 256
  • "tileScale" parameter, needs
    • "dpi" - target DPI for which scale match best. App search for the highest best value so it tries to find tileScale.dpi >= real device DPI
    • "multi" - multiplier of base "tileSize" value
    • "replace" - value that replace {ts} parameter in url

Tested and seems to work as expected ;). Alpha version for test? In the worst case at the start of March.

Files: fm.xml
photo
1

Hi Menion,


I've finally got back into it but unfortunately the link provided in forum doesn't seem to work anymore.


BTW meanwhile we changed domain for our HDPI tiles and updated supported scales to 1, 2, and 3. Please see https://raw.githubusercontent.com/FreemapSlovakia/freemap-mapnik/master/freemap-locus.xml. You can include these definitions to built-in, merging it with existing (old) freemp maps.


Thanks.

photo
1

Zdravím Martine,

thanks for additional information. I've successfully added this very nice "New Outdoor" map into Locus Map. Only what I worry little about is, that this modification may need improvements in downloaded SQLite cache/offline map. Because till now, all maps were 256x256 and this change now. Locus Map than needs to know, how to handle this format. So it won't be included in the next app release.

Also, if you will want to modify anything in map settings directly in the app, please let me know. Thanks.

photo
1

Ahoj Menion,

I leave it up to you when you will include "full" support for HDPI maps in Locus :-). From user experience I only want to select "New Outdoor" from the map list and the app would then show the map of the suitable DPI (from the list of the supported) without manually adjusting zoom and also make available for offline download etc... :-)

photo