Making a Text Style Sticky Getting a Sample Image of Any Style

2-8 Oracle Fusion Middleware Users Guide for Oracle MapViewer Figure 2–3 shows how you can use an oriented point to control the orientation of marker styles. In this figure, the original marker style is first shown without any rotation. However, when the marker is applied to the same oriented point shown in Example 2–4 in Section 2.2.3.1 , the marker style is rotated accordingly in this case about 34 degrees counterclockwise to reflect the orientation vector. Figure 2–3 Oriented Marker

2.2.4 Making a Text Style Sticky

You can specify that a text style is sticky, which means that any feature that uses it as a label style will always have its text label drawn on a map. Example 2–5 shows an XML definition of a style with the sticky attribute set to true. Example 2–5 Text Style with Sticky Attribute ?xml version=1.0 standalone=yes? svg width=1in height=1in descdesc g class=text sticky=true style = font-style:plain;font-family:Serif;font-size:11pt;font-weight:bold;fill:000000 Hello World g svg

2.2.5 Getting a Sample Image of Any Style

To get a sample image for any pre-defined style stored in a database, you can issue a simple HTTP request to the MapViewer server. This request can specify the size of the sample image, the background color, and the format of the returned image. Such requests are useful if you want to display a visual list of styles on a Web page, to build a custom map legend, or just to see how various styles will appear. The HTTP request has the following parameters, all of which are optional except for sty: ■ sty required specifies the name of the style. ■ ds specifies the data source where the style can be accessed. By default, the default MapViewer data source is used. ■ w specifies the width of the sample image in pixels. The default value is 20. ■ h specifies the height of the sample image in pixels. The default value is 20. 12,14, 0.3,0.2 Original marker style Oriented point Marker style applied to the oriented point MapViewer Concepts 2-9 ■ f specifies the format of the sample image. Possible values are png for direct PNG image stream, png_url for the URL of a PNG image, gif for direct GIF image stream, or gif_url for the URL of a GIF image. The default value is png, which means the MapViewer server will directly stream the generated PNG image data back to the client without first saving it to the server disk. ■ bg specifies the background color of the sample image. The format must be a hexadecimal string in the form of 0xrrggbb, such as 0x808080 for a gray color. The default value is 0xffffff white. For a transparent background, specify bg as an extended hexadecimal string to include the alpha values, in the format of 0xaarrggbb. For example, 0x00ffffff will make the style images background completely transparent, while 0x55ffffff is a white background with a transparency value of 0x55 decimal value 80. The alpha value can range from 0x00 completely transparent to 0xff completely opaque. ■ aa specifies whether the sample image should be rendered in antialiasing mode. The default value is the string true. Specify the string false if you do not want to use antialiasing. The following example generates an antialiased PNG image with a gray background with the default size of 20x20 pixels, displaying the marker style named M.STAR from the MapViewer default data source: http:www.mycorp.commapvieweromserver?sty=m.starbg=808080 The preceding request generates a display similar to that in Figure 2–4 . Figure 2–4 Sample Image of a Specified Marker Style The following example generates an antialiased GIF image with the default white background, a width of 60 pixels, and a height of 25 pixels, displaying the line style named L.PH from the MapViewer data source named mvdemo: http:www.mycorp.commapvieweromserver?sty=l.phds=mvdemof=gifw=60h=25aa=true The preceding request generates a display similar to that in Figure 2–5 . Figure 2–5 Sample Image of a Specified Line Style 2-10 Oracle Fusion Middleware Users Guide for Oracle MapViewer

2.3 Themes

Theme is perhaps the most important concept in MapViewer. A theme is a visual representation of a particular data layer. Conceptually, a theme is a collection of geographic features that share similar attributes, plus the rendering and labeling rules that tell MapViewer what styles to use to render and label the features. To be more exact, when you define a theme, you are actually providing MapViewer with the following information: where and how to get the data, and how to render and label the data. Depending on how a theme is created, it can also be categorized as either a predefined theme or a dynamic JDBC theme. For a predefined theme, the theme’s definition is created in the standalone Map Builder tool and stored in the database. For a dynamic theme , the theme’s definition XML is created in real time by an application. Dynamic themes typically employee a custom SQL query constructed by the application to get its data. Typically, the data for a theme comes from a spatially enabled table, that is, a database table or view with a column of type SDO_GEOMETRY. For example, a theme named US_STATES might be based on a STATES table that has a column named GEOMETRY, plus any other nonspatial attribute columns. This type of theme is often called a geometry theme. Besides geometric data, other types of database-managed geographic data can be associated with corresponding types of themes; for example: ■ Georeferenced images stored in BLOBs image themes ■ Oracle Spatial GeoRaster data GeoRaster themes ■ Oracle Spatial network data model network themes ■ Oracle Spatial topology data model topology themes ■ Cartographic annotation text annotation themes MapViewer themes can be used to render not only geographic data stored in a database, but also data originating from other sources, such as Web services WFS and WMS or the local file system through the custom spatial data provider interface. Regardless of what type of data is associated with a theme except for WMS themes, which represent externally rendered map layers, the MapViewer styling rules still need to be defined for each theme, and the styles referenced by the styling rules must exist and be stored in the database as part of the mapping metadata.

2.3.1 Predefined Themes

A predefined theme is a theme whose definition is stored in a user’s database schema. All predefined themes for a database user are stored in that user’s USER_SDO_ THEMES view described in Section 2.9 , especially Section 2.9.2 . When you include a predefined theme in a map request, you need to specify only the theme name. MapViewer automatically finds the theme’s definition, constructs a query based on it, retrieves the relevant spatial and attribute data, and renders the data according to the styling rules for the theme. Each predefined theme must have an associated base table or view. If you base a theme on a view, you must insert a row in the view owner’s USER_SDO_GEOM_ METADATA view described in Oracle Spatial Developers Guide specifying the view and its spatial column. If the view is a join view that is, if it is based on multiple tables, you must specify the key_column attribute described in Section A.7 in the theme’s styling rules. The reason for this requirement is that MapViewer by default caches geometries for a predefined theme based on the rowid in the base table;