In Map View, users can choose from a selection of colour palette options. These options determine which colours are used to display data on the map. For example:
You can configure the options that are available in this menu by using the
cfg command in SuperADMIN.
Define the Colour Swatches
The colour palette for Map View is defined as a series of swatches, containing the name of the palette (this will be shown in the drop-down list) and the hexadecimal colour codes of each of the available colours. For example, the LightBlue-Grey option shown above uses following colour codes:
Check Which Swatches Are Currently Defined
To check which swatches are currently defined, use the following command in SuperADMIN:
In this example, there are 7 swatches defined (each one is enclosed in curly brackets). Each swatch defines 5 colour values.
Update an Existing Defined Swatch
To update one of the existing swatches, use the following commands:
|Change the name of an existing swatch:|
cfg global superweb2.mapping.palette.swatches[<swatch_index>].name set <name>
|Replace all the colours defined for an existing swatch with a new list:|
cfg global superweb2.mapping.palette.swatches[<swatch_index>].colours set <list_of_colours>
|Update a single colour value in an existing swatch:|
cfg global superweb2.mapping.palette.swatches[<swatch_index>].colours[<colour_index>] set <colour>
Identifies the swatch you want to update. Each swatch has a unique index number, starting from 0. For example in the above definitions, the Red-Grey swatch is number 0, and the Yellow-Grey swatch is number 1.
|The name of the swatch. This will be displayed in the drop-down list in SuperWEB2 Map View.|
A list of colours to set for this swatch. Specify the colours as hexadecimal values, enclosed in double quotes, separated by commas, and with the entire list enclosed in square brackets.
This will completely replace the existing colours defined for this swatch.
|The index value of a specific colour to update. The colour values are also indexed, starting at 0.|
|A hexadecimal colour value. For example: red is represented in hexadecimal as "#FF0000"|
Change the name of the DarkGreen-Grey swatch:
Swatch names do not currently support spaces. Although swatches with these names will appear in the drop-down list in Map View, users will not be able to download PDFs.
Replace the colours for the LightBlue-Grey swatch:
Update the final colour value in the Red-Grey swatch from
Using Unicode Characters in Swatch Names
If your swatch names contain Unicode characters, you may need to change a setting on the Tomcat server to ensure that users can download PDFs.
When users download a PDF, SuperWEB2 needs to load the PNG images so that it can include them in the legend. If your swatch names have Unicode characters then the PNG files will also have Unicode characters. To ensure that SuperWEB2 can access them, you need to make sure that your Tomcat server is configured to use UTF-8 encoding in URLs.
This setting is not enabled by default. To make the change:
- Open <tomcat_home>\conf\server.xml in a text editor.
Locate the following section:
URIEncoding="UTF-8"to the Connector:
- Save your changes and restart the Tomcat service.
Add a New Swatch
To add a new swatch, use the same commands as above to set the name and colours, but simply make sure that you use the next index value up.
For example, if you wanted to add a new eighth swatch to the seven existing ones shown above (index values 0 - 6) you would use the index value of 7:
Changing Colours in Swatches
If you make any changes to the swatch colours, rename any of the swatches, or add new swatches, then you also need to update the PNG images in <tomcat_home>\webapps\webapi\mapping\mapview.
This directory must contain a PNG for every colour in every swatch:
These PNG images are used in the legend in PDF downloads, so you need to keep them synchronised with any changes that you make in SuperADMIN.
Each image must be:
- In PNG format.
- 24 pixels wide by 14 pixels high.
- A solid block of colour that matches the corresponding colour defined in the swatch.
Named using the name of the swatch followed by an index value that corresponds to the colour it represents in the swatch. The .png extension in the filename must be lower case.
Set the Default
The default colour swatch is shown first when you switch to Map View. One of the configured colour palettes must be set as the default.
To check which colour swatch is currently set as default, use the following command:
To change the default colour palette, use the following command:
<name> with the name of one of the swatches defined in
superweb2.mapping.palette.swatches. For example: