Table of Contents

Sample : Set initial bounds

This example documents how you can set the initial bounds of the viewer.

What basically happens is we :

Sample Setup

zoomToExtent() - zooms to the maximum extent.
zoomToBounds() - zooms to the startup bounds (happens after startup).
You need to upgrade your Flash Player.

Overview

We disable the first view. This (if we wouldn't intervene) means the flash component would show an empty view after startup. We do so specifying the SKIP_FIRST_VIEW FlashVars parameter.

We wait until the component is started and then execute the zoomToBounds function. We do so using the publicInterfaceLoaded function, that is called after the component is loaded. This function also loads the first view, which we disabled previously.

All these operations are executed as a “startup operation” which implies the following :