Synchronized Labels

When creating bound labels we get a choice in the Create - Labels dialog to Automatically label new drawing objects or not. If this option is checked (the default) the labels component will be synchronized to the parent drawing.


When labels are synchronized to their parent drawing, if any new objects are created in the parent drawing then new labels will automatically be created for those new objects. If any objects are deleted from the parent drawing then their associated labels will also be deleted from the parent drawing. When labels are synchronized to the parent drawing we cannot delete any labels manually since their appearance in the labels component is based exclusively upon whether or not their associated object in the parent drawing exists.


When labels are not synchronized to their parent drawing, we may freely delete or (based upon objects) add labels to the labels component. We can select a subset of labels and then copy them to a new labels component (which will also be an unsynchronized bound labels component). We can add objects to the parent drawing without adding any labels, but if we delete any objects from the drawing their labels will also be deleted. That is because even an unsynchronized label is still a bound label and derives its existence from the associated object in the parent drawing. We can choose whether or not the label is shown but as long as it is bound to a parent object we cannot have the label exist on its own without the parent object that defines it.


Because labels in a bound drawing are always derived from the parent drawing in any event, choosing synchronization on or off is really a choice of how labels are created and whether or not they are deleted. It is not a choice as to the content of labels or their position.




Let's begin with the sample Mexico drawing used throughout this documentation. This drawing has a Place_name field we can use to automatically create bound labels.




Using the Create Labels dialog we create labels from the Mexico drawing using the Place_name field. We use the default setting (checked) for the Automatically label new drawing objects option. We will call this new labels component by the default name, Labels.




We use the default setting (checked) for the Automatically label new drawing objects option. The resulting labels component will therefore be synchronized to the parent drawing.




A new labels component appears in the project pane, indented below its parent drawing because it is bound to that drawing.




We can add the resulting labels component to a map that also contains the Mexico drawing. In the above illustration the labels have been formatted so they are slightly larger than default and also so they use a style with a "drop shadow" of white background color.




With the labels component layer tab clicked in the map so that the labels layer is the active layer, we can click on the Labels menu to see that this labels component is Synchronized. It is synchronized because the labels component was created with the Automatically label new drawing objects option checked on.


If we desired, we could un-check the Synchronized setting in the Labels menu to turn off synchronization for this component. For now, we will leave it synchronized so we can see how a synchronized labels component behaves.




The first thing we might notice is that synchronized labels cannot be deleted. We can select all of the labels in the labels component with a CTRL-A (the standard Windows power user "Select All" shortcut) or by using Edit - Select All. If we now press the Delete key, nothing happens, nor is the Delete command enabled in the Edit menu.


Let's now create a similar bound labels component, but let's create this as an unsynchronized labels component.




Once again we use the Create Labels dialog to create labels from the Mexico drawing using the Place_name field. This time, however, we will un-check the automatically label new drawing objects option so the result is an unsynchronized labels component. We will give this new labels component the name Unsynchronized Labels so that we can tell at a glance in the project pane which labels component is which.




A second labels component appears in the project pane, also indented below its parent drawing because it too is bound to that drawing.




We click off the synchronized labels layer in the map so it is not visible and then we drag and drop the new labels component into the map. We will leave these labels formatted using default colors and style so it is clear in these illustrations when a synchronized labels layer is shown and when an unsynchronized labels layer is illustrated.




If we click on the Labels menu we can see that it reports this labels component is not synchronized: there is no check mark next to the Synchronized option.


Let us now try some experiments to see how unsynchronized labels behave.




We will first select two labels near the center of the view and press CTRL-X to cut them (or, press Edit - Cut).




Both labels will be deleted and copied to the Windows Clipboard. Note that it is not only possible to delete labels in an unsynchronized labels component; it is also possible to just delete some of them.


If we like, we can right click into the project pane and Paste to create a new labels component using the content of the Windows clipboard.




A third labels component appears in the project pane, named using the default naming scheme Manifold applies when new components are pasted. This labels component is also indented below its parent drawing because it too is bound to that drawing.


When we copy labels from a bound labels component and paste them into a project, the new labels component will inherit the bound status of the component from which the labels were copied. The pasted component will be bound to the same parent drawing, it will use the same text (including use of any fields) and it will use the same projection.




If we open the new labels component in its own window, we can see that it has two labels in it, the two labels that were cut from the original and pasted to create this labels component.




Let's go back to the unsynchronized labels layer in the map and select all of the labels.




If we press Delete, they will all be deleted. We can now add labels back to this labels layer with the assistance of a highly useful shortcut.


Using the Insert Label Tool with Unsynchronized Labels Components


images\btn_insert_label_point.gif The Insert Label command is used to insert a label. If we click with this tool into an unbound labels component it will pop open a dialog allowing us to enter text for that label. In a synchronized labels component this tool is not available, because synchronized labels always are created or disappear based on whether their parent objects in the drawing are created or disappear.


However, in the case of an unsynchronized bound labels component, the Insert Label tool is available. When clicked into the labels component, it will create a label at the position clicked for the object at that location. The text of the label will be taken from whatever is the current specification for labels in that bound labels component.


