Author Topic: @Menion, Captions seems to render leftbound now in mapsforge  (Read 6229 times)

Offline kech61

  • Apprentice of Locus
  • **
  • Posts: 169
  • Thanked: 4 times
    • View Profile
Hi Menion,

I noticed that caption are rendering left bound (at least since a couple of weeks) - in standard Mapsforge these captions render centered.
While this is usually no big issue it affects the cycle nodes which consits of a circle with the number of the node rendered into it.

This looks not very pleasing in Locus.
Is this a bug, or in other words if you changed the renderer - is there an option for the theme to render those cycle nodes as it was in earlier versions of Locus?
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Best regards/ Grüsse
Christian
www.openandromaps.org
 

Offline jusc

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1895
  • Thanked: 20 times
    • View Profile
  • Device: Samsung Galaxy S2 and Note 2
Re: @Menion, Captions seems to render leftbound now in mapsf
« Reply #1 on: August 24, 2013, 13:48:42 »
Thanks for this hint. Some locus versions ago was the "dx" parameter added. So you should add it to your render theme.
(I have to update my themes too  :D )


Code: [Select]
   <!-- Cycle nodes for NL/BE EXPERIMENTAL -->      
    <rule e="node" k="cycle_node" v="NLBE">    
        <rule e="node" k="cycle_node" v="*" zoom-min="12" zoom-max="14">    
            <rule e="node" k="cycle_node" v="*">
                <circle r="12" fill="#ffffff" stroke="#48D1FF" stroke-width="2.0" />
                <caption k="name" dx="-8" dy="5" font-style="bold" font-size="15" fill="#0026FF" stroke="#ffffff" stroke-width="2.0" />
            </rule>
        </rule>
        <rule e="node" k="cycle_node" v="*" zoom-min="15" zoom-max="17">    
            <rule e="node" k="cycle_node" v="*">
                <circle r="17" fill="#ffffff" stroke="#48D1FF" stroke-width="3.0" />
                <caption k="name" dx="-12" dy="8" font-style="bold" font-size="21" fill="#0026FF" stroke="#ffffff" stroke-width="2.0" />
            </rule>
        </rule>
        <rule e="node" k="cycle_node" v="*" zoom-min="18" zoom-max="20">    
            <rule e="node" k="cycle_node" v="*">
                <circle r="22" fill="#ffffff" stroke="#48D1FF" stroke-width="3.0" />
                <caption k="name" dx="-16" dy="11" font-style="bold" font-size="28" fill="#0026FF" stroke="#ffffff" stroke-width="2.0" />
            </rule>
        </rule>
    </rule>
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Regards J.
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11792
  • Thanked: 417 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: @Menion, Captions seems to render leftbound now in mapsf
« Reply #2 on: August 24, 2013, 15:34:52 »
hi guys, are you sure it was centered by default before?

I'm checking current mapsforge code for captions
http://code.google.com/p/mapsforge/sour ... me=rewrite
- you may see there Align.LEFT

in my updated code is also set Align.LEFT

in almost year old code for mapsforge v3.0 you may on lines around 100 see also Align.LEFT
http://code.google.com/p/mapsforge/sour ... name=0.3.0

your labels are as captions in your renderTheme?
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline kech61

  • Apprentice of Locus
  • **
  • Posts: 169
  • Thanked: 4 times
    • View Profile
Re: @Menion, Captions seems to render leftbound now in mapsf
« Reply #3 on: August 24, 2013, 15:40:58 »
Quote from: "jusc"
Thanks for this hint. Some locus versions ago was the "dx" parameter added. So you should add it to your render theme.
(I have to update my themes too  :D )


Hi Jusc,

Thanks a million for quick solution, just right for the update of openandromaps this evening.
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Best regards/ Grüsse
Christian
www.openandromaps.org
 

Offline tommi

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1232
  • Thanked: 2 times
  • Devices: Samsung S7 + S5 + S3 + Nexus7 flo
    • View Profile
Re: @Menion, Captions seems to render leftbound now in mapsf
« Reply #4 on: August 24, 2013, 15:48:54 »
Hi jusc or Menion,
what does dx="-16" mean? Shift the output by 16 pixels to the left?
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline kech61

  • Apprentice of Locus
  • **
  • Posts: 169
  • Thanked: 4 times
    • View Profile
Re: @Menion, Captions seems to render leftbound now in mapsf
« Reply #5 on: August 24, 2013, 15:56:01 »
Quote from: "menion"
hi guys, are you sure it was centered by default before?

Absolutely, in Apps with standard 0.3.0 implementation the captions render centered.

Quote
your labels are as captions in your renderTheme?

Only the labes of cycle + hiking nodes (these are nodes in osm) - is there a better solution for this in the modified code of Locus?
EDIT: Cycle Nodes are a special kind of cycle navigation/guiding in the Netherlands and Belgium, the best in the world.

