Vector Markup Language (VML) Feature Representation
In addition to the generic FME feature attributes that FME Workbench adds to all features (see About Feature Type Attributes), this format also adds format-specific attributes (Format Attributes).
Special attributes direct the VML writer as it writes the features into the VML file. The most important of these is the vml_type attribute which controls the interpretation of the feature. Acceptable values for vml_type are vml_text, vml_polyline, vml_polygon, and vml_point.
User-defined attributes are ignored by the VML writer. Limited user attribution can be output in the VML file by using the vml_title attribute or the vml_url attribute allowing a feature to have a URL link which may point to some external data source.
Some VML feature attributes have data type VML boolean, VML number, or VML color. The value for these attributes are copied directly from the FME mapping file to the VML output file, and therefore must conform to the VML specification. The following table lists the VML data type specification for these attributes.
Data Type |
Description |
---|---|
VML boolean |
An attribute which can take true and false values. The following directives are defined for VML. Value for true: true | yes | on | t | 1 Value for false: false | no | off | f | 0 |
VML number |
Numeric data used for values that are integer or fractional numbers and for values that specify lengths. Lengths and numbers follow the lexical form defined for CSS with a suffix indicating a scale factor. |
VML color |
The full set of values are taken from HTML, CSS1, and VML specification. Example: HTML defines the following 16 colors. black | silver | gray | white | maroon | red | purple | fuchsia | green | lime | olive | yellow | navy | blue | teal | aqua Example: Using the CSS1 rgb form “rgb(red,green,blue)” where red, green, and blue are values in the range of 0..255. |
The following table lists the attributes that are common to all VML features:
Attribute Name |
Contents |
---|---|
vml_color |
The color of the brush used to stroke the feature. Range: VML color Default: black |
vml_weight |
The width of the brush used to stroke the feature. Range: VML number Default: 0.75pt |
vml_title |
The title of the feature that may be displayed by the VML viewer. Range: string Default: None |
vml_url |
The URL to jump to if this feature is clicked on. Range: string Default: None |
vml_target |
The target frame in an URL. Range: string Default: None |
vml_z_index |
The z-index of the feature in the output VML file. Positive numbers are in front of the screen. Negative numbers are behind the screen. Features having a higher z-index obscure features with lower z-index. Range: integer Default: 0 (for vml_polygon features) 10 (for vml_polyline features) 11 (for vml_point features) 12 (for vml_text features) |
vml_fill_color |
The color of the brush used to fill the feature. This attribute is not applicable for vml_polyline features. Range: VML color Default: black for points and text No Default for polygons |
vml_fill_attr{#} |
This list attribute allows the feature to be filled with customized effects. If a feature has this list attribute the VML element that represents the feature in the output file will contain a VML fill sub-element. The contents of the vml_fill_attr{#} list attribute must be of the following form: <attribute-name>=<attribute-value> Where <attribute-name> is a name of an attribute for the VML fill sub-element, and <attribute-value> is one of the possible values for that attribute name. Please refer to the VML specification for all the possible attributes that the VML fill sub-element may contain. The VML specification may be found at http://www.w3.org. For example, to specify that a feature is filled with a gradient and blue color add the following vml_fill_attr{#} list attribute with the following values to the feature: vml_fill_attr{0} “type=gradient” vml_fill_attr{1} “color=blue” Note: If the above string values contain spaces then they must be enclosed between double quotes. Also note that the index for the vml_fill_attr{0} must start from 0. The order in which the attributes are listed in the list attribute is of no importance. Range: <attribute-name>=<attribute-value> Default: No Default |
vml_stroke_attr{#} |
This list attribute allows the feature to be render with a customized outline. The values for this list attribute is similar to the vml_fill_attr{#} described above with the values for the <attribute-name> and <attribute-value> taken from the VML stroke sub-element instead. Example, to specify that a feature should be render with a dotted blue line add the following vml_stroke_attr{#} list attribute with the following values to the feature: vml_stroke_attr{0} "color=blue" vml_stroke_attr{1} "dashstyle=dot" Range: <attribute-name>=<attribute-value> Default: No Default |
vml_shadow_attr{#} |
This list attribute allows the feature to be render with a shadow effect. The values for this list attribute is similar to the vml_fill_attr{#} described above with the values for the <attribute-name> and <attribute-value> taken from the VML shadow sub-element instead. Example, to specify that a feature should be render with a dotted blue line add the following list attribute with the following values to the feature: vml_shadow_attr{0} "on=true" vml_shadow_attr{1} "type=perspective" Range: <attribute-name>=<attribute-value> Default: No Default |
vml_imagedata_attr{#} |
This list attribute allows the feature to have a picture render on top of it. The values for this list attribute is similar to the vml_fill_attr{#} described above with the values for the <attribute-name> and <attribute-value> taken from the VML imagedata sub-element instead. Example, to specify that a feature should be rendered with the sample ‘s.jpg’ image on top add the vml_imagedata_attr{#} list attribute with the following values to the feature: vml_imagedata_attr{0} "src=c:\temp\s.jpg" Range: <attribute-name>=<attribute-value> Default: No Default |
Points
vml_type: vml_point
Point features must have exactly one coordinate. The VML writer uses the predefined VML oval element to generate round point features. Point features have their vml_fill_color set to black by default.
VML point features have the following additional attribute:
Attribute Name |
Contents |
---|---|
vml_point_size |
The size of the point in ground units. Range: real>0 Default: x, where x=0.006*deltaY. deltaY is the y-coordinate range of the spatial extent of the input data in ground units. |
Polygon
vml_type: vml_polygon
Polygon features must have at least four coordinates, with the last coordinate equal to the first coordinate.
The vml_polygon features may not contain holes. The VML writer writes out a vml_polygon feature in the output file as a predefined VML polyline element. By default, the VML writer does not set the z-index attribute. When it’s not set, the web browser interprets the polygon (the VML filled polyline element) to the have a z-index of 0. Polygons produced by the VML writer, therefore, by default do not obscure other objects with the exception of overlapping polygons with the same z-index value. Objects drawn later with equal z-index attributes obscure earlier ones.
Polylines
vml_type: vml_polyline
Polyline features must have at least two coordinates. The VML writer writes out a vml_polyline feature in the VML output file as a predefined VML polyline element. The writer also writes out the z-index attribute to 10 so that, by default, the polylines only obscure the polygons.
Text
vml_type: vml_text
Text features must have exactly one coordinate. The vml_text_string attribute must also be present in the vml_text feature. Text is drawn in the output file by placing a VML textpath sub-element inside of a VML shape element. By default, vml_text features have their vml_fill_color attribute set to black.
VML text features have the following additional attributes:
Attribute Name |
Contents |
---|---|
vml_text_string |
The text string may contain blanks and there is no limit on its length. This attribute must be present for all vml_text features. Range: string Default: None |
vml_text_size |
The size of the text in ground units. Range: real>0 Default: x, where x=0.008*deltaY. deltaY is the y-coordinate range of the spatial extent of the input data in ground units. |
vml_text_justification |
The justification of the text. Range: left | center | right Default: left |
vml_rotation |
The rotation of the text, as measured in degrees counterclockwise from the horizontal. Range: -360.0...360.0 Default: 0 |
vml_font_family |
The CSS1 font family name. Range: CSS1 font family name. Default: Times New Roman |
vml_font_style |
The style of the font. Range: normal | italic | oblique Default: normal |
vml_font_weight |
The weight of the font. Range: normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 Default: normal |
vml_rotate_letters |
Rotate the letters of the text by 90 degrees. Range: VML boolean Default: f |
vml_same_letter_heights |
Stretches lowercase letters to the height of uppercase letters. Range: VML boolean Default: f |