Locus Map - forum

Content & Tools => Themes - Vector maps => Topic started by: Hedaja on January 11, 2014, 01:51:16

Title: internal theme hiking --> cliff
Post by: Hedaja on January 11, 2014, 01:51:16
Hi
I'm using the Elevate theme from openandromaps but i wanted to change the look how cliffs get rendered. I used lineSymbol to insert a custom made png but it only gets displayed with huge gaps along the way.
When i took a look at other themes i saw that the internal hiking theme uses an interesting way to render cliffs. I wanted to take a look inside but I couldn't find it.
Is it possible to get a hint on how you made it?

greetings
Christian
Title: Re: internal theme hiking --> cliff
Post by: voldapet on January 11, 2014, 09:42:03
Hi,
here is used one of improvment of Mapsforge library for Locus. For line symbol you can use attributes: repeat="true"  repeat-gap="0dp"
In internal themes:
<rule e="way" k="natural" v="cliff" zoom-min="14">
    <line stroke="#80CCA78B" stroke-width="0.35" />
    <lineSymbol src="path_to_cliff_png"  dx="0" repeat="true"  repeat-gap="0dp"  scale-icon-size="15,1.2" />
</rule>
Title: Re: internal theme hiking --> cliff
Post by: Hedaja on January 11, 2014, 12:04:34
thank you very much
this is how my modified cliffs look like
(http://s7.postimg.org/3p5shm0lz/SC20140111_115851.jpg) (http://postimg.org/image/3p5shm0lz/)
I still have one problem: Is it possible to render the symbol on the other side of the line?
it isn't 100% satisfying (small white gaps between png's and bigger gaps if there isn't enough space) but I think it is the best you can achieve at the moment.
One more question. I made the width of my png smaller to have less of these big gaps. Could the rendering performance be reduce if I make it too small and there are too many line symbols to be rendered?

Title: Re: internal theme hiking --> cliff
Post by: jusc on January 11, 2014, 14:51:50
Hi,
here is used one of improvment of Mapsforge library for Locus. For line symbol you can use attributes: repeat="true"  repeat-gap="0dp"

You make my day.  :D Thank you, that´s what I looked for.

(http://s23.postimg.org/6dwrmdhhj/image.jpg) (http://postimg.org/image/6dwrmdhhj/)
Title: Re: internal theme hiking --> cliff
Post by: menion on January 11, 2014, 15:11:01
nice ;)
Title: Re: internal theme hiking --> cliff
Post by: voldapet on January 12, 2014, 10:01:43
@Hedaja
You can try to use align-center=true or change the image itself.
White gaps - sorry no way.
Performance - maybe question for menion.  I thing that render uses repeatedly the same image matrix so it shouldn't be problem
Title: Re: internal theme hiking --> cliff
Post by: Hedaja on January 12, 2014, 12:07:21
thanks
unfortunately align-center doesn't work as i hoped. I doubled the height of my icon and started the colour form the middle. But the middle doesn't seem to allways be rendered on the line (small variations in both directions)
I'm going do it the way jusc did it with the traditional cliff icon.
Title: Re: internal theme hiking --> cliff
Post by: jusc on January 12, 2014, 16:48:53
Hi Hedaja,

with my latest themes I´m only working with SVG´s (scalable vector graphics). There are no pngs even in /patterns.
It seems that the symbol (SVG) starts on top while the map is rendered.
To get a view like in my first post (look above) where the triangle peak shows to the sea and not to the middle of the island, I had to create something lke this:
(http://s15.postimg.org/y4pp3njp3/ex1.jpg) (http://postimg.org/image/y4pp3njp3/)

The red arrow shows the start,

btw the mapsforge library improvement ( repeat="true"  repeat-gap="0dp" ) is usefull for the oneway arrows too. The repeat-gap should be a bit increasad of course.

(http://s11.postimg.org/hs8pnddsv/ex2.jpg) (http://postimg.org/image/hs8pnddsv/)
Title: Re: internal theme hiking --> cliff
Post by: menion on January 12, 2014, 20:32:43
another good idea with "one way road". You guys never stop surprise me :)
Title: Re: internal theme hiking --> cliff
Post by: john_percy on January 13, 2014, 11:50:08
Very helpful.
From my experiments with one-way markers, align-center seems to work correctly with svg's, but not on scaled png's. I suspect the offset applied to centre the image doesn't allow for the increased size of the image.
I find using only svg's has an unacceptable performance hit on older phones, like my HTC Desire S, so I'm working on using svg's only when really needed.
Title: Re: internal theme hiking --> cliff
Post by: voldapet on January 13, 2014, 11:57:04
another good idea with "one way road". You guys never stop surprise me :)
If I remember correctly one-way roads were the reason we (you) implemented the "repeat-gap"  :-)