These functions allow you to get info on the current view definition and do something with the view. The following can be used to install a listener on user-initiated view events :
addNewViewListener() and removeNewViewListener() to add or remove listeners for new view events.General view-related functions are :
getViewWidth() and getViewHeight() to retrieve pixel size of the viewgetViewBoundingBox() to retrieve the system bounds of the current view.loadNewView() to force reloading of the view.The following functions can be used to pan (factor is 1/4) :
panLeft(), panRight(), panUp() and panDown() to pan horizonally or vertically.panUpLeft() panUpRight() panDownLeft() panDownRight() to pan diagonally.
You can control the view's zoom level by using the getScaleRangePosition() and setScaleRangePosition() functions. (the scale indicator ranges between 0 (zoomed in) and 1 (zoomed out)). Minimum and maximum scales are defined in the FlashMap map configuration file.
You can also zoom to :
zoomToSelection(): All Selected objectszoomToActiveSelection(): Active selected objectzoomToFocus(): Focus rectangle (See focus info)zoomToExtent(): Full extent (full zoomout)zoomToBoundingBox(): The given bounds (takes object with minX, maxX, minY, maxY fields)Be aware that these functions won't exceed the scale limits.
All of these functions (except the zoomToFocus() and zoomToBoundingBox() which are explicit) are subject to a zoom margin parameter. This parameter, defined in system units, defines an extra margin when zooming to something. It is 0 by default and can be set or retrieved by using the setZoomToMargin() and getZoomToMargin() functions.
You can access OFM's zoom history or navigate between them by using these functions :
previousZoom() and nextZoom() functions and hasPreviousZoom() and hasNextZoom() functions.The first view is often the most important one. By default, OFM zooms to a full overview of the available map data, but there are other options :
See here for an example of telling OFM to skip the first view and then setting it yourself.
printMap() : Print the current view. This directly opens a print dialog and prints the view, to a page.getViewURL(format) to retrieve a URL leading to an image of the current view. (Can for example be used to copy to clipboard using JS).