Save and restore a view for a Map component

Technote (FAQ)


Question

How do you save and restore a view for a Map component?

Answer

To save the current state of the view, you can get the current visible rectangle of the map by calling getVisibleRectangle() on the map component's Scroller skin part:


visibleRect = map.scroller.getVisibleRectangle();


To restore the view to a previous state, you can get the map component's Scroller skin part then call fitRectangle(rectangle:Rectangle, animate:Boolean = false) with the visible rectangle that you've obtained from the above call:


map.scroller.fitRectangle(visibleRect);


Here is a sample that demonstrates the above technique:


main.zip

The sample allows you to save the current state of the view then restore the view to its saved state after making some modifications to the view. The sample contains four buttons located at the top left corner of the map. The first two buttons are for zooming in and out of the map. The third button is for saving the current state of the map. The last button is for restoring the previous saved state of the map. Also note that to pan the map hold down the "Shift" key then click and drag the map.


Cross reference information
Segment Product Component Platform Version Edition
Business Integration IBM ILOG Elixir General Linux, Mac OS X, Windows 3.0 All Editions

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

IBM ILOG Elixir Enterprise
General

Software version:

3.0, 3.5

Operating system(s):

Linux, Mac OS, Windows

Software edition:

All Editions

Reference #:

1600347

Modified date:

2012-07-05

Translate my page

Machine Translation

Content navigation