icon_labels.png Labels layers place text at desired locations in a map.    We can add labels to maps for cartographic explication and clarity, or simply to provide technical readouts of attributes for features such as the names of towns or the lengths of road segments.




The illustration above shows two labels layers in a map, one called Regions Labels and the other called Cities Labels.  A variety of formatting tricks have been applied to create a more appealing display.

Creating Labels

Most of the time we would like to create labels for an existing drawing.   Here is how:


Creating labels for an existing drawing


  1. Right-click onto the existing drawing in the Project pane and choose New Labels.

  2. In the New Labels dialog provide the Name desired for the new labels component.

  3. In the Text box, choose the field to use for the text of the label.

  4. Press Create Labels. A new labels component will appear in the project.

  5. To change formatting from defaults, open the new labels component and then use Style to specify desired formatting.


When a label component is created based on an existing drawing it will automatically inherit the projection used by that drawing.   If desired, the New Labels dialog allows us to specify a different coordinate system.

Labels are Defined by a Drawing

Labels components are always based on a drawing, which specifies the position of each label, with a field in the drawing's table providing the text for each label.


The illustration above shows the drawing's table together with a labels layer in a map.   The same geom field that specifies where a point should be drawn in the drawing also specifies where the label for that object should be located.   The text field for the table provides text for labels, such as Montlucon for the selected record.   Selecting a record in the table selects the object for that record in the drawing (if it were open) and also selects the label associated with that record.   Likewise, selecting either the label or the object in the drawing would also select the associated record in the table.


The label component's Drawing property will specify the name of the parent drawing for that labels component.  The label component's FieldText property specifies the name of the field within that parent drawing's table to use for each label's text.    When we create a new labels component Manifold automatically rigs up that infrastructure so the label component's properties point to the desired drawing and field.   It is still nice to know how that works so if we want to use a different text field or a different drawing, we can just change that in the Properties for the labels component if we desire.


Each label that appears in labels layer is derived from one object in the drawing, that is, one record in the drawing's table.    The geom field in that record specifies the location of the label, and, if the geom defines a line or an area object, can by implication specify the orientation of the label as well.    If we edit a drawing to move an object, the label created from that object will also move.


The text that appears in the label will automatically be taken from the specified text field in the drawing's table.   If we edit the text contents of that field, the text that appears in labels will also automatically change.  



In the diagram above we see the Cities Labels component with an orange arrow indicating the Properties dialog for Cities Labels.   We can see that Cities Labels is based on the Cities drawing and that it takes its text from the City field.    The Cities drawing contains point objects.   Each label appears at the location of a point in the Cities drawing, for example, the label for the city of Avord appears at the location of the point for that label.   The text for that label comes from the City field in the drawing's table, which is called Cities Table.  



We can create a map that has the Cities drawing as a layer and Cities Labels as a layer.    That makes it easy to see how each label in Cities Labels appears at the location of the corresponding point in the Cities drawing.   


The location of the points in the Cities drawing automatically specifies the location of the associated label.   If we move a point in the Cities drawing the associated label in Cities Labels will also move.

il_labels_cycle01_01.png    il_labels_cycle01_02.png

For example, if using the techniques in Editing Drawings we move the point for the city of Avord in the Cities drawing, the associated label in Cities Labels will also move.  If we have both the drawing and the labels component open in their own windows at the same time, when we move either the point object or the label the corresponding label or point will also move.


In the map we can see how moving the point will move the label as well.




Likewise, changing the text in the City field in the Cities Table will automatically change the text used in the label.     Suppose we change Avord to Harry as seen above (just before we press Ctrl-Enter to commit the edit).


il_labels_cycle01_05.png  il_labels_cycle01_06.png


The text used in the labels will also change, automatically being updated in the Cities Labels window as well as in the map window where Cities Labels is a layer.


Labels from Lines

The illustrations above show labels that are based on points.   Labels can also be based on lines or areas.  




We can add a line to the Cities drawing, as seen above.




In the table we add the text value Loire to the record that was automatically created when we added a line.   We know, of course, that the Loire is a river, not a city, but for the sake of this example we will add it to the Cities table anyway.



il_labels_cycle01_09.png    il_labels_cycle01_10.png


