Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am designing my map with tilemill. Now I am struggling with data visualization. I would like to visualize the road name like the 1st image instead of the second image. I have loaded the data source of tilemill from shapefile which contain Road name that field I want to visualize. Can anybody help me on this issue, whether it is possible or not to make the annotation from data?

I like to visualize

But it is showing like this

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I found the Tilemill/Mapbox documentation a little tough to navigate for beginners as well. Having just figured this out, a few clarifications:

a) Start with the mapbox/tilemill guide to styling labels. LINK Note that you call the desired table (layer) with the # (for example #roads). Use the layers button to find which column in the table contains the road names (for example 'ROAD_NAME'). You'll then use that column info to create labels like so:

#roads {
   **text-name: [ROAD_NAME];**     
   text-size: 16;
   text-fill: #fff;
}

b) To get the effect you reference in the first attached image, you'll probably want to align your labels to the road lines (follow the same tutorial link above).

#roads {
   text-name: [ROAD_NAME];     
   text-size: 16;
   text-fill: #fff;
   **text-placement: line;**
}

c) Sometimes you want to get more specific with what you're styling. A common example: road types defined as residential, motorway, highway or bikepath in a column called ROAD_TYPE.

#roads [ROAD_TYPE = "motorway"] {
   text-name: [ROAD_NAME];     
   text-size: 16;
   text-fill: #fff;
   text-placement: line;
}

The style mark-up between the {} will only apply to roads of ROAD_TYPE "motorway".

d) Finally, the tutorial on Advanced Label Placement should help with further issues once you're comfortable with the basics. LINK

Hope it helps!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.