Class MVThemeBasedFOI
MVThemeBasedFOI defines a theme based FOI layer. A theme based FOI layer displays a collection of interactive features of interest (FOIs) that meet certain query criteria specified in a predefined MapViewer theme. The geographic entities (geometries), non-geographic attributes and rendering styles of the theme based FOI layer are all stored in the database and served by the FOI server, which is a servlet running as part of the MapViewer server. The typical FOI server URL is http://hostname:port/mapviewer/foi.
Constructor Attributes | Constructor Name and Description |
---|---|
MVThemeBasedFOI(layerName, theme, FOIServerURL)
|
Method Attributes | Method Name and Description |
---|---|
abort()
This method aborts current server side theme rendering.
|
|
addEventListener(eventType, listener)
This method is deprecated.
|
|
addStyle(style)
Adds a dynamically created style to be used by this theme based FOI layer.
|
|
attachEventListener(eventType, listener)
This method attaches an event listener to the theme-based FOI layer.
|
|
This method automatically adjusts the map center so that the map is centered
at the center of the theme minimal bounding box.
|
|
deHighlight(foiIdArray)
This method changes the FOIs, which are specified by an array of FOI IDs, from highlighted status to non-highlighted status.
|
|
Deletes all previously added dynamic styles.
|
|
deleteStyle(style)
Deletes a previously added style object
|
|
detachEventListener(eventType, listener)
This method detaches an event listener that has previously been attached to the map by #attachEventListener.
|
|
enableAutoWholeImage(autoWholeImage, wholeImageThreshold, clickableThreshold)
This method sets whether to let mapviewer automatically decide when to render the theme
as a whole image and when to disable FOI clicking.
|
|
enableEventPropagation(enabled)
This method enables event propagation from the theme based FOI layer.
|
|
enableHighlight(enabledOrNot, clickHilite)
This method enables or disables highlighting individual FOIs of the theme.
|
|
enableImageCaching(enable)
This method sets whether to turn on FOI image caching.
|
|
enableImageRendering(enable)
This method sets whether to render and display polygon or polyline FOI images
on the map.
|
|
enableInfoTip(enabled)
This method enables or disables the display of information tips when the mouse moves over
FOIs that belong to the theme-based FOI layer.
|
|
enableInfoWindow(enabled)
This method enables or disables the display of the information window when the used clicks on
FOIs that belong to the theme-based FOI layer.
|
|
enableInfoWindowForMouseOver(enabled)
This method enables or disables the display of the information window when the mouse moves
over FOIs that belong to the theme-based FOI layer.
|
|
enableLabels(enable)
This method sets whether to render polygon FOI images with labels.
|
|
enableMarkerSequence(enabled, type)
This method turns on or off sequence for point FOIs.
|
|
enableMultiFeatureMarker(enabled)
This methods sets whether to enable multi-feature markers.
|
|
Get all previously added dynamic styles.
|
|
This method gets the currently set filtering geometry.
|
|
This method gets all theme-based FOI data entries that belong to the theme-based FOI
layer and are displayed on the map.
|
|
This method gets the data entries of the highlighted FOIs.
|
|
This method gets the name of theme based FOI layer, which is specified when
creating a new MVThemeBasedFOI object.
|
|
getMBR()
This method gets the mininum bounding box of all features currently being displayed.
|
|
This method gets the query window used to fetch FOI data.
|
|
getStyleByName(Style)
Get a previously added dynamic styles by given name.
|
|
This method gets the name of the theme.
|
|
highlight(foiIdArray)
This method highlights the FOIs which are specified by an array of FOI IDs.
|
|
This method gets the visibility of the theme-based FOI layer.
|
|
Return whether the theme is currently displayed as a whole image.
|
|
reDraw(foi)
Redraw an FOI or the whole theme based FOI layer without refetching
FOI data from the server side.
|
|
refresh(zoomToTheme)
This method refreshes a theme-based FOI layer.
|
|
setAutoRefresh(enabled)
This method sets whether to automatically refresh the theme-based FOI layer
when the map is panned or recentered.
|
|
setBoundingTheme(enabled, recenterOnly)
This method set whether to make the theme defined in the MVThemeBasedFOI object
a bounding theme.
|
|
setBringToTopOnMouseOver(enabled)
This method specifies whether to bring FOI images to the top of the map when the mouse moves over
FOI images belonging to the theme-based FOI layer.
|
|
setClickable(enabled)
Enables or disables theme-based FOI clicking.
|
|
setEventListener(eventType, listener)
This method is deprecated.
|
|
setFilteringGeom(geom)
This method sets the filtering geometry that can be used in highlight-only
mode.
|
|
setHighlightMarkerImage(imageURL, width, height)
This method enables an application to use a custom image, instead of an image rendered by the
FOI server, as the FOI marker image when it is highlighted.
|
|
setHighlightMode(mode)
This method specifies the mode for mouse click highlighting the FOI.
|
|
setHighlightOnly(enabled)
This method toggles this theme based FOI layer between regular and
highlight-only mode.
|
|
setHighlightStyle(highliteStyle)
This method specifies the rendering style of the highlighted FOIs.
|
|
setImageFormat(format, bgColor)
This method sets the image format and background color to be used to render
FOI images.
|
|
setInfoWindowStyle(style, styleParameters)
The function sets the style of the information window displayed when
the theme-based FOI layer is clicked.
|
|
setInfoWindowTitle(title)
By default, the FOI name is displayed as the info window title.
|
|
setLabelLanguageCode(lang_code)
Some pre-defined themes may have their label texts translated into
multiple languages.
|
|
setLayoutCustomizer(customizer)
This method assigns a custom FOI display function to the theme-based FOI layer.
|
|
setMarkerImage(imageURL, width, height)
This method enables an application to use a custom image, instead of an image rendered by the
FOI server, as the FOI marker image.
|
|
setMaxVisibleZoomLevel(maxZoom)
This method sets the maximum zoom level at which the layer is enabled and visible.
|
|
setMaxWholeImageLevel(maxLevel)
This method sets the maximum zoom level on which the theme is rendered as
a whole image, instead of individual FOI images.
|
|
setMinClickableZoomLevel(level)
set the minimal zoom level that them-based FOIs are clickable.
|
|
setMinVisibleZoomLevel(minZoom)
This method sets the minimum zoom level at which the layer is enabled and visible.
|
|
setMouseCursorStyle(cursorStyle)
This method sets the mouse cursor style when the mouse is over the theme based
FOI layer.
|
|
setNSDP(nsdp)
Sets the Non-Spatial Data Provider object on this FOI layer.
|
|
setOpacity(opacity)
This method sets the opacity for theme.
|
|
setQueryParameters(vararg)
This method sets the query parameters for the theme-based FOI layer that is based on
a templated predefined theme.
|
|
setQueryWindowMultiplier(multiplier)
This method sets the size multiplier of the query window used to query the theme-based FOI layer.
|
|
setRenderingStyle(styleName, styleName)
Sets the name of an overriding rendering style to be used by the
predefined-theme associated with theme-based FOI.
|
|
setScreenOffset(xOffset, yOffset)
This method sets the screen display offset of the FOIs.
|
|
setVisible(visibility)
This method sets the visibility of the theme-based FOI layer.
|
|
zoomToFeatures(Array)
Adjust the map center and zoom level to best display given FOIs.
|
|
This method automatically adjusts the map center and zoom level so that all
theme features can be displayed inside the map window.
|
- Parameters:
- {String} layerName
- layerName is a string that uniquely identifies the theme-based FOI layer.
- {String} theme
- theme is a string that specifies the predefined theme on which this theme-based FOI layer is based. It is specified in the form data-source-name.theme-name, where theme-name is the name of the predefined MapViewer theme and data-source-name is the name of the MapViewer data source in which the theme is defined.
- {String} FOIServerURL
- FOIServerURL is an optional parameter. It is a string that specifies the URL of the FOI server, which should be in the form http://host:port/mapviewer/foi. If you omit this parameter, its value is derived from the MapViewer base URL.
- Returns:
- The newly created ThemeBased FOI object.
- Returns:
- None
- Parameters:
- eventType
- listener
- Parameters:
- {Object} style
- the style object created by the client
- Returns:
- None
The event type can be any of the following:
- MVEvent.BEFORE_REFRESH event is fired just before a theme-based FOI is to be refreshed from server.
- MVEvent.AFTER_REFRESH event is fired after the theme-based FOI layer has been refreshed from the server.
- MVEvent.MOUSE_CLICK, MVEvent.MOUSE_RIGHT_CLICK, MVEvent.MOUSE_OUT, MVEvent.MOUSE_OVER and MVEvent.MOUSE_MOVE events are fired when the corresponding mouse action is performed on an FOI of this layer.
The MVEvent.BEFORE_REFRESH and MVEvent.AFTER_REFRESH listener functions should not have any parameter.
Other event listener functions should declare three parameters in the following order: (1) a point geometry that will contain the coordinate of the mouse click specified in map data coordinate system, (2) an FOI data entry object that will contain the attributes of the FOI object (see the MVThemeBasedFOI.getFOIData method) that you clicked on. MapViewer will construct and pass the actual values for these parameters into your listener function, and (3) the actual mouse event object that you can use in your function.
- Parameters:
- {String} eventType
- eventType is one of the following string values identifying the event type: MVEvent.BEFORE_REFRESH, MVEvent.AFTER_REFRESH, MVEvent.MOUSE_CLICK, MVEvent.MOUSE_RIGHT_CLICK, MVEvent.MOUSE_MOVE, MVEvent.MOUSE_OVER or MVEvent.MOUSE_OUT.
- {Function} listener
- listener is a reference to the JavaScript listener function.
- Returns:
- None
- Returns:
- None
- Parameters:
- {Array} foiIdArray
- an array of FOI IDs, and those FOIs will be changed from highlighted status to non-highlighted status. All highlighted FOIs will be changed to non-highlighted status if it is omitted.
- Returns:
- None
- Returns:
- None
- Parameters:
- {Object} style
- the style object created by the client
- Returns:
- None
- Parameters:
- {string} eventType
- one of the following string values identifying the type of event listener: MVEvent.BEFORE_REFRESH, MVEvent.AFTER_REFRESH, MVEvent.MOUSE_CLICK, MVEvent.MOUSE_RIGHT_CLICK, MVEvent.MOUSE_OVER or MVEvent.MOUSE_OUT.
- {string} listener
- specifying the listener function.
- Returns:
- None
Rendering the theme as a whole image reduces the number of individual images rendered by the server and displayed by the client. Disabling FOI clicking reduces the amount of data transferred from server and simplies client rendering. Doing both together can effectively improve theme rendering performance when the theme has a very large number of features that need to be rendered on the client side.
The only drawback of rendering the theme as a whole image is that it blocks mouse interaction of other themes beneath it.
Mapviewer decides when to render the theme as a whole image and when to disable FOI clicking based on the number of rendered features. You can customize the criteria used by mapviewer with two parameters. Mapviewer has its own default criteria, which is used when these two parameters are not specified.
- wholeImageThreshold The theme is rendered as a whole image when the number of rendered features is greater than wholeImageThreshold. The defult value used by mapviewer is 750 for point themes and 150 for non-point themes.
- clickableThreshold The theme is rendered as clickable when the number of rendered features is greater than clickableThreshold. The default value used by mapviewer is 6000 for point themes and 3500 for non-point themes.
- Parameters:
- {boolean} autoWholeImage
- a boolean that specifies whether to let mapviewer automatically decide when to render the theme as a whole image and when to disable FOI clicking.
- {int} wholeImageThreshold
- An integer. The theme is rendered as a whole image when the number of rendered features is greater than wholeImageThreshold..
- {int} clickableThreshold
- An integer. The theme is rendered as clickable when the number of rendered features is greater than clickableThreshold.
- Returns:
- None
- Parameters:
- {boolean} enabled
- true (enable event propagation) or false (disable event propagation).
- Returns:
- None
- Parameters:
- {boolean} enabledOrNot
- a boolean value which indicates whether or not to enable highlighting the FOI.
- {boolean} clickHilite
- a boolean value which indicates whether or not to enable mouse click highlighting.
- Returns:
- None
- Parameters:
- {boolean} enable
- true (FOI image caching on) or false (FOI image caching off).
- Returns:
- None
- Parameters:
- {boolean} enable
- true (render FOI iamges) or false (do not render FOI images).
- Returns:
- None
- Parameters:
- {Boolean} enabled
- enabled is a Boolean true (enable the display of information tips) or false (disable the display of information tips).
- Returns:
- None
- Parameters:
- {Boolean} enabled
- enabled is a Boolean true (enable the display of the information window) or false (disable the display of the information window).
- Returns:
- None
- Parameters:
- {Boolean} enabled
- enabled is a Boolean true (enable the display of the information window for mouse over) or false (disable the display of the information window for mouse over).
- Returns:
- None
- Parameters:
- {boolean} enable
- true (render FOI label) or false (do not render FOI label).
- Returns:
- None
- Parameters:
- {boolean} enabled
- a boolean that specifies whether to turn on sequence number
- {String} type
- an optional String that specifies the type of sequence number. It can be either "N" (numerical) or "A" (Alphabetic).
- Returns:
- None
- Parameters:
- {Boolean} enabled
- true (enable multi-feature markers) or false (disable multi-feature markers).
- {Object} options.
- An object that that may have up to three attributes, style, listHeight and listWidth. style specifies the multi-feature marker style. listHeight and listWidth specify the max size of the popup window.
- Returns:
- None
- Returns:
- The array of Style object
- Returns:
- currently set filtering geomtery object.
The returned FOI data entries are specified by an array, each element of which specifies one FOI data entry, which has the following attributes:
- id: id is a string that uniquely identifies the FOI data entry.
- name: name specifies the name of the FOI data entry.
- gtype: gtype specifies the geometry type of the FOI.
- X: X specifies the X coordinate of the FOI location in the coordinate system of the map data.
- Y: Y specifies the Y coordinate of the FOI location in the coordinate system of the map data.
- width: width specifies the width (in screen pixels) of the FOI image.
- height: height specifies the height (in screen pixels) of the FOI image.
- attrs: attrs is an array that specifies the remaining FOI attributes.
- attrnames: attrnames is an array that specifies the names of the FOI attributes stored in attrs.
- hidden: is a boolean the specifies whether this FOI should be hidden or visible.
Theme data is loaded asynchronously. As the result, theme data might not have been loaded right after theme is added to the MVMapView instance or MVThemeBasedFOI.refresh is called. To ensure the theme data has been loaded when calling this method, you should call it inside a theme AFTER_REFRESH listener.
- Returns:
- The array of FOI data entries.
- Returns:
- None
- Returns:
- The name of the theme based FOI layer.
- Returns:
- An MVSdoGeometry object that specifies the layer MBR, using the coordinate system associated with the map data.
- Returns:
- An MVSdoGeometry object that specifies the query window, using the coordinate system associated with the map data.
- Parameters:
- {String} Style
- name
- Returns:
- a Style object
- Returns:
- The name of the theme
- Parameters:
- {Array} foiIdArray
- an array of FOI IDs, and those FOIs will be highlighted. All FOIs, which are returned from the server currently, will be highlighted if it is omitted.
- Returns:
- None
- Returns:
- true if the theme-based FOI layer is currently visible, false if the theme-based FOI layer is not currently visible.
- Returns:
- True if the theme is displayed as a whole image theme, false otherwise.
- Parameters:
- {FOI} foi
- The FOI data object to be redrawn. The whole layer will be redrawn if this parameter is null or omitted.
- Returns:
- none
- Parameters:
- {Boolean} zoomToTheme
- a Boolean that specifies whether the map is to be zoomed to covers all features of the refreshed theme. If set to true, the zoom level and the center of the map is adjusted to cover all features of the refreshed theme.
- Returns:
- None
- Parameters:
- {Boolean} enabled
- enabled is a Boolean true (the theme-based FOI will be refreshed when the map is panned or recentered) or false (he theme-based FOI will not be refreshed when the map is panned or recentered).
- Returns:
- None
- Parameters:
- {Boolean} enabled
- a boolean value that specifies whether to make the theme
- {Boolean} recenterOnly
- a boolean value that specifies whether to only recenter the map. If true, the map will be only recentered to the center of the theme without changing the current zoom level. a bounding theme.
- Returns:
- None
- Parameters:
- {Boolean} enabled
- a Boolean true (bring FOI images to the top) or false (do not bring FOI images to the top).
- Returns:
- None
- Parameters:
- {Boolean} enabled
- enabled is a Boolean true (theme-based FOI is clickable) or false (theme-based FOI is not clickable).
- Returns:
- None
- Parameters:
- eventType
- listener
- Parameters:
- {Object} geom
- the filtering geometry; must be a MVSdoGeometry instance.
- Returns:
- None
- Parameters:
- {String} imageURL
- imageURL is a string that specifies the URL of the user-defined marker image.
- {int} width
- width is an integer that specifies the width of the marker.
- {int} height
- height is an integer that specifies the height of the marker.
- Returns:
- None
When you invoke #highlight to programmatically highlight FOIs, you will always be in the "multiple" highlighting mode.
- Parameters:
- {String} mode
- A string which specifies the mode for highlighting the FOI. It can be either "single" or "multiple".
- Returns:
- None
The highlight style is typically specified on the pre-defined theme's definition (set through the Map Builder tool). But you can also use the setRenderingStyle() method of this class to set the name of the highlight style at run time.
When this flag is set to false (the default value), this object behaves as a regular theme based FOI layer. When set to true, you must also set a filtering geometry and an optional rendering style before adding this object to your MVMapView handle.
Note that this method is only applicable to pre-defined theme based FOI layers. It has no effect on JDBC (Dynamic) theme based FOI. It is also advised that the pre-defined theme itself should not contain any binding variables in its query condition.
If you wish to highlight a JDBC theme based FOI layer, one approach is to simply modify the JDBC theme's query to include a SDO_FILTER clause. The SDO_FILTER clause will need the filter geometry's cooridnates which can be obtained from the Redline tool (or whatever tool you used to generate/draw the filtering geometry). Don't forget to add the "asis" attribute to your JDBC theme definition and set its value to "true" so that MapViewer will not attempt to add additional spatial filtering of its own.
- Parameters:
- {boolean} enabled
- true (highligh-only mode) or false (regular mode).
- Returns:
- None
- Parameters:
- {Object} highliteStyle
- A string or style object which specifies the rendering style of the highlighted FOIs.
If it is a string, the string should be in the form of
. , where is the name of the style which is defined in the USER_SDO_STYLES view, and is the name of the data source in which the style is defined. If it is a style object, it should be of type MVStyleMarker, MVStyleColor and MVXMLStyle etc.
- Returns:
- None
The image format can be either png8 or png24. Png8 is faster especially with IE, but it only supports 256 colors and does not support semi-transparency. Png24 supports semi-transparency and much richer colors. The default FOI image format is png24.
You can also specify the image background color if the image format is png8. The color should in defined in the form of "#rrggbb". The background color will be made transparent in the result images. Therefore you should choose a color that is not used in the FOI image foreground. The default background color is #a8a8a9.
- Parameters:
- {String} format
- the FOI image format.
- {String} bgColor
- the background color for png8.
- Returns:
- None
- Parameters:
- {String} style
- the name of the info window style; possible values are "MVInfoWindowStyle1", "MVInfoWindowStyle2" and "MVInfoWindowStyle3".
- {Object} styleParameters
- the object that specifies the custom style parameters, which are effective only when the info window style is "MVInfoWindowStyle1". Please refer to MVMapView#setDefaultInfoWindowStyle for more information.
- Returns:
- None
- Parameters:
- {String} title
- the info window title string.
- Returns:
- None
- Parameters:
- lang_code
function customizer (foi) { foi.html = foi.attrs[1]; foi.xoffset = 14; foi.yoffset = 14; }
- Parameters:
- {Function} customizer
- the custom FOI display function
- Returns:
- None
- Parameters:
- {String} imageURL
- imageURL is a string that specifies the URL of the user-defined marker image.
- {int} width
- width is an integer that specifies the width of the marker.
- {int} height
- height is an integer that specifies the height of the marker.
- Returns:
- None
- Parameters:
- {int} maxZoom
- maxZoom is a integer that specifies the minimum zoom level.
- Returns:
- None
Rendering the theme as a whole image reduces the number of individual images rendered by the server and displayed by the client. It is a very effective way to improve theme rendering performance when the theme has a very large number of features that need to be rendered on the client side.
The only drawback of rendering theme as a whole image is that it blocks mouse interaction of other themes beneath it.
- Parameters:
- {int} maxLevel
- maxLevel is a number that specifies the maximum whole image theme level.
- Returns:
- None
Disabling theme clicking greatly reduces the amount of data transferred from server to cient and simplies client rendering. When used with whole image theme rendering, it can effectively improve theme rendering performance when the theme has a very large number of features that need to be rendered on the client side.
- Parameters:
- {int} level
- level is an number that define the minimal theme-based FOIs clickable zoom level.
- Returns:
- None
- Parameters:
- {int} minZoom
- minZoom is a integer that specifies the minimum zoom level.
- Returns:
- None
- Parameters:
- {String} cursorStyle
- A string that specifies the cursor style to be used, which must be one of the standard CSS cursor style names such as "crosshair", "pointer" and "move".
- Returns:
- None
- Parameters:
- {MVNSDP} nsdp
- the NSDP object containing info needed by the FOI server to join Non-Spatial data and the associated theme's spatial table.
- Returns:
- None
- Parameters:
- {int} opacity
- The parameter opacity should be a number between 0 and 1.
- Returns:
- None
- Parameters:
- vararg
- a list of parameters corresponding to the required number of binding variables in the predefined theme
- Returns:
- None
- Parameters:
- {float} multiplier
- multiplier is a floating point number that specifies the ratio along the X (width) and Y (height) dimensions.
- Returns:
- None
Note that the style will be ignored if this FOI layer is based on a dynamic (JDBC) theme, for which you need to specify its render/label styles through its own element.
- Parameters:
- {String} styleName
- the name of the style to be used as rendering style by the associated theme. Note that it could reference a dynamically created style.
- {String} styleName
- name of the style
- Returns:
- None
- Parameters:
- {int} xOffset
- horizontal offset in screen pixels. Positive value shifts the FOIs towards right and negative value shifts the FOIs towards left.
- {int} yOffset
- vertical offset in screen pixels. Positive value shifts the FOIs downwards and negative value shifts the FOIs upwards.
- Returns:
- None
- Parameters:
- {Boolean} visibility
- a Boolean true (make the layer visible) or false (make the layer not visible).
- Returns:
- None
- Parameters:
- {Array} Array
- of the FOI data entries
- Returns:
- none
- Returns:
- None