As soon as we enter a non-NULL text value for the City field for that object, Manifold automatically creates a label using that text.  It automatically appears as a label in Cities Labels and also in the Cities Labels layer in the map.     Manifold will automatically align to their parent line labels that are based on lines.


In most cases when we work with labels we will create labels from a drawing because we want to label objects in that drawing, such as cities.   Sometimes we might also want to create a labels component to manually enter labels at locations we choose.    Knowing how labels are based on drawings is useful even if we use just the labels and we do not include the drawing on which they are based in our maps.   That knowledge is useful because if we know how labels are based on objects in drawings, we can achieve finer control over the placement of labels by moving about the objects on which labels are based.


The following example shows the process to create the Cities Labels layer used above with step by step illustrations.   In real life the procedure is so quick and easy an experienced Manifold user could do it in seconds, with just a few mouse clicks.


We start with a project that has a drawing called Cities which displays data from a table called Cities Table.   The drawing shows a selection of towns and cities in France.




Opening the map we see that the Cities drawing, the only layer in the map, shows points.   We have used Style to apply a yellow fill color.  The diamond shape used for the Point style is simply the square box point style with a Point rotation of 45 applied.



For less clutter in this example, we zoom into the map to show fewer points.




Opening the Cities table we see that each point represents a city in France, with the name of the city given by the City field.  A Geom field provides the geometry data to locate each point.


Creating Labels



In the Project pane, right click onto the Cities drawing and choose New Labels.




The New Labels dialog launches with the Cities drawing automatically loaded into the Based on box and a suggested default name of Cities Labels, which we will use.  The Text box is loaded with a pull-down menu of all fields in the drawing that contain data types from which labels can be constructed.  




We choose the City field, since that gives the name of each city.



Press the Create Labels button to create a new labels component.     Like many Manifold dialogs, there is also an Edit Query button which we could have used to command the system to automatically write the SQL that would be used to create that labels component and then open it in a Command Window.    That is a useful way of learning how to use SQL.



When we click the Create Labels button a new labels component appears in the Project pane.




We drag and drop the Cities Labels component into the map.   Labels appear using the default format.  With labels displayed we can see we have zoomed into the heart of France's famous valley of the Loire, home to numerous chateaux and Loire valley vineyards.   


Two of the Cities points, one for the city of Orleans just to the southeast of Chateaudun, and the second for the town of Bourges just to the west of Avord, do not have labels.  Why not?   The labeling engine for Manifold by default has clipped those labels, that is, has hidden them, to prevent them from being too close or overlapping adjacent labels.  




If we zoom into the region near Avord so there is more distance between labels we see that the label for Bourges automatically appears.




Clicking off the Cities layer allows us to better see the default text used.   For examples of different formatting that can be used to style labels, see the Style: Labels topic.

Offset Labels

The illustrations above show a limitation of current editions of Release 9, a limitation that will soon be eliminated: Labels appear directly on top of points without the ability to offset offsets automatically from their parent point.  Upcoming editions will allow specification of offsets so labels do not appear directly on top of their parent points.    Until that new feature arrives, we can use a manual process to generate offset labels.


Exploring the manual process is not a waste of time, because it teaches useful notions about copy and paste, the Transform panel, how it is easy to move objects about, and how we can use combinations of labels and objects in different layers to get a greater variety of visual effects.  


We will create offset labels by first making a copy of the Cities points layer, moving that layer a bit, creating labels from the moved layer, and then displaying those labels created from the moved layer together with the original Cities points layer.   Because the city points in the moved layer will be slightly offset from the original city points, the labels created from those moved points will also be slightly offset from the original city points, which is the effect we want.

Create a Copy of the Cities Layer


Ctrl-click the Cities drawing and the Cities Table table to highlight both.



Click the Copy button to copy them to the clipboard.   We could also do a Ctrl-C to copy using the usual Windows keyboard shortcut.




Next we click Paste to paste.  We could also have done a Ctrl-V to paste using the usual Windows keyboard shortcut.




The result is that a copies of the drawing and the drawing's table appear in the Project pane, using default naming.




We drag and drop the Cities 2 drawing into the map.  Until we change the color of the points, the drawing appears exactly as the Cities drawing using yellow diamond symbols.   We use Style to change the color to green: this step is not illustrated with only the results shown above.   Although both layers are turned on for display, we see only the green pints in the Cities 2 layer because they precisely overlap and cover the yellow Cities points in the layer below.



