The overview control is similar to a map control. However, the purpose of the overview map is to provide a point of reference for the area displayed on its associated map control. The overview control always shows the map at full extent. A small box on the overview map represents the currently displayed area on its associated map control. You can interactively move this box around to pan the area displayed in the map control.
The overview control works with WebOverview object. The actual WebOverview object is created by the parent context control. The OverviewEvent object is used by the control to extract the point on the overview map to center the overview rectangle. The OverviewRenderer class renders the control to the appropriate markup, and the OverviewTag class exposes the control as a JSP custom tag named overview.
The overview control works with WebOverview object. The actual WebOverview object is created by the parent context control. The OverviewEvent object is used by the control to extract the point on the overview map to center the overview rectangle. The OverviewRenderer class renders the control to the appropriate markup, and the OverviewTag class exposes the control as a JSP custom tag named overview.
Accessing Overview through WebContext
The WebOverview provides an API to access information about the overview and control its behavior. The examples below offers some common usages:
The WebOverview can be retrieved through the WebContext using the following code snippet:
[Java]
WebContext ctx = WebUtil.getWebContext(FacesContext.getCurrentInstance(), CONTEXTID);
WebOverview ov = (WebOverview)ctx.getWebOverview();
// The WebOverview retrieved from the WebContext can be used
// to retrieve the Overview Functionalities in teh WebContext object
List < OverViewFunctionality > ovf = ov.getOverViewFunctionalities();
The following code shows how to generate the overview map image and retrieve a reference to it, this reference can be a URL or a MIME data string.
[Java]
WebOverview ov = (WebOverview)ctx.getWebOverview();
String ovMap = ov.getImageURL();
The following code shows how to determine the width and height of the area of interest (AOI) box on the overview map. The getImageRectangle() method returns the extent in screen coordinates of the area of interest box representing the current extent of the main map.
[Java]
WebOverview ov = (WebOverview)ctx.getWebOverview();
WebExtent ext = ov.getImageRectangle();
double height = ext.getHeight();
double width = ext.getWidth();