Manipulating Themes in the Current Map Request

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

After you add themes using any of the methods that start with add, you can manipulate them, performing such operations as listing their names, moving them up or down in rendering order for the current request, and even disabling themes and enabling themes that had been disabled. However, you cannot manipulate themes that are implicitly included when you set a base map using the setBaseMapName method, because the list of themes in the base map is not actually included until the MapViewer service processes the request. The methods for manipulating themes in the current map request include the following: ■ deleteAllThemes deletes all added themes from the current map request. ■ deleteThemejava.lang.String name deletes an explicitly added theme from the current map request. ■ enableThemesjava.lang.String[] themes enables all themes whose names appear in the supplied list. ■ getActiveThemedouble currentScale gets the name of the active theme, that is, the top theme on the current display map. ■ getEnabledThemes gets a list of all themes that are currently enabled. MapViewer JavaBean-Based API 4-11 ■ getThemeEnabledjava.land.String themeName determines whether or not a specified theme is currently enabled. ■ getThemeNames returns an ordered list of names of themes that have been explicitly added to the current map request. ■ getThemePositionjava.lang.String name returns the position in the rendering sequence of an explicitly added theme. ■ getThemeVisibleInSVGjava.lang.String name determines whether or not a specified theme is currently visible in an SVG map. If the theme is not visible, it is hidden. ■ hasThemes checks to see if the current map request has any explicitly added themes. For example, if you have only set the name of the base map in the current request, but have not added any other theme through one of the addTheme methods, this method returns FALSE. ■ moveThemeDownint index moves a theme down one position in the list of themes to be rendered, so that it is rendered later. ■ moveThemeUpint index moves a theme up one position in the list of themes to be rendered, so that it is rendered sooner. ■ setAllThemesEnabledboolean v sets all themes to be enabled or disabled. ■ setGeoRasterThemePolygonMaskjava.lang.String name,double []coords sets the polygon mask to be applied on the GeoRaster theme. The GeoRaster area outside the polygon mask will be transparent. The coordinates are defined as x1,y1,x2,y2, . . . . The mask coordinates must be in the data coordinate space. ■ setLabelAlwaysOnboolean labelAlwaysOn, java.lang.String name controls whether or not MapViewer labels all features in a theme even if two or more labels will overlap in the display of a theme. MapViewer always tries to avoid overlapping labels. If labelAlwaysOn is TRUE, MapViewer displays the labels for all features even if two or more labels overlap. If labelAlwaysOn is FALSE, when it is impossible to avoid overlapping labels, MapViewer disables the display of one or more labels so that no overlapping occurs. ■ setNetworkThemeLabelsjava.lang.String name, java.lang.String linkLabelStyle, java.lang.String linkLabelColumn, java.lang.String nodeLabelStyle, java.lang.String nodeLabelColumn, java.lang.String pathLabelStyle, java.lang.String pathLabelColumn sets network theme label parameters for links, nodes, and paths. The attribute column name must be an existing attribute of the link, node, and path tables. ■ setThemeAlphajava.lang.String themeName, float alpha sets the transparency value for an image theme. ■ setThemeEnabledboolean v, java.lang.String themeName sets a specified theme to be enabled or disabled in the current map request. ■ setThemeFastUnpicklejava.lang.String name, boolean noUnpickler specifies whether to use the MapViewer fast unpickling algorithm TRUE, the default or the generic JDBC conversion algorithm FALSE to convert SDO_GEOMETRY objects fetched from the database into a Java object accessible to MapViewer. The MapViewer fast unpickling algorithm improves performance, but occasionally the coordinates may lose some precision around 0.00000005, which can be significant in applications where all precision digits of each coordinate must be kept. The generic JDBC conversion algorithm is slower 4-12 Oracle Fusion Middleware Users Guide for Oracle MapViewer than the MapViewer fast unpickling process, but there is never any loss of precision. ■ setThemeOnClickInSVG java.lang.String theme, java.lang.String onClickFunction sets the theme’s onClick function for an SVG map. The onClick function is a JavaScript function defined in the Web page in which the SVG map is embedded. The onClick function is called whenever the SVG map is clicked if both theme feature selection and window selection are disabled. For information about using JavaScript functions with SVG maps, see Appendix B . ■ setThemeScalejava.lang.String name, double minScale, double maxScale sets the minimum and maximum scale values for displaying a theme. ■ setThemeSelectableInSVG java.lang.String theme, boolean sel sets the theme to be selectable TRUE or not selectable FALSE in an SVG map. If the theme is set to selectable, any feature of the theme can be selected in the SVG map by clicking on it. If the feature is selected, its color is changed and its ID its rowid by default is recorded. You can get a list of the ID values of all selected features by calling the JavaScript function getSelectedIdList defined in the SVG map. For information about using JavaScript functions with SVG maps, see Appendix B . ■ setThemeUnitAndResolutionjava.lang.String themeName, java.lang.String unit, double resolution sets the unit and resolution values for an image theme. ■ setThemeVisiblejava.lang.String name, boolean vis sets the theme to be visible TRUE or hidden FALSE in an SVG map. If the theme is set to be hidden, the theme will be still rendered, but will be invisible.

4.3.6 Sending a Request to the MapViewer Service