In this post, we will use line feature layers-roads and rail line to design a map project in TileMill.
Download Sample data here- Line features
(attribute data to www.mapsnigeriainitiative.blogspot.com)
Launch TileMill and create a new project.
Click the Layers icon > Add to import the line feature layers that represent the different classes of roads and rail line.
In the Layers window, three classes of roads namely Major, Minor and Secondary roads as well as a rail line were added into the TileMill project- .
A look at the Style.mss window also shows the different default codes assigned to each layer.
Next extra lines of code defining which features should appear at certain zoom levels is added to the style layers. With the understanding that a lot lines can crisscross and intersect each other, turning some off at certain zoom levels will give a neater view to the map user when zooming in and out of the map.
The Style.mss codes for each layer indicates the following:
But on moving the zoom up to 13 (red boxed to the upper left of the screenshot), the railline appears on the map as instructed in the code.
Another important part of working with line features is to label them with proper names like street names etc.
For the demo, the attribute field name is ‘Name’, as seen on the screenshot. The Features window can be opened by clicking the features icon beside the layer in the Layers window.
From the screenshot, one can observe that the labels (red boxed on the map canvas) are well aligned with the line features now.
In this brief tutorial, we have been able to show you how to style your lines into dashed or straight lines, hide and/or show different lines at different zoom levels as well as label the line features.
No comments:
Post a Comment