To continue the example, we can open our unsynchronized labels component in its own window and click into it with the Insert Label tool. Each time we click at a location a label will be created at that spot for the object at that spot.




For example, if we click at the location above, within the area representing Zacatecas province...




...a label will appear there using the Place_name field for that object. If we click at the next location...




...a label will appear for San Luis Potosi province. We can click lower and to the right...




...and a label will appear for Jalisco province. If we click in the region of Durango province to the West of Zacatecas...




...a label will appear there as well.


This technique is a very rapid way of creating labels just where we want them. We might have many objects, such as all of the provinces in a country, but want to label only some of them. A fast way of accomplishing that goal is to create a bound labels component that is not synchronized, delete all the many labels created automatically (easy to do with a CTRL-A and a CTRL-C using the Windows keyboard shortcuts for Select All and Delete) and then use the Insert Label tool to click at desired locations to create labels only where desired.




The labels will also appear, of course, within the map as well since we have used the same labels component as a layer in that map.


The technique above was illustrated using a labels window, but it works for a labels layer in a map window as well, so long as the map includes as layers both the parent drawing and the labels component bound to that drawing and the parent drawing layer is visible.


Let us now see what happens to bound labels when we delete their parent objects.




We will select the area representing Zacatecas and press Delete.




This deletes the area from the drawing. It also deletes the associated label from all labels components bound to that drawing. Note that there is no longer a label for Zacatecas. Even though we are looking at an unsynchronized labels layer, it is still bound to the parent drawing and the labels cannot exist without their parent objects.




Let us now see what happens when we add an area. First, we will turn on Instant Data mode so we can add data attributes quickly to newly-created objects.


images\btn_shp_area.gif Next, we will use the Insert Area tool to add a triangular area in the empty region formerly occupied by Zacatecas province.




When we add the new area, Instant Data mode will pop open the Object Fields dialog to allow us to add values for this new object. We will add the value Manifoldia for the Place_name of this newly-created area. "Manifoldia" strikes us as a nice name for a new province named after Manifold System.




In the unsynchronized labels layer, no new labels appear. That's because with unsynchronized labels adding new objects will not create new labels for them.


However, we can click off the unsynchronized labels layer and click on the synchronized labels layer to see what has happened there.




In the synchronized labels layer a new label has appeared for Manifoldia. That's because with synchronized labels any new object added to the parent drawing will automatically have a new label created for it.


Multiple Labels per Object


Bound labels components can have more than one label for every drawing object, and the metric of each such label may be independently labeled (see the Editing Labels topic for information on editing label metrics).


There are two main ways in which an object in a drawing can have multiple labels bound to it:


·      More than one labels component can be bound to the same drawing, so objects in the drawing can have labels bound to them that are in more than one different labels component.

·      An individual labels component can have more than one label bound to the same drawing.


The first situation above is fairly obvious, since we can easily create more than one labels component bound to the same drawing. In the example above, for instance, we created two different labels components bound to the same drawing.


It is less obvious how we could create multiple labels bound to the same drawing object within the same labels component. This is best illustrated with a small example using a bound, unsynchronized labels component as follows.




Consider a bound, unsynchronized labels component we've created for the sample Mexico drawing just as in the example above. The illustration shows the labels component open in its own window.


images\btn_insert_label_point.gif After deleting all of the labels created when the component was first created, we've used the Insert Label tool to create a few labels. The illustration above shows the window just as we are about to click the tool into the Northwest corner of Durango province to create a label there.




Manifold creates a label for us at the position clicked using the data for Place_name taken from the object that was clicked. Now we will click the Insert Label tool again near the center of Durango.




Once again, a label is created at the clicked spot. We can click a third time in the Southwest portion of the province...




...and a third label is created. What is going on is that we have created three new labels, all of which are bound to the area object representing Durango province.




We can see this by clicking into the drawing's table and changing the Place_name value for this object.




If we change DURANGO in upper case to title case, Durango, the change will be immediately reflected in all three labels bound to that object.




The above technique allows us to add multiple labels per object. There are many circumstances in which we might want to have multiple labels per object.




For example, we might want to place labels near the borders of a large country or province, as seen above. The illustration (a zoomed in view of Durango) was created by turning on per-label formatting for this labels component and then selecting each label in turn and using individual rotation format values for each of the three labels.


Another common usage for having multiple labels per object is to create more than one label for a long line, such as a highway, that should be labeled at more than one location.




The above example uses the Insert Label tool. The other label inserting tools also work in this way, including the Insert Line Label and Insert Freeform Line Label tools.


Although the above example is purely interactive, we should keep in mind that using synchronized labels can be extremely useful in non-interactive settings as well when queries or other processes are used to dynamically create drawings. For example, suppose a linked drawing is automatically created from a query or from an external DBMS table. It is very useful to have any labels associated with such a drawing be automatically created using a synchronized labels component since we don't know in advance how many objects will be in that drawing or where they might be located. Such automatic creation of labels is extremely important in dynamic applications, such as Internet Map Server applications.


See Also



Creating Labels from Fields

Formatting Labels

Formatting Individual Labels

Thematic Formatting and Labels

Label Display Options