PDA

View Full Version : Any way to style the text colours on the badges?



peyesdev
24.03.2015, 12:05
:confused: QUERY

Regarding iOS SDK Version 2.4.0

I cannot change the colours of the text on the badges (that show the road numbers) such as the trunk routes which have green badges show up black text but I want it to show white text. I've tried with Style Editor and editing the theme JSON file manually but no luck. Is there a way to do it?

Adela_Silvia
27.03.2015, 18:37
The badges are textures – you can find them in the /MapResources folder of the StyleEditor.
Inside that folder they are separated on “base style” specific DayStyle, NightStyle and Common – if you have a style specify texture that you want to use (e.g. change the highway badge only in grayscale) then put the texture in the specific folder (see /MapResources/GrayscaleStyle/highway_signs.png). If you want to modify the highway badge in all base styles, modify /MapResources/Common/highway_signs.png).

peyesdev
08.04.2015, 16:58
I wondered whether the actual text colour can be changed rather than the badges behind the text. Is that possible?

peyesdev
25.04.2015, 16:23
Any help on this question please?

dandronic
29.06.2015, 13:30
In the style sheet change


"badges" :
[

{
"columns" : 2,
"filename" : "highway_signs.png",
"id" : 59,
"rows" : 8,
"textcolor" : "FFFFFF"
}
],

to


"badges" :
[

{
"columns" : 2,
"filename" : "highway_signs.png",
"id" : 59,
"rows" : 8,
"textcolor" : "FF0000"
}
],

to make the highway badges have red text.
For other badges (different road types), look for the "badge" keyword inside the style sheet and set the "textcolor" property according to your preferences

peyesdev
29.06.2015, 17:09
Hello,

Thanks for your message. The code change you suggested works fine for changing text colour on all badges. However, I want to change the black text only on the green badges to white as it will show better but no matter what I do it doesn't change. The code I'm trying to change is below:



1 "id": "9.7",
2 "line": {
3 "fill": {
4 "width": 1
5 }
6 },
7 "text": {
8 "badge": {
9 "badgeid": 59,
10 "badgetype": "#0#1",
11 "color": "000000",
12 "fontid": [
13 302,
14 302,
15 302,
16 302
17 ],
18 "fontid3d": [
19 302,
20 302,
21 302,
22 302
23 ],
24 "format": "#1",
25 "horizontal": true,
26 "outlinecolor": "ffffffff",
27 "position": "path",
28 "spacing": 400
29 }
30 }


If I change line 11 from "color": "000000" to "color": "FFFFFF" or any other colour does not work. It remains black. Any ideas what to do?

P.S. 302 refers to a font definition with id=302 that I custom included and font appears fine.

Thanks!

dandronic
01.07.2015, 14:19
Changing the color tag should do the trick, but it does not (we confirm this) - we're reaching out the dev team to see what the problem is.