I’m trying to create a label using style directives that will display in my Garmin maps.
I want to display the ref and distance, and possibly some other information, from nodes tagged as highway=milestone. My attempts so far haven’t worked.
What I want to see alongside my custom milemarker icon is the highway’s ref number and the distance tag on that particular milestone. For example, starting wth these tags:
highway=milestone
ref=1268
distance=22
inscription:en=Chiang Mai 22
The icon displays properly. That part is fine. But I cannot get any text to display. Note that there is no “name” tag in the milestone tags. Does that make a difference?
No that doesnt make a difference, mkgmap converts ref and distance as name tags.
Where/how did you test that map, in Mapsource and Basecamp you see for instance the label Chm. 4021 : 33 in blue with a shopping cart with that code you provided
Well now, that’s interesting. I’m using my Montana and Basecamp, both running the newest releases. I have Mapsource but because I’m not installing the map, only creating an IMG and copying it onto my Montana’s SD card, I cannot tell what it looks like in Mapsource. All my other customizations display as they should but those don’t use any special style directives to display tag information. No labels display in Basecamp v 4.4.6
@MH no those quotes should not make any difference @Dave Can you put your img and styles somewhere online so that I check it? Do you use a typ file? It doesnt matter if you use Mapsource or Basecamp, they both display the label fine.
Those quotes actually does make a difference, you should set it as you stated before, name ‘${ref} : ${distance}’
In the typ file I see FontStyle=NoLabel (invisible) so that makes sense too. You have to set it to visible (I use typviewer).
Try
Let me propose another related question. I want to do this but it isn’t critical. It’s more about trying to better understand the style directives. Let’s say that for certain milestones, only those that have distance=0, I want to have a different label, perhaps “Km Zero Milestone : Route 1268”. Other milestones should display the normal way: 1268 : 22 km. Is this sort of conditional styling possible?
I know the style directives must be written or arranged most restrictive first but beyond that, I would have to experiment.
Yes mkgmap can do some conversions to the tags.
Try highway=milestone & distance=0 {set distance=‘Zero Milestone’}
Or highway=milestone & distance=0 {name ‘Km Zero Milestone : ${ref}’}