Clicking the Cities 2 layer tab to make sure it is the active layer, we click on the Contents pane tab and then in the Contents pane we choose the Transform panel.   The panel automatically targets the Geom field of the drawing.   We choose the Shift transform that is documented in the Transform Templates - Drawings topic, and then we enter values in the Shift X and Shift Y boxes to move the points in the Cities 2 drawing by those amounts in the X and Y directions.   


Since the coordinate system used by the drawing is the pseudo-Mercator default, the numeric values of 8000 and 12000 are in meters.  We are shifting the points in Cities 2 drawing by 8 km to the right (East) and 12 km up (North).




As soon as we change the values in the Transform panel, the panel shows the shifted positions of the points in blue preview color.    We tinker with the values, looking at the preview, until the offset is what we would like.   We then press Update Field to apply the changes.




We see that the points in the Cities 2 drawing have been shifted from their original positions.  Now, we will create labels from the Cities 2 points.




Right-click the Cities 2 drawing and choose New Labels.




In the New Labels dialog we choose City as the source field for label text and then we choose Create Labels.




We drag and drop the new Cities Labels 2 labels component into the map.  We then double-click off the Cities 2 layer to get the display above.  The labels are offset because they are being created using the offset Cities 2  labels.     That's great, but we still have a problem with the labels for Bourges and Avord colliding, as well as a problem with the Orleans label colliding with Chateaudun.   That is easy to fix.


We will move those two points in the Cities 2 points layer to locations further from the points with which their labels collide, so the labels created from them will also move.    There are two ways to move those points: we can alt-click on a point, choose the Coordinates tab to enable editing and then simply click and drag the point to a new location as discussed in the Editing Drawings topic.  Or, we can select the points and then use the Transform panel to move both at once using the Shift template.    We will use the Transform panel.




We click off the Cities Labels 2 layer to reduce clutter.  Next, we click on the Cities 2 layer to make it the active layer, and then we Ctrl-click on the Cities 2 points for Avord and Orleans to select those points.  The selected points are shown in red selection color.




Once again we choose the Shift template in the Transform panel, but this time we check the Restrict to selection box so that the dialog operates only on selected objects.   We enter -5000 into the Shift X box, to shift the point 5 km to the left (West) and we enter -25000 to shift the point 25 km down (South).




As before, the Transform panel instantly previews the results of the Shift template within the map in blue preview color, but this time since we have checked the Restrict to selection box only the points for Avord and Orleans will move in the preview.   We press the Update Field button to apply the previewed changes.




The result is that the selected points have been moved down and slightly to the left.   This will move the associated label away from an overlap conflict.




If we click off the Cities 2 layer and click on the Cities Labels 2 layer we can see the Avord and Orleans labels have moved away from positions where they conflicts with adjacent labels.


The method shown above has two obvious disadvantages:



Despite those disadvantages it is nonetheless a useful technique when using labels in a casual way within Manifold for illustrations.   


Additional Improvements

We can create a more appealing display by using the Style dialog to change the font and style of the labels as well as the points in the Cities layer, and we can use Contents - Layers to alter the color of the background from a too-glaring white to a calmer beige.     Given time and a willingness to experiment with Style we can use various formatting tricks to create a variety of appealing effects.  Not bad for a database tool.


Adding New Labels Individually

Creating labels as shown above in this topic automatically creates labels all at once for an entire drawing, automatically taking the text for the label from some designated field.   That is tremendously convenient, of course, but sometimes we would like to create labels individually, clicking at a spot in the map where we would like a label and entering the text for that label.


Creating any labels layer means using a drawing somewhere.   The position of a label is taken from an object in a drawing, such as a point, and the text of the label is taken from a field for that object in the drawing's table.   If we want to create labels at a few designated locations in a map, one way or another we will end up creating a drawing with objects where we want the labels to be and a labels component that automatically shows labels for those objects.


Creating a new labels layer with a drawing to serve it is such a frequent task that Manifold can do that automatically for us.  We create a new Labels component and choose <new drawing> in the New Labels dialog, and Manifold will automatically create a drawing with a text field in that drawing's table to use for the label's text.    The New Labels dialog thus creates three new components for us in the project: the drawing's table, the drawing, and a labels component that automatically takes the position and content of labels from the drawing and the drawing's table.     


All three components start out blank, with no records, objects or labels in them.  If we add an object to the drawing a label for that will be created automatically.  Manifold also allows us to add a label to the labels component and have an object created for that label automatically as well.


We can create labels individually in a casual way wherever we like using two different styles of workflow: by adding objects to the drawing at the desired positions and letting the labels layer automatically create labels for them, or by using the labels layer as the interface and having the system automatically create an object in the drawing at spots where we place a label.  The two different styles are just a matter of workflow to the same end,  whether we want to mark locations for labels using a drawing layer or whether we want to do so using a labels layer.




In both of the above two workflow styles we end up creating objects in a drawing from which labels are created.   Which of the two workflows we prefer depends on our taste and the specifics of our task.  For example, if we want to create individual labels at locations closely tied to existing objects we might prefer using the drawing as an interface.  If we casually create labels based purely on visual appearance we might prefer to use the labels layer as the interface.   Both ways work and the workflow from both ways can be mingled as one way or the other is more convenient.

Creating New Labels Components

We can create a new labels component using a new, blank drawing as follows:


We begin by right-clicking into a blank location in the Project pane and choosing New Labels.




Since we did not right-click onto an existing drawing, the New Labels dialog opens with a default name for a labels component to be Based on a <new drawing>.    We choose an existing drawing in the pull-down menu if we wanted, but we will keep the <new drawing> choice.   By default, the dialog will also create a new table for the new drawing with an nvarchar field (Unicode, variable length text field) called Text for the text to use in the labels.   We can change the coordinate system from the default if we like.  We will leave it as is.



We change the Name of the new labels component to be Notes and then we press the Create Labels button.



Three new components appear in the Project pane: a Notes Drawing, the drawing's table called Notes Table, and a Notes labels component.



Clicking open the table we see it is empty.




Dragging and dropping the Notes Drawing and the Notes labels layers into the map, we see those (of course) are empty as well.  


We now have the infrastructure we want to add labels individually wherever we want in the map.   We will show the step-by-step procedure for both approaches, either using a drawing layer as the interface or using a labels layer as the interface.

Adding Individual Labels using a Drawing Layer as the Interface

We click on the Notes Drawing tab to make it the active layer.  In the main toolbar we click the Create Point tool and then click on a location in the map, approximately between Le Mans and Tours,  to create a point where we want a label to appear.



A small blue square appears at the clicked location.  The blue preview color of the square indicates this is where the proposed point will go.


When we click to add a new point to a drawing using the Create Point tool the Contents pane automatically switches to the Record panel.  In the Values tab, we enter the text we want for the new label, "Beauce," the traditional name of that natural region in France, famous for agriculture, in the triangle between Le Mans, Tours and Orleans.   We press the Add Record button to create the point at that location with the attributes specified in the Values tab.




A point appears in the Notes Drawing at the location previewed, and a new label corresponding to that new point also appears, using the specified text,  in the Notes labels layer.   Using Style we have styled the label to use an all caps font, brown color and larger, 16 point, font size.




We add another label by adding another point to the controlling drawing.  With the Notes Drawing layer tab to make it the active layer and still using the Create Point tool,  we click into the Notes Drawing layer to add another point, to the west of Tours.   The proposed new point appears as a small square icon using blue preview color.




In the Record panel's Value tab, we add the text Loire to the Text cell for that point.  The Loire region is the valley of the Loire, famous for chateaux and fine wine.   We press the Add Record button to create the point.  




As we do, automatically the new point appears in the Notes Drawing layer, and a corresponding new label appears in the Notes labels layer.




We can click off the Notes Drawing layer to clean up the display.   We have added labels to our map showing the names of natural regions as locals might use.  



Opening the Notes Table, we can see we have added two records to the table, one for each point.  The records contain the geom value that specifies where the point is located, and the value of the text.      


In the workflow above we specified the text for each new label by entering the text into the Record - Values tab as we created the point.   We could have done it slightly differently, by first creating the points and then quickly entering the text into the table.    Manifold is happy to leave the table window open, and Manifold will dynamically update all windows as we change text in the table.  


A very quick way of creating several labels at different locations is to rapidly click, click, click to create those points and then to rapidly edit the text values in the table.   Using fast techniques shown in the Editing Tables topic we can edit one Text cell in a table, press the down arrow key to move to the next one down, edit that and so on very rapidly.  Manifold automatically updates the labels for us.


The above process is slightly different than that used in various GIS packages but it is just as easy.   Many GIS packages will allow adding a label at a clicked location and will pop open a dialog allowing the text for that label to be entered.   In the above case we clicked a point location and used the already-open Record panel to enter the desired text for the label.


Adding Individual Labels using a Labels Layer as the Interface

If we prefer to add individual labels using a process more similar to classic GIS, where we just add labels to a labels layer, we can do that in Manifold as well.    We will take the process from the very beginning, creating a new labels layer.




Right-click into an empty portion of the Project pane and choose New Labels.   Give the new layer a name of Wines and confirm it is based on a <new drawing>.  Press Create Labels.




A new ensemble of a table, a drawing and a labels component appears in the project.  




We drag and drop the Wines labels component into the map, as the uppermost layer.  To clean up the display we have right-clicked onto tabs for unused layers and have deleted them from the map.




With the focus on the Wines labels layer in the map, we click on the Style panel in the Contents pane.    We would like the labels we create to be visually different from other labels, so we take a moment to set the main color to a dark red color, we change the font to an italic, all-caps font, and we set the font size to 12 points.




With the focus still on the Wines labels layer in the map, we click on the Create Point tool in the main toolbar.




Back in the map, in the Wines layer we click a spot just to the east of Tours to mark the location where we would like to create a new label.   A blue preview color square appears to show the point location that will be used as the anchor point for the new label.





The Record panel automatically opens in the Contents pane.   In the Style tab for the Record panel, we enter the text desired for the label.   We enter Vouvray, the name of a fine, white wine created near Tours.     The Style tab for the Record panel shows the style settings inherited from the Style panel settings we specified for the entire Wines layer.  We press Add Record to create the label.




A new label appears in the map at the location we clicked with the Create Point tool, using the Style properties such as color and font specified.   


What is going on behind the scenes is that we created a point in the associated drawing, and the label that has just appeared takes its geometry and text information from that point.   As a matter of convenient workflow, Manifold allows us to use the labels layer as the interface, with Manifold behind the scenes automatically creating the point object for the label in the drawing.



Since the Create Point tool is active until we click back onto the default cursor tool, we can click on another location where we would like to place a label.  We click at a location slightly to the northwest of the Loire label.




In the Record panel's Style tab we enter Chinon, the name of another fine, Loire valley wine.   We press Add Record to create the label.




A new label appears for Chinon, a superb red wine not well known outside of France.  Bordeaux and Burgundy are famous in export markets, but locals will often choose Chinon for the outstanding price/performance it offers.  




We can continue on in this way, adding more labels as desired and adding some background map layers from web servers, like the Google Terrain view used in the illustration above.   We might want to turn on per-record formatting, so each of the new labels could be individually styled to use a different color.  We could then use red color for red wines like Chinon and a lighter color for white wines like Vouvray and (usually) Cheverny.



Create points, lines or areas to make labels?   - In the workflow shown above to add a label to a labels component we used the Create Point tool.  Why are there also Create Line and Create Area tools in the toolbar for a labels layer?   That is to allow us to create labels that are based on lines or areas.   See the visual demonstration of how that works in the Manifold 9 - New Labels Features in 9 video in the Gallery page on the Manifold website.


Labels for areas - Some illustrations show labels within an area, but by default the labels are created at the location of some coordinate point that defines an area, such as on the border.   How can labels be created in the center of an area?  Easy.   First, take a few seconds to use the Transform dialog to create a centroids drawing for the areas and then create labels using the centroids drawing.  By default the centroids will inherit text fields from the areas.  We can then use the labels in a map without also needing to include a centroids layer.   That is how the Regions Labels layer in the accompanying illustrations was created.   As labels features steadily expand within 9 to add the ability to automatically use centroids as anchor points for area labels, that technique will no longer be necessary.  But it is good to know as a way of learning how to manipulate labels and the objects from which labels are derived.








Unicode is OK - Manifold can handle Unicode within labels, as seen above and as illustrated in the Example: Format the Size of City Points by Population topic.  (The Chinese characters used in the illustration above are placeholders, the names of various Manifold web sites in Chinese, and are not translations of the city names from French into Chinese.)




il_mur_des_beaunes.pngRomorantin, Cour-Cheverny and François - By happenstance our choice of zoomed views in the example centers on the town of Romorantin, also seen in the view above with background terrain layer and river layers added, the home of Romorantin grapes used in Cour-Cheverny wine.   


The great king François I,  good friend, patron and protector of Leonardo da Vinci in his old age, planted the first large vineyard of Romorantin in 1517 near his mother's chateau at Romorantin.   The stone wall bordering the original vineyard planted by François I still stands, seen in a French government survey photo from the 1930's at right.   


Cour-Cheverny is the fabulous white wine produced of 100% Romorantin grapes, by local mythology all said to be descendents of the vines of François I, and harvested exclusively from the region around Romorantin.   Whatever the true origin of the Romorantin vines, they produce an outstanding, dry white wine that is rarely exported, it is so valued by locals.


The neighboring town of Cheverny, also known for a famous chateau still owned by the same family as it has been for six centuries, is home to a related, crisp white wine made primarily of Sauvignon Blanc, along with Chardonnay, Menu PIneau and Chenin Blanc.


François considered building a new chateau at Romorantin to plans drawn up by Leonardo but instead built the largest chateau of all, seen below, at Chambord not far away.  Leonardo designed the immense double-helix stone staircase at the center of the chateau.    Leonardo is buried at the royal fortress of Amboise, almost exactly in the center of the map above just to the East of Tours.




Poitiers and Tours - Also in the example drawing of Cities we see both Poitiers and Tours, somewhere between which on 10 October 732 was fought the famous battle between allied Frankish and Burgundian forces led by Charles Martel against the Umayyad Caliphate army led by Abdul Rahman Al Ghafiqi, the great governor and general of the Caliphate's Andalusian territory.  Al Ghafiqi was killed in the battle while in person rallying his men against the onslaught of Frankish infantry.  


Significantly outnumbered by the Muslim army, Martel had chosen the site of the battle well, seeking to use terrain and trees to weaken the advantage of Al Ghafiqi's calvary against Martel's exclusively infantry forces.  For seven days the armies skirmished until on the seventh day Muslim heavy cavalry charged the Franks, launching a brutal, day-long battle.   Martel's seasoned infantry fought off charge after charge, keeping their nerve in a defensive square before counter-attacking on foot to kill Al Ghafiqi, winning a decisive victory.


Already in control of much of the Iberian peninsula and Southern France, the advance by Al Ghafiqi so far into central France marked the greatest advance of Muslim armies into Western Europe.   The victory by Charles earned him his nickname of "Martellus," Latin for "The Hammer," cemented the power of the Franks and led to the development of Western Europe over the next twelve centuries as a primarily Christian culture.


Six centuries after Martel, Edward, the Black Prince, of England on 19 September 1356 won a stunning victory at Poitiers against King John II of France, capturing the king, his son and many French nobles.  Poitiers was the second of three epic English victories in the Hundred Years' War, coming ten years after the battle of Crécy and almost 60 years before Agincourt in 1415.


Who knew there was so much history in one small illustration?


Manifold 9 - New Labels Features in 9 - Take a look at new Labels features in Release 9 that can be used in the latest, free Manifold Viewer Edge as well. With two clicks we add labels to a map where each label automatically takes its text from fields in a drawing layer. Next we use a single click to create a labels layer that allows us to interactively add a label wherever we want, as a point label or along a line we draw. We see how to turn on per-label formatting so each label can be styled differently.

See Also

Getting Started


User Interface Basics






Layer Opacity




Style: Drawings


Style: Labels


Contents Pane


Contents - Layers


Example: Format the Size of City Points by Population - A common GIS task is to format the size of points in a drawing based on some value.  For example, the size of points that represent cities might be formatted based on the value of the city's population, with cities that have larger populations being marked by larger point icons.  This is an example of thematic formatting and is easy to do using the Style panel.


Example: Formatting Tricks - The visualization capabilities of Manifold using Style can be exploited to provide endless visual effects.   This topic provides some examples of how to use Style in unexpected ways to create a range of more elaborate effects.


Example: Style Overrides - Working with style overrides to individually style areas, to use or not use style overrides, to find all records using style overrides and to clear style overrides.