Author Topic: Scaling of svg's in Themes ?  (Read 963 times)

Offline kech61

  • Apprentice of Locus
  • **
  • Posts: 166
  • Thanked: 3 times
    • View Profile
Scaling of svg's in Themes ?
« on: February 02, 2016, 14:08:06 »
Hi,

I'v tried to scale Icons (svg's) with the OAM Elevate Theme.
There is an option at settings > Map - ojects & style > Map icon size
However it does not work with the Elevate Theme

and under settings > Map advanced > Vector Maps there is only an option for Text size

Is there a way to scale svg-icons in Custom Themes?

« Last Edit: February 02, 2016, 14:10:15 by kech61 »
Best regards/ Grüsse
Christian
www.openandromaps.org
 

Offline voldapet

  • Administrator
  • Padavan of Locus
  • *****
  • Posts: 424
  • Thanked: 3 times
    • View Profile
Re: Scaling of svg's in Themes ?
« Reply #1 on: February 02, 2016, 14:36:17 »
Hello Christian,

there is several possibilities how to scale icons:
- parameter scale
<symbol src="file:/symbols/police.svg"  scale="0.6" />

-parameter symbol-width or symbol-height that rescale icon on specific size
<symbol src="file:/symbols/police.svg" symbol-width="10dp"  />

-  parameter scale-icon-size=<start_zoom_level, scale_factor" It's quite usable. It says that specific icon will be rescaled from defined zoom-level in specified scale factor
<symbol src="file:/symbols/police.svg" scale-icon-size="16,1.1"  />

Detailed description of mentioned parameters http://docs.locusmap.eu/doku.php?id=manual:advanced:map_tools:theming
 

Offline kech61

  • Apprentice of Locus
  • **
  • Posts: 166
  • Thanked: 3 times
    • View Profile
Re: Scaling of svg's in Themes ?
« Reply #2 on: February 02, 2016, 16:09:11 »
Hello Petr,

Thanks for detailed answer.
However - I'm sorry that my question was not specific enough.

What I meant: I want to adjust the Icon size according to the screen resolution, so bigger Icons for HighRes and smaller for LowRes-Displays. We already deliver different themes for this and want to reduce this to one theme for all screen resolutions.

And even on displays with same resolution some people prefer bigger, some smaller icons.
So it would be great to have an option to change Icon-Size from within the Locus

« Last Edit: February 02, 2016, 17:27:01 by kech61 »
Best regards/ Grüsse
Christian
www.openandromaps.org
 

Offline jusc

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1881
  • Thanked: 11 times
    • View Profile
  • Device: Samsung Galaxy S2 and Note 2
Re: Scaling of svg's in Themes ?
« Reply #3 on: February 02, 2016, 17:34:03 »
Hello Christian,

I believe, there is no option today. I do this at the moment with a perl script outside of Locus. It replaces all "scale="?.?" to scale="?.? + ?%" or any value you type.
for example scale="0.6"  +10% will be set to scale="0.66" 
Regards J.
 

Offline john_percy

  • Padavan of Locus
  • ***
  • Posts: 391
  • Thanked: 17 times
    • View Profile
  • Device: MotoG
Re: Scaling of svg's in Themes ?
« Reply #4 on: February 03, 2016, 10:16:09 »
A few points to add:
1. Locus offers resolution-independent scaling for symbols in themes already, if one defines the height in "dp" units, for example:
Code: [Select]
symbol-height="14dp" scale-icon-size="16,1.25" This sets the height of the symbol in resolution-independent units, and then scales the symbol by a factor of 1.25 for every zoom level above 16.
The dp notation can also be done for widths of lines etc. I have done this in my Voluntary theme.

2. Overall adjustment of the scaling of the map can be used to adjust for individual preferences, using Settings | Map - advanced | Miscellaneous: Increase map resolution. The obvious drawback of this is that it also increases the width of roads and size of text, although the text size can be fine-tuned in Settings | Map - advanced | Vector maps: Text size. However...

3. Even though the map has been upscaled, Locus does not scale the POI overlay symbols for points from its (beta) database and a standard size symbol overlays a bigger one, which is unnecessarily ugly. Request to menion: please sort this!

4. It would be much easier if there was an option in Map-advanced to set a scale for symbols on vector maps. Orux maps does it. It's not the first time someone has asked about this. Request to menion: please add this feature.

« Last Edit: February 03, 2016, 12:22:10 by john_percy »
 

Offline john_percy

  • Padavan of Locus
  • ***
  • Posts: 391
  • Thanked: 17 times
    • View Profile
  • Device: MotoG
Re: Scaling of svg's in Themes ?
« Reply #5 on: February 07, 2016, 17:34:36 »
Just to say, I now find  I can scale the overlay symbols by scaling map icons etc to 130% in settings (it goes up in 10% increments), but the nearest map resolution scaling I can get is 125% (it goes up in 25% increments). That works well enough for me but it would be nice to be able to get them both exactly the same.