Templated Predefined Themes Dynamic JDBC Query Theme-Based FOI Layers

Oracle Maps 8-23 hidden_info rule features style=M.CIRCLE features label column=NAME style=T.TEXT 1 label rule styling_rules The styling rules in Example 8–6 specify the following. To see how these specifications affect the map display, see Figure 8–2, Application Created Using Oracle Maps in Section 8.1.2 . ■ The marker style M.CIRCLE is used to render the customers. ■ The NAME column is used as the labeling attribute label column=NAME. The value in the NAME column the name of the customer is included in the information window that the JavaScript map client displays when the user moves the mouse over the customer marker. ■ The information window also includes the values in columns specified in the hidden_info element CITY and SALES in this example for that customer. Each field element specifies two attributes: column to identify the database column and name to identify a text string to be used in the information window.

8.3.1.2 Templated Predefined Themes

The predefined MapViewer theme can be a standard predefined theme or a templated predefined theme. Both types of predefined themes are defined in the USER_SDO_ THEMES view. However, the query conditions of a standard predefined theme are fixed, whereas the query conditions of a templated predefined theme can contain dynamic binding variables whose values can be changed when the theme request is issued. Example 8–7 shows the XML styling rules for a templated predefined theme that uses two binding variables with the relevant text shown in bold in the features element. Example 8–7 XML Styling Rules for a Templated Predefined Theme ?xml version=1.0 standalone=yes? styling_rules hidden_info field column=NAME name=Name field column=CITY name=City field column=SALES name=Sales hidden_info rule features style=M.CIRCLEcity=:1 and sales:2features label column=NAME style=T.TEXT 1 label rule styling_rules In Example 8–7 , the binding variable :1 specifies the name of the city in which the qualifying features must be located, and the binding variable :2 specifies the minimum sales volume of the qualifying features. That is, only customers in a specified city and with sales above a certain minimum will have store markers displayed. The values of these two binding variables are not fixed when the theme is defined; instead, they are provided in the requests that the client sends to the server. 8-24 Oracle Fusion Middleware Users Guide for Oracle MapViewer

8.3.1.3 Dynamic JDBC Query Theme-Based FOI Layers

When the client requests FOI data using a dynamic JDBC theme-based FOI request, it must specify the complete definition of the JDBC theme. The theme definition must specify the rendering style and the SQL query that is to be used to query FOI data, including all geometry and non-geometry attributes. Example 8–8 shows some JavaScript client code to create an FOI layer that displays a buffer around each customer location. Example 8–8 Theme for Dynamic JDBC Query var theme = themestheme name=JDBC_THEME + jdbc_query asis=true spatial_column=location jdbc_srid=8307 render_style=C.RED datasource=mvdemo + select sdo_geom.sdo_bufferA.location,1,0.005,+ \unit=mile arc_tolerance=0.005\ location + from customers A + jdbc_querythemethemes ; buffertheme = new MVThemeBasedFOIbuffertheme,theme;

8.3.2 User-Defined FOI Requests