Controlling Text Style Orientation

2-6 Oracle Fusion Middleware Users Guide for Oracle MapViewer ■ If the label element of the theme’s styling rules specifies a label style other than the advanced style itself, the specified label style is used to label the feature. In the following example, because the label element’s style specification T.STATE_NAME is different from the features element’s style specification V.RB1, features that fall into a bucket with no specified label style are labeled using the T.STATE_NAME style: ?xml version=1.0 standalone=yes? styling_rules rule column=TOTPOP features style=V.RB1 features label column=county style=T.STATE NAME 1 label rule styling_rules ■ If the label element of the theme’s styling rules specifies the advanced style as its label style, the feature is not labeled. This is why some counties in Figure 2–1 are not labeled. In the following example, because the features and label elements both specify the advanced style V.RB1, features that fall into a bucket with no specified label style are not labeled: ?xml version=1.0 standalone=yes? styling_rules rule column=TOTPOP features style=V.RB1 features label column=county style=V.RB1 1 label rule styling_rules

2.2.3 Orienting Text Labels and Markers

You can control the orientation of text labels and markers on a map by using oriented points. The oriented point is a special type of point geometry introduced in Oracle Spatial for Oracle Database 10g Release 1 10.1. In an oriented point, the coordinates represent both the location of the point and a virtual end point, to indicate an orientation vector. The text is aligned or the marker symbol is rotated according to the orientation vector, which is explained in Section 3.2.5 and illustrated in Figure 3–3 in that section. For more information about oriented points, see Oracle Spatial Developers Guide.

2.2.3.1 Controlling Text Style Orientation

To orient the text label of a point in the direction of an orientation vector, you can specify the point as an Oracle Spatial oriented point in the map request. When MapViewer labels an oriented point, it automatically centers the text label on the point position, and aligns the label so that it points in the direction of the orientation vector. For each feature to be so labeled, you must specify its location as an oriented point. You can group these oriented points in a single table and create a spatial index on the column containing the point geometries. You can then create a theme based on the table, specifying a desired text style as the labeling, and specifying transparent color style as the rendering style so that the points themselves are not displayed on the map. MapViewer Concepts 2-7 Example 2–4 is a map request that labels a single oriented point with coordinates 12,14, 0.3,0.2, where 12,14 represents the X and Y coordinates of the point and 0.3,0.2 represents the orientation vector. It renders the point using a dynamically defined transparent color style named transparent_color to ensure that the text is displayed but the underlying point is not displayed. Example 2–4 Labeling an Oriented Point map_request title=Labeling Oriented Points datasource=my_datasource width=400 height=300 antialiase=true format=PNG_STREAM themes theme name=theme1 jdbc_query spatial_column=geom jdbc_srid=8265 render_style=transparent_color label_column=label label_style=t.street name datasource=tilsmenv SELECT SDO_GEOMETRY2001, 8265, NULL, SDO_ELEM_INFO_ARRAY1, 1, 1, 3, 1, 0, SDO_ORDINATE_ARRAY12, 14, .3, .2 geom, Oriented Point label FROM dual jdbc_query theme themes styles style name=transparent_color svg width=1in height=1in g class=color style=stroke:ff0000;stroke-opacity:0 rect width=50 height=50 g svg style styles map_request Figure 2–2 shows part of the map generated by the request in Example 2–4 . The label is the phrase Oriented Point. Figure 2–2 Map Display of the Label for an Oriented Point

2.2.3.2 Controlling Marker Orientation