Scaling of dy displacement with zoom

Started by john_percy, October 11, 2016, 19:27:23

0 Members and 1 Guest are viewing this topic.

john_percy

In a a pair of lines like
<line stroke="#B3A18F" stroke-width="0.6dp" dy="2dp" stroke-dasharray="1,8" stroke-linecap="butt" />
<line stroke="#B3A18F" stroke-width="0.1dp" stroke-linecap="butt" />

the stroke-width scales up and down with the zoom but the dy displacement does not change in the same way.

This code is intended to produce a line with ticks off to one side. As far as I can see, ideally it ought to be:
<line stroke="#B3A18F" stroke-width="0.6dp" dy="0.3dp" stroke-dasharray="1,8" stroke-linecap="butt" />
<line stroke="#B3A18F" stroke-width="0.1dp" stroke-linecap="butt" />

with teh displacement and the width scaling exactly the same way.
Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  

Tobias

+1

There was a similar issues in standard mapsforge 0.5 which was fixed in 0.5.1, discussion and issue here:
https://groups.google.com/d/msg/mapsforge-dev/xQHb-CNxlag/UxiDgFXyyLMJ
https://github.com/mapsforge/mapsforge/issues/580

The problem is that stroke width is scaled for zoom levels >12 with a base 1.5, so strokes get wider, but everything defined by dy keeps the same distance, so it looks like it moves relative to another object which hasn't the same dy value.
developer of Elevate mapstyle for OpenAndroMaps
  •  

Menion

Hello John, Tobias,
thanks for a feedback. I'll enable this improvement to next BETA version, so there will be some time to test it.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

Tobias

Quote from: menion on October 12, 2016, 12:12:31
Hello John, Tobias,
thanks for a feedback. I'll enable this improvement to next BETA version, so there will be some time to test it.
After checking with the last beta versions, still same behavior - probably planning for beta version 3.21 instead 3.20.x?
developer of Elevate mapstyle for OpenAndroMaps
  •  

john_percy

Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  

Menion

Ah sorry guys!
I've included this change into one of previous versions, but @voldapet stopped me because he had some troubles in compatibility with Locus internal themes. And then I've forget on this topic, sorry.

As I think about it, best should be add extra parameter to keep current system compatible with old and new themes.

So in next version of Locus Map will themes support parameter "scale-line-dy-by-zoom" in header of themes. So will be able to add aditional argument scale-line-dy-by-zoom="1" , which enable this required scaling. Possible? Let me know how it works in next Beta version (probably tomorrow ).

So example of such locus internal theme header:

<?xml version="1.0" encoding="UTF-8"?>
<rendertheme xmlns="http://mapsforge.org/renderTheme"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://mapsforge.org/renderTheme https://raw.githubusercontent.com/mapsforge/mapsforge/dev/resources/renderTheme.xsd"
  version="1"
  locus-extended="1"
  fill-sea-areas="0"
  map-background="#ebeade"
  scale-line-dy-by-zoom="1">

- 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

That sounds like the best solution. I await the next beta. :)
Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  

Tobias

I finally came around to test it, works great for me in the latest beta. No more "moving" ways.
Thanks menion!
developer of Elevate mapstyle for OpenAndroMaps
  •  

Menion

Glad to hear it. Current solution is usable for you without any issue right? Our internal themes stay unaffected, other themes as well ... hmm I see no problem, perfect. I'm just preparing new version, release will be probably tomorrow.
- 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

It works fine for me too. Many thanks.
Voluntary and Velocity themes - https://voluntary.nichesite.org
  •