Style properties shown in the Style pane normally apply to all items in the active layer. Style overrides allow individual objects or labels to ignore the overall Style properties for the layer and instead to use their own, individual styles.
This topic is intended to be read together with the Example: Style Overrides topic.
A style override is a plain text field in a record that specifies what style should be used for that record's object or label instead of the style set by the Style pane for the layer. By default, the text field used for style overrides is named Style.
By default, style overrides are not allowed and the system ignores any style specifications found in a record. When we check the option box to use style overrides, if a record contains a style specification the system will use that specification, overriding whatever has been set by the Style pane for the layer. Only those style properties changed by the override will be changed. All other style properties will continue to be applied as specified by the Style pane.
When style overrides are in use they allow us to individually specify style properties for specific objects or labels.
Important: we must first enable style overrides by checking the Use style overrides box before we can use them.
Open the drawing or labels component or click on its tab in an open map window.
Open the Style pane.
Click on the Options tab and check the Use style overrides box.
Choose the text field to be used or press the Schema button to add a new text field to use.
Press the Update Style button.
Open the drawing or labels component or click on its tab in an open map window.
Alt-click onto the object or label desired.
In the Info pane Style tab, choose the desired style properties.
Press Update Record.
Open the drawing or labels component or click on its tab in an open map window.
Alt-click onto the object or label desired.
In the Info pane Style tab, click the desired style property and choose Default.
Press Update Record.
Open the drawing's table for the drawing or labels component desired.
In the Select pane choose the Style field and the Is not NULL template.
Press Replace Selection.
All records for which the Style field is not <NULL> will be selected, and their corresponding drawing objects or labels will also be selected.
A style override is nothing more than a string of human-readable text in a record. The text specifies style properties using JSON nomenclature. By tradition, the text field that saves style override JSON text is called Style. It could be called anything, but Manifold will look for a text field called Style and present that first in the Style - Options tab, and Manifold users will almost always use that name so it is clear what field is used for style overrides.
If the Use style override box is checked in the main Style pane, Option tab for the layer, Manifold will look at the specified text field for each record to see if is empty or if it contains a style override. If it is not empty, Manifold uses whatever style properties it finds in the string for that record.
The table above has a text field called Style that contains NULLs for all records except one record, which has a style override in that field. The Style field for the Centre-Val de Loire record specifies use of a green color for the fill color for areas. That one record has a style override while all the other records have NULLs.
Manifold draws objects for that layer using whatever style properties are specified by the Style pane. If we turn on style overrides, the override for the Centre-Val de Loire record will be used for that object in preference to what the Style pane says. No matter what the Style pane specifies, the Centre-Val de Loire object will have green fill color within the area. The override for Centre-Val de Loire does not mention any other style properties, so all other style properties like the color of the area border will continue as specified by the Style pane.
When we specify a style override for an object or label by clicking style buttons and choosing a color or other property, Manifold writes the appropriate JSON test for us into the table for that object. We do not need to learn how to write style overrides in JSON. However, if we do understand JSON we can use queries and scripts to automate the creation of style overrides. Even if we do not understand how to write a style override in JSON from scratch, we can create an override and then copy and paste that style override from the record in which it was created to other records. Using the Select and Transform panes we can copy it into thousands of records at once with a few mouse clicks.
See the Example: Style Overrides topic for a detailed, step-by-step example of using style overrides.
Is the field named 'Style' special? - Yes and no. The Use style overrides facility will look for a text field called Style in the drawing's table and, if a field named Style exists, that field will be used by default to store any style overrides. We can choose a different text field if we like. If a field named Style does not exist, the (new field) choice will create an nvarchar text field called Style. If we already have a field called Style and we choose (new field), that will create a field called Style 2 and so on. But there is nothing special about the name 'Style' other than it is short, easy to remember, and more self-documenting than using the name 'Ringo' or 'Beatrice' for a field that will store style override text.
Why nvarchar? Can it be a varchar? - Yes, if you prefer. Manifold uses nvarchar text type by default because supporting Unicode is good karma in an application that is used in many different countries.
More than one style overrides field. - We can have more than one text field in the table that is used for style overrides. Whichever field has been chosen in the field box by the Use style overrides check box is the field that will be used.
Are style overrides a replacement for thematic formatting? - No. Style overrides generally are intended for special case needs, to be applied in an ad hoc manner. For example, suppose we have thematically formatted a map for cartographic reasons but when it comes time to print there is one area that just does not look right, for which a slightly lighter color would look better. If we are in a hurry, instead of spending more time tinkering with thematic formats we could simply take a brute force approach and use a style override to color that one area exactly the color which looks good in the layout.
Another good use for style overrides is when creating labels manually to annotate a map. Style overrides allow us to manually specify the style of each label, such as size, font and color that we create. When the numbers of labels are limited it is often easier to simply use style overrides than to organize a limited number of labels into several different layers that can all be formatted in the usual way.
Example: Style Pane Quickstart - A tutorial introduction to using the Style pane to apply color, symbology, size and rotation to areas, lines and points in drawings.
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.