I'v provided samples of Locus and standard:
You see that the captions of peaks in locus are leftbound (it was centered a few versions bevore), standard 0.3.0 is centered.
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Best regards/ Grüsse
Christian
www.openandromaps.org
 

Offline jusc

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1895
  • Thanked: 20 times
    • View Profile
  • Device: Samsung Galaxy S2 and Note 2
Re: AW: @Menion, Captions seems to render leftbound now in m
« Reply #6 on: August 24, 2013, 20:36:43 »
Quote from: "tommi"
Hi jusc or Menion,
what does dx="-16" mean? Shift the output by 16 pixels to the left?
I'm not sure, if it are pixels, but indeed with dx="" and dy="" you can move such things as description or caption around the original position of a poi.
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Regards J.
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11792
  • Thanked: 417 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: @Menion, Captions seems to render leftbound now in mapsf
« Reply #7 on: August 25, 2013, 18:55:22 »
hmm maybe I found a problem. I was working on a labeling system (not much success) and fixed there some issues. And this was maybe one of them. In mapsforge is set labeling to Align.LEFT but in the end, all labels was center. I probably fixed this by accident, so this started to work correctly :)

Anyway, hope you do not work on updating of themes a lot. if there is such a problem, it's always better to fix it on my side then on yours. In next version (also a test version), this should be fixed so let me know if there will be any more problems (or needs for additional improvements)

and yes, dx and dy values are currently in pixels. There is anyway possibility (if anyone interested) to use also DPI units (units that scale with devices resolution) for lines. "stroke-width" and "border-width" parameters now may contain pixels, or "10dp" (dots per inch). Value 10 means, 10 mixels on MDPI devices, 2.0 x 10 = 20.0 pixels on XHDPI devices, like Note 2 etc ... I should write more if will be anyone interested or add support for DPI for mode values in styles. It's quite essential for new huge devices with 1920x1xxx resolution
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline kech61

  • Apprentice of Locus
  • **
  • Posts: 169
  • Thanked: 4 times
    • View Profile
Re: @Menion, Captions seems to render leftbound now in mapsf
« Reply #8 on: August 25, 2013, 20:08:22 »
Quote from: "menion"
...In mapsforge is set labeling to Align.LEFT but in the end, all labels was center. I probably fixed this by accident, so this started to work correctly :) ....

 :mrgreen:  :mrgreen:  :mrgreen:

Thanks for information!
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Best regards/ Grüsse
Christian
www.openandromaps.org
 

Offline jusc

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1895
  • Thanked: 20 times
    • View Profile
  • Device: Samsung Galaxy S2 and Note 2
Re: @Menion, Captions seems to render leftbound now in mapsforge
« Reply #9 on: August 27, 2013, 12:45:54 »
@kech61
you can the dx parameter remove again from your themes. With new test version there is no longer need for it.
Regards J.
 

Offline john_percy

  • Master of Locus
  • ****
  • Posts: 807
  • Thanked: 121 times
    • View Profile
  • Device: MotoG
Re: @Menion, Captions seems to render leftbound now in mapsforge
« Reply #10 on: August 27, 2013, 18:11:59 »
Which items of text are now centred?
 

Offline jusc

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1895
  • Thanked: 20 times
    • View Profile
  • Device: Samsung Galaxy S2 and Note 2
Re: @Menion, Captions seems to render leftbound now in mapsforge
« Reply #11 on: August 27, 2013, 20:10:32 »
It's only in the Netherlands map of OpenAndroMaps with a cycling theme. The refs within the blue circles are a bit moved to the right. It's already fixed in test version. There is nothing to do but to wait for next Locus update. :))

Regards J.
 

Offline kech61

  • Apprentice of Locus
  • **
  • Posts: 169
  • Thanked: 4 times
    • View Profile
Re: @Menion, Captions seems to render leftbound now in mapsforge
« Reply #12 on: August 27, 2013, 20:14:52 »
@kech61
you can the dx parameter remove again from your themes. With new test version there is no longer need for it.

Thanks, done
+ added mountain_pass

Best regards
Christian
www.openandromaps.org
Best regards/ Grüsse
Christian
www.openandromaps.org
 

Offline jusc

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1895
  • Thanked: 20 times
    • View Profile
  • Device: Samsung Galaxy S2 and Note 2
Re: @Menion, Captions seems to render leftbound now in mapsforge
« Reply #13 on: August 27, 2013, 21:05:13 »
@kech61,

What is a mountain pass? Example?
Thanks in advance.
Regards J.
 

Offline kech61

  • Apprentice of Locus
  • **
  • Posts: 169
  • Thanked: 4 times
    • View Profile
Re: @Menion, Captions seems to render leftbound now in mapsforge
« Reply #14 on: August 28, 2013, 13:02:39 »
What is a mountain pass? Example?
Thanks in advance.

Passhöhe, Sattel tagged as node for roads and paths too.
http://www.openstreetmap.org/#map=15/47.6250/14.3146
However its not rendered in Mapnik.
Best regards/ Grüsse
Christian
www.openandromaps.org