2-14 Oracle Fusion Middleware Users Guide for Oracle MapViewer
If an advanced style is specified in a rule, the SELECT list of the query for that rule will include the additional attribute column or columns that are required by the advanced
style.
2.3.1.3 Styling Rules with Binding Parameters
As explained in Section 2.3.1.2
, the features element of a styling rule can define a query condition to select features from the base table or view. This query condition
typically contains hard-coded SQL expressions, such as runway_num 1 in the airport theme. However, you can instead include binding variables in the query
predicate. Such a theme is often called a templated theme, because it is essentially defining a template for how to display certain features, and the exact set of features is
determined at run time by providing a binding value to the query predicate.
The concept of templated theme allows you to define a single theme and to have the binding values change between map requests. For example, consider the following
styling rule:
?xml version=1.0 standalone=yes? styling_rules
rule features style=C.RED state_abrv=:1 features
label column=STATE style=T.STATE NAME 1 label rule
styling_rules
The preceding styling rule defines a features element with a query condition based on the value of the state_abrv attribute, which the application must supply.
In MapViewer requests, the binding parameter must be defined on the theme section, and each binding parameter is defined by a value and by a SQL type. In the following
theme definition on a map request, the state abbreviation value is ME and the variable SQL type is String. The value ME will be used with the predefined theme styling rule.
theme name=THEME_US_DYN_STATES binding_parameters
parameter value=ME type=String binding_parameters
theme
2.3.1.4 Applying Multiple Rendering Styles in a Single Styling Rule
The feature element of a styling rule allows you to specify only one rendering style using the style attribute. If you want to apply multiple rendering styles to a
feature without using multiple themes, you cannot specify multiple styling rules, because each rule selects a different subset of features. To apply multiple rendering
styles to a feature without using multiple themes, you must use the rendering element instead of the style attribute of the features element.
The rendering element has the format shown in the following example: rendering
style name=V.POIVMK value_columns=FEATURE_CODE substyle name=V.POIVBKT value_columns=POINT_ID changes=FILL_COLOR
style rendering
In the rendering element, the style element specifies the name of the style to use when rendering features, and one or more value columns comma-delimited for
use with advanced styles. In the preceding example, the style name is V.POIMVK and the value column is FEATURE_CODE.
MapViewer Concepts 2-15
In the style element, the substyle element enables rendering of a feature using a combination of two attribute values.,such as defining the feature shape by the
style element and the feature color by the substyle element. This is useful for rendering point features once but based on two attribute values. You can specify one
or more value columns comma-delimited, and the change to be applied only FILL_ COLOR is currently supported.
You can specify multiple style elements with a rendering element, to achieve the following goals:
■
To create an advanced style in which a base advanced style, associated with some attributes columns, can have its rendering affected by some other attributes
through the use of a substyle. For example, an advanced style can display markers of different sized based on one value column, while using a secondary color style
to change the fill color of those markers based on another value column.
■
To use multiple styles to render a feature achieving the effect of stacked styles. Example 2–7
shows a predefined theme styling rule that uses the rendering element. The features element is part of the rules and must be define, because it
also specified the query condition, but no style attribute is specified. The rendering element defines how to render the features.
Example 2–7 Styling Rules Using the rendering Element
?xml version=1.0 standalone=yes? styling_rules
rule features features
label column=NAME style=T.STREET2 1 label rendering
style name=V.POIVMK value_columns=FEATURE_CODE substyle name=V.POIVBKT value_columns=POINT_ID changes=FILL_COLOR
style rendering
rule styling_rules
See also Section 3.1.12
, which contains an example that uses the rendering element.
The rendering element can also be used with dynamic themes, geometry themes, and topology themes.
2.3.1.5 Caching of Predefined Themes