Author Topic: Theme developing question  (Read 27208 times)

Offline jusc

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1896
  • Thanked: 19 times
    • View Profile
  • Device: Samsung Galaxy S2 and Note 2
Theme developing question
« on: May 11, 2014, 17:12:00 »
Is there any possibility to create a "new line" if there is a ";"  in name field instead of this ";", if you use some "bg-rect" instructions?


Regards J.
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11245
  • Thanked: 276 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: Theme developing question
« Reply #1 on: May 12, 2014, 12:18:50 »
hello Jusc. I'm checking code for a drawing texts in vector map library and this seems to be quite complicated task ...

Half and hour later: oki, let's try it.

Firstly, is ';' best possible separator? Isn't there possibility that this characted will be used also in common text? Isn't for example '|' better? Just think ...

May you also create for me a small map with some texts to test? I don't want bother Peter with it now ...
edit
ah no sorry, back. It's not possible. Whole library is too fixed on handling with one line of text (mainly parts that check overlaps over map tiles etc.), so it's not really simply possible.
« Last Edit: May 12, 2014, 22:21:39 by gynta »
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline jusc

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1896
  • Thanked: 19 times
    • View Profile
  • Device: Samsung Galaxy S2 and Note 2
Re: Theme developing question
« Reply #2 on: May 12, 2014, 22:15:53 »
@menion,
Ok, thank you for answering.
Regards J.
 

Offline Wojtas82

  • More than Newbie
  • *
  • Posts: 92
  • Thanked: 1 times
    • View Profile
  • Device: Xperia S
Re: Theme developing question
« Reply #3 on: July 12, 2014, 14:34:24 »
Hi,
Quick question :) Is it possible to render routes parallel to roads so they are not visible directly on top of road/path etc but next to it? I tried using dy and dx command for lines but it didn't work. Maybe there is a different method? Thanks in advance.
 

Offline john_percy

  • Master of Locus
  • ****
  • Posts: 645
  • Thanked: 91 times
    • View Profile
  • Device: MotoG
Re: Theme developing question
« Reply #4 on: July 12, 2014, 20:12:26 »
Hi,
Quick question :) Is it possible to render routes parallel to roads so they are not visible directly on top of road/path etc but next to it? I tried using dy and dx command for lines but it didn't work. Maybe there is a different method? Thanks in advance.
Other ways; you can render them semi-transparent on top of the road/path, or wider and under the road/path, or as a series of dots on top of the road/path. All of these tricks are used in the available themes.
 

Offline Wojtas82

  • More than Newbie
  • *
  • Posts: 92
  • Thanked: 1 times
    • View Profile
  • Device: Xperia S
Re: Theme developing question
« Reply #5 on: July 12, 2014, 21:09:23 »
Thanks John,I already knew that.I'm still trying to get as best readability of colour coded bike routes in Poland as possible and a method with moving a route a little bit away from road would be a best solution. I'm talking about situation when 3 or more bike routes meet each other. I know a method with "multi" but I would like to try an innovative solution. Here's a small example of what I want to achieve :
http://mapa.ump.waw.pl/ump-www/?zoom=18&lat=54.48904&lon=18.49375&layers=B000000FFTFF
I know transparency is some kind of solution but this looks way better especially when cycling and you don't have enough time to check if you stick to the correct route.Also planning a trip over a certain route would be much easier.
 

Offline john_percy

  • Master of Locus
  • ****
  • Posts: 645
  • Thanked: 91 times
    • View Profile
  • Device: MotoG
Re: Theme developing question
« Reply #6 on: July 17, 2014, 10:23:44 »
I can't access your link (banned site!) but if I understand what you are after, I suggest you try using lineSymbol to add repeating flags along the side of the way, such as are used in some themes for cliff edges. Locus can use scalable svg as well as png, but if you are using Orux you have to use png.
You should be able to arrange a different offset for different colours so they don't overlap, either by including a blank space in the image (png only, I think) or by use of "dx".
Code: [Select]
<lineSymbol src="file:/symbols/redpath.svg" dx="0" repeat="true"  repeat-gap="10dp"  scale="0.4" scale-icon-size="14,1.2" />
« Last Edit: July 17, 2014, 10:25:49 by john_percy »
 

Offline popej

  • More than Newbie
  • *
  • Posts: 39
    • View Profile
    • GMapTool
Re: Theme developing question
« Reply #7 on: July 17, 2014, 14:15:25 »
I can't access your link (banned site!)
I'm afraid something wrong is on your side. UMP is a free social project for creating maps of Poland, mostly for Garmin devices but you can get a map for Locus too ( http://download2.ump.waw.pl/mapsforge/latest-night.zip ). This project is older than OSM and for years was a better source of mapping data of Poland.

Sorry for off-topic, but for me ban for UMP sounds like ban for OSM, I can't imagine any reason for it.
popej
 

Offline john_percy

  • Master of Locus
  • ****
  • Posts: 645
  • Thanked: 91 times
    • View Profile
  • Device: MotoG
Re: Theme developing question
« Reply #8 on: July 17, 2014, 20:26:37 »
[offtopic]waw.pl is blocked on my system. I don't know what else is hosted there.[/offtopic]
 

Offline Wojtas82

  • More than Newbie
  • *
  • Posts: 92
  • Thanked: 1 times
    • View Profile
  • Device: Xperia S
Re: Theme developing question
« Reply #9 on: July 18, 2014, 09:33:19 »
I can't access your link (banned site!) but if I understand what you are after, I suggest you try using lineSymbol to add repeating flags along the side of the way, such as are used in some themes for cliff edges. Locus can use scalable svg as well as png, but if you are using Orux you have to use png.
You should be able to arrange a different offset for different colours so they don't overlap, either by including a blank space in the image (png only, I think) or by use of "dx".
Code: [Select]
<lineSymbol src="file:/symbols/redpath.svg" dx="0" repeat="true"  repeat-gap="10dp"  scale="0.4" scale-icon-size="14,1.2" />


This doesn't work.According to http://docs.locusmap.eu/doku.php?id=manual:map_tools:vector_maps_theme_config#linesymbol

atributte dx and dy is not supported for linesymbol.
So I guess there is no solution at the moment.

UMP map, as Popej said, is 100% safe, I don't know why it is banned in your antivirus.
 

Offline jusc

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1896
  • Thanked: 19 times
    • View Profile
  • Device: Samsung Galaxy S2 and Note 2
Re: Theme developing question
« Reply #10 on: July 18, 2014, 12:55:59 »
I think there is another problem with Mapsforge.
If a way is part of two networks p.e. of RCN and ICN, Mapsforge renders only your last rule and throws away your first rule.

For testing you can use the symbols I have attached.

I doesn´t work as I want. So it´s only a demo.  ;D

Quote
         <rule e="way" k="network" v="lcn">
           <lineSymbol src="file:../symbols/blue_line.png"   align-center="true"  repeat="true"  repeat-gap="0dp" scale="1.1" scale-icon-size="16,1.2" />      
        </rule>
        <rule e="way" k="network" v="rcn">
        <lineSymbol src="file:./symbols/orange_line.png"   align-center="true"  repeat="true"  repeat-gap="0dp" scale="1.1" scale-icon-size="16,1.2" />      
        </rule>
       <rule e="way" k="network" v="Icn">
       <lineSymbol src="file:./symbols/red_line.png"   align-center="true"  repeat="true"  repeat-gap="0dp" scale="1.1" scale-icon-size="16,1.2" />      
        </rule>
please correct the path for your use.
Regards J.
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11245
  • Thanked: 276 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: Theme developing question
« Reply #11 on: July 18, 2014, 13:12:26 »
Ignore me if I'm completely out, because I do not read your complete discussion. Just info - Locus do not render data in exact same way as other apps, because of improvements I already made on MapsForge library. If you anyway find any problem in rendering in Locus, feel free to write me and we will check it with Peter and most probably fix (except known issues with titles).
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline jusc

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1896
  • Thanked: 19 times
    • View Profile
  • Device: Samsung Galaxy S2 and Note 2
Re: Theme developing question
« Reply #12 on: July 18, 2014, 13:50:59 »
@menion,
What I meant:
If a way is part of two different networks you have to define different rules for each network.
So please have a look, if you are able to render p. e. a bigger line for first network and a second smaller line ahead for the second network.
Example : if way belongs to ICN draw "red line with stroke-width= 6" and if way belongs to RCN too draw "yellow line stroke-width=3" over this red line.
I think it´s not possible, because the key is in both cases k="network".


Regards J.
 

Offline voldapet

  • Administrator
  • Padavan of Locus
  • *****
  • Posts: 482
  • Thanked: 10 times
    • View Profile
Re: Theme developing question
« Reply #13 on: July 18, 2014, 15:04:53 »
@jusc

I thing that it works as you want. You can see on the screenshot (internal cyclo theme) which shows way=22758779


This way is member of four different relations. Anyway you can see
the dark red dots are from ICN rel=2775754
the light red dots are from RCN rel=15066

BTW:  there are two rules for LCN in your example
 

Offline jusc

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1896
  • Thanked: 19 times
    • View Profile
  • Device: Samsung Galaxy S2 and Note 2
Re: Theme developing question
« Reply #14 on: July 18, 2014, 17:04:01 »
@jusc

I thing that it works as you want. You can see on the screenshot (internal cyclo theme) which shows way=22758779


This way is member of four different relations. Anyway you can see
the dark red dots are from ICN rel=2775754
the light red dots are from RCN rel=15066

BTW:  there are two rules for LCN in your example

Hi Petr,
thank you for answer, but may you have look at:
http://mapa.ump.waw.pl/ump-www/?zoom=18&lat=54.48904&lon=18.49375&layers=B000000FFTFF

You can load the attached small osm file and see, the way uses two networks but with Poland map and Locus internal theme I only see one network...
« Last Edit: July 18, 2014, 20:05:43 by jusc »
Regards J.