Caching of Predefined Themes

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

By default, MapViewer automatically caches the spatial data for a predefined theme when it is fetched from the database for processing by the MapViewer rendering engine. By contrast, data for dynamic JDBC themes is never cached in MapViewer. If you do not want any data for a predefined theme to be cached such as for a theme whose underlying base table is constantly being updated, you can set the caching attribute to NONE in the styling_rules element for the theme. The styling_ rules element, including the caching attribute, is described in Section A.7 . Note: The use of styling rules with the rendering element, as shown in Example 2–7 , is not compatible with MapViewer release 10.1.3.1 and earlier releases. 2-16 Oracle Fusion Middleware Users Guide for Oracle MapViewer For frequently used themes whose base data is static or read-only, specify caching ALL for the best performance. This causes MapViewer, when it first accesses the theme definition, to fetch all the features including spatial data, attribute data, and styling information associated with them and cache them in the MapViewer memory, creating an in-memory R-tree for the theme’s spatial data. All subsequent requests requiring that theme occur locally instead of going to the database. If the caching attribute value is NORMAL the default, each time a map involving that theme is requested, MapViewer queries the database to get the spatial data and any associated attribute data. However, if any of the spatial geometry data, as referenced by rowid or a user-specified key column, has already been cached, the unpickling process the conversion from the raw database geometry format to a Java geometry object is skipped. Still, if memory is not an issue and if a frequently used theme can completely fit in the cache, you should specify caching ALL, to eliminate virtually all database access for that theme after the initial loading. Because the MapViewer spatial data cache is global, all predefined themes that are accessed by MapViewer compete for a global fixed-sized memory cache. The cache resides completely in memory, and you can specify the maximum size of the cache as explained in Section 1.5.2.6 . When the cache limit is reached, older cached data is removed from the cache to make room for the most recently accessed data, except that data for themes specified with caching ALL is not removed from the cache, and MapViewer does not requery the database for these themes. Caching is currently disabled for predefined annotation and custom geometry themes. For custom geometry themes, you can implement a caching mechanism in your provider implementation. However, for each request, a new instance of your provider is created; and if you implement a local caching mechanism, it will be lost.

2.3.1.6 Feature Labels and Internationalization