GridStyle

Description

A GridStyle element defines a style for a MapInfo grid image.

Context

Table 1 lists the elements that can contain, or be contained by, a GridStyle element.

Table 1. Context
Contained by Element Contains

NamedStyle or CompositeStyle

GridStyle

GridInflectionList

Attributes

Table 2 lists the attributes of a GridStyle element.

Table 2. Attributes
Attribute Description

id

A unique identifier for the element.

name

A descriptive name for the element.

contrast

A floating-point value from 0 to 1 specifying the contrast of the image.

A value of 0 means that the image has minimum contrast. A value of 1 means that the image has maximum contrast. A value of 0.5 means that the image has 50% contrast.

The contrast attribute is optional. The default value is 0.5.

brightness

A floating-point value from 0 to 1 specifying the brightness of the image.

Brightness is a measure of the lightness or darkness of the image. A value of 0 means that the image has minimum brightness. A value of 1 means that the image has maximum brightness. A value of 0.5 means that the image has 50% brightness.

The brightness attribute is optional. The default value is 0.5.

opacity

A floating-point value from 0 to 1 specifying the opacity of the image.

A value of 0 means that the image is totally transparent. A value of 1 means that the image is totally opaque. A value of 0.5 means that the image is 50% translucent.

The opacity attribute is optional. The default value is 1.

grayscale

A boolean value (true or false) specifying whether the image should be displayed using only shades of gray, ranging from white to black.

The grayscale attribute is optional. The default value is false.

show-hillshade

A boolean value (true or false) specifying whether to display the grid image with relief shading in order to provide a more 3D appearance.

The show-hillshade attribute is optional. The default value is false.

null-color

A string value specifying the color used to indicate that a value is null.

The value can be any valid CSS color. (See http://www.w3.org/TR/REC-CSS1#color-units.)

The null-color attribute is optional. The default value is black.

Note: This attribute has no effect if null-transparent is true.

null-transparent

A boolean value (true or false) specifying whether null values should be displayed as transparent (true) or displayed as the color specified in null-color (false).

The null-transparent attribute is optional. The default value is false.

Example

This example specifies a grid image style that contains a collection of three grid inflection points.



<?xml version="1.0" encoding="UTF-8"?>
<NamedStyle
    version="MXP_WorkSpace_1_5"
    xmlns="http://www.mapinfo.com/mxp">
    <GridStyle
        id="migridstyle"
        name="migridstyle"
        contrast="0.5"
        brightness="0.5"
        opacity="1"
        grayscale="false"
        show-hillshade="false"
        null-color="black"
        null-transparent="true"/>
        <GridInflectionList>
            <GridInflection
                value="0.4"
                color="yellow"/>
            <GridInflection
                value="0.5"
                color="green"/>
            <GridInflection
                value="0.6"
                color="blue"/>
        </GridInflectionList>
    </GridStyle>
</NamedStyle>