====== Sample : Zoom to the bounds of an object====== This example documents how you can select a number of objects and then zoom to the extent of the selection. What basically happens is we : * Execute a startup operation (implies we zoom to the focus rectangle after execution) * Execute a number of [[flashmap:ios:operation:index|XML Operations]] inside the startup operation (selecting the objects and returning the right focus to the client). ===== Sample Setup =====
zoomToExtent() - zooms to the maximum allowed extent.
zoomToObjects() - zooms to objects with attribute OIDN set to 5681 or 5690.
You need to upgrade your Flash Player.
===== Overview ===== ==== Zoom To Extent ==== var ofm; this.zoomToExtent = function() { ofm.zoomToExtent(); } We execute the zoomToExtent() function. ==== Zoom To Object ==== We use a custom startup operation to make the selection : var ofm; this.zoomToObjects = function() { var layer = ofm.getSelectionLayer(); var margin = 10; var operation = "\ \ \ FocusSelection\ "+ layer +"\ \ 1\ \ Attributes\ OIDN\ 5681,5690\ false\ \ \ ,\ \ \ \ FocusSelection\ \ \ "+ margin +"\ \ "; ofm.runPlainStartupOperation(operation); } === Overview === We execute the following operations : * SelectObjects : Select the object in a separate selectiongroup named "FocusSelection" * ClearFocus : Clear the existing server-side focus rectangle * AddSelectionToFocus : Add the bounds of the "FocusSelection" selectiongroup to the server-side focus rectangle. * GetFocus : Get the server-side focus rectangle. All these operations are executed as a "startup operation" which implies the following : * A server-side focus rectangle may be returned and will be copied to the client-side focus rectangle. * The client will automatically zoom to the client-side focus rectangle after execution. == Pattern Searches == The attribute value may contain a unix-style wildcard using filename expansion -- also known as "[[http://tldp.org/LDP/abs/html/globbingref.html|globbing]]". By adding the ''false'' tag of the '''' element, you can use wildcards in your attribute values. Example : ''[!-]*'' would match any string not starting with '-'.