Adding Dynamically Defined Styles to a Map Request

4-8 Oracle Fusion Middleware Users Guide for Oracle MapViewer ■ addThemesFromBaseMapjava.lang.String basemap adds all predefined themes in the specified base map to the current map request. This has an advantage over setBaseMapName, in that you can manipulate the themes for the current map request, as explained in Section 4.3.5 . ■ addTopologyDebugTheme and its variants add the topology data structure as a topology debug-mode theme to the current map request. You must supply the rendering styles for the edges, nodes, and faces. Section 2.3.6 explains topology themes, including the debug mode. ■ addTopologyTheme adds the topology features as a topology theme to the current map request. You must supply the query string. Section 2.3.6 explains topology themes. You can remove all added point and linear features by calling the removeAllPointFeatures and removeAllLinearFeatures methods, respectively.

4.3.4 Adding Dynamically Defined Styles to a Map Request

Besides the styles stored on the USER_SDO_STYLES view, you can also add dynamically defined temporary styles to a map request. These dynamically defined styles provide temporary information for the map request, and they should always be added to the map request before it is sent to the server. The methods for adding dynamically defined styles to the map request have names that start with add. Effective with release 11g, you can add any kind of dynamically defined style to a map request with the single method addStyle, which has the following definition: public void addStylejava.lang.String name, StyleModel tempStyle In the preceding definition, StyleModel is an interface defined in the Java client package oracle.mapviewer.share.style. This package and the oracle.mapviewer.share.stylex package also contain concrete style model classes that represent the definitions of all types of styles supported by MapViewer. See the Javadoc reference documentation for information about these packages. The following code excerpt shows how to use the addStyle method and the ColorStyleModel class to add a dynamic color style to a map request: import oracle.lbs.mapclient.; import oracle.mapviewer.share. … ColorStyleModel csm = new ColorStyleModel; csm.setFillColornew Color255, 0, 0, 100; csm.setStrokeColornew Color0, 0, 255, 100; mapViewer.addStylemy_color, csm; As an alternative to using the addStyle method, you can use the following methods for adding specific types of styles: ■ addBucketStylejava.lang.String name, java.lang.String low, java.lang.String high, int nbuckets, java.lang.String []styleName adds a bucket style with equal intervals, for which you specify the range values, the number of buckets, and the style name for each bucket. ■ addCollectionBucketStylejava.lang.String name, java.lang.String []label, java.lang.String []styleName, MapViewer JavaBean-Based API 4-9 java.lang.String [][]value adds a collection bucket style, for which you specify the label, the style name, and the values for each bucket. ■ addColorSchemeStylejava.lang.String name, java.lang.String baseColor, java.lang.String strokeColor, java.lang.String low, java.lang.String high, int nbuckets adds a color scheme style with equal intervals, for which you specify the color parameters, the range values, and the number of buckets. ■ addColorSchemeStylejava.lang.String name, java.lang.String baseColor, java.lang.String strokeColor, java.lang.String []label, java.lang.String []low, java.lang.String []high adds a color scheme style, for which you specify the color parameters and the range values. ■ addColorStylejava.lang.String name, java.lang.String stroke, java.lang.String fill, int strokeOpacity, int fillOpacity adds a color style with the specified color parameters. ■ addImageAreaStyleFromURLjava.lang.String styleName, java.lang.String imgURL adds a GIF or JPEG image as an area symbol to the MapViewer client. ■ addImageAreaStyleFromURLjava.lang.String styleName, java.lang.String imgURL, java.lang.String lineStyle adds a GIF or JPEG image as an area symbol to the MapViewer client. You can also specify parameters for stroking the boundary of the area being filled. ■ addImageMarkerStyleFromURLjava.lang.String styleName, java.lang.String imgURL, java.lang.String strokeColor, float strokeWidth, int strokeOpacity adds a GIF image as a marker symbol to the MapViewer client. ■ addImageMarkerStyleFromURLjava.lang.String styleName, java.lang.String imgURL adds a GIF image as a marker symbol to the MapViewer client. You can also specify parameters for the desired width and height of the image when applied to features on a map, as well as the font properties of any text label that will go inside or on top of the marker. ■ addImageMarkerStyleFromURLjava.lang.String styleName, java.lang.String imgURL adds a GIF image as a marker symbol to the MapViewer client. ■ addImageMarkerStyleFromURLjava.lang.String styleName, java.lang.String imgURL, int desiredWidth, int desiredHeight, java.lang.String fontName, int fontSize, java.lang.String fontStyle, java.lang.String fontWeight, java.lang.String fontColor adds a GIF image as a marker symbol to the MapViewer client. You can also specify parameters for the desired width and height of the image when applied to features on a map, as well as the font properties of any text label that will go inside or on top of the marker. ■ addLineStylejava.lang.String name, java.lang.String fill, java.lang.String strokeWidth, boolean hasBase, java.lang.String baseFill, java.lang.String baseStroke, java.lang.String baseDash, boolean hasParallel, java.lang.String fillParallel, java.lang.String strokeParallel, boolean hasHashMark, java.lang.String fillHash, java.lang.String dashHash adds a line style to the MapViewer client. 4-10 Oracle Fusion Middleware Users Guide for Oracle MapViewer ■ addLineStylejava.lang.String name, java.lang.String fill, java.lang.String strokeWidth, boolean hasBase, java.lang.String baseFill, java.lang.String baseStroke, java.lang.String baseDash, boolean hasParallel, java.lang.String fillParallel, java.lang.String strokeParallel, boolean hasHashMark, java.lang.String fillHash, java.lang.String dashHash, java.lang.String measureMarker, double measurePosition, int measureSize adds a line style to the MapViewer client. ■ addMarkerStylejava.lang.String name, int mktype, java.lang.String strokeColor, java.lang.String fillColor, java.lang.String markerWidth, java.lang.String markerHeight, java.lang.String coords, java.lang.String radius adds a vector marker style with the given parameters. The available vector marker style types are MARKER_POLYGON, MARKER_POLYLINE, MARKER_CIRCLE, and MARKER_ RECT. ■ addTextStylejava.lang.String name, java.lang.String style, java.lang.String family, java.lang.String size, java.lang.String weight, java.lang.String fill adds a text style with the specified parameters. ■ addVariableMarkerStylejava.lang.String name, java.lang.String []label, java.lang.String baseMarker, int startSize,int increment, java.lang.String []low, java.lang.String []high adds a variable marker style, for which you specify the parameters for the base marker, and also the label and the values for each bucket. You can remove a dynamically defined style from the current map request by calling the deleteStylejava.lang.String name method, or you can remove all dynamically defined styles from the current map request by calling the removeAllDynamicStyles method.

4.3.5 Manipulating Themes in the Current Map Request