4.2 Functionality
At this point the conceptualized animated zooming scale model is introduced in detail.
The discussion starts with a description of the full zooming process using a zoom slider, followed by a description of the special features of the ZoomOut process.
Suppose Zn is the current zoom level of the main map, Zmax the maximum ZoomIn level,
and Zmin = 0 as the minimum ZoomOutlevel, for which the following applies:
Z ∈ N and
Zmin ≤ Zn ≤ Zmax
The following steps describe the developed scaling model as well as the exact process involved in using the zoom slider. A state diagram (Figure 4.2) and an activity diagram (Figure 4.2) illustrate this model. The individual steps involved are referenced by the numbers contained in the processes of the activity diagram:
- The user points the mouse on the zoom slider, presses and holds down
the left mouse key. As soon as he/she releases the key, the process is
stopped and completed with Step 8.
- The current zoom level Zn is determined.
- All tiles k within zoom level Zn, which are fully or partially
located in the visible area, as well as all pre-loaded tiles which border
on this area, are determined.
- The user decides on a zoom direction (ZoomIn
or ZoomOut).
- At this point the compatibility of the decision made in (4) with the
current zoom level Zi (in the first round Zi = Zn) is verified, ie. if
Zi = Zmin, respectively
Zi = Zmax, then ZoomOut or ZoomIn
is not possible. In this case, a new zoom direction must be selected (Step 4). Otherwise the process continues with step (6).
- The corresponding zoom-scale process occurs in tandem with the zoom slider operation (in the direction chosen in (4)):
- a) New zoom slider position Pi is determined.
- b) New zoom level Zi = Z(Pi) is calculated.
- c) New (scaled) tile size K(Zi) of the current zoom level Zi is calculated on the basis of Zn. The following rules apply:
K(Zi) = 2Zi - Zn * K(Zn) f�r
Zn < Zi
K(Zi) = K(Zn) f�r Zn = Zi
K(Zi) = 1 / (2(Zn - Zi) * K(Zn)) f�r
Zn > Zi
Starting with zoom level Zn the tile size K(Zn) is doubled
with every new zoom level (for Zn<Zi; see equation 4.1) or
halved (for Zn>Zi; see equation 4.3) so as to obtain the new
tile size K(Zi) for the currently active zoom level Zi. At
equal zoom levels (Zn=Zi) the tile sizes are of equal size (see
equation 4.2).
Note: The individual zoom levels serve only as defined interim
values. The actual scaling process occurs continuously.
- d) During the ZoomIn or ZoomOut process
all currently loaded (visible and non-visible) tiles are scaled to
the calculated tile size K(Zi) (more accurately: expanded or
shrunk).
- e) Only for ZoomOut:
As soon as all tiles k (as defined in (3)) are sized to a
level where all are part of the visible area, additional tiles must
be loaded in the background to avoid the creation of a white border
during ZoomOut.
A more detailed discussion on tile preloading in ZoomOut processes
is provided in the following paragraph »Special Features of
ZoomOut«.
- As long as the left mouse key is held down (see Step 1), the user can
change the zoom direction at any time, which brings the process back to (4).
Once the mouse key is released, the zoom process is completed with (8).
- The visible area is redrawn in the new zoom level Zi including all
required tiles (using standard tile size K(Zn)). In addition (according
to the principles outlined in the tiling method; see Section
2.3.5), all adjacent non-visible tiles are preloaded at
the same size. This completes the zoom process.
State Diagram of Zoom Process Using Slider
Activity Diagram of Zoom Process Using Slider
Two solutions regarding the preloading of tiles in Steps 6e of the zoom process are introduced. The objective is to ensure quick tile loading (ie. without delay) and thereby eliminate the creation of a white border around a now smaller map.
- A) As soon as a previously non-visible tile of k
becomes part of the visible area, all non-visible tiles are newly
defined and preloaded in the background at zoom level Zn.
They are stored as new, non-visible tiles in the DOM tree. All
loaded tiles are immediately adjusted to thr current scale, ie.
they are simultaneously adjusted to the same scale as the remaining tiles
(where the calculated tile size is K(Zi)).
The disadvantage: the zooming process requires a continuous loading of a
large number of tiles which also have to be scaled in accordance with the
remaining tiles. Therefore it is likely that performance is negatively
impacted by an increased number of tiles.
- B) A special feature of the second solution is a
newly defined »ZoomOut tile«. In addition to the tiles k described
in Step 3, during initialization of the application one
additional tile k* is loaded for the purpose of executing the Zoom Out
process.
k* shows the geographic dimension of the complete map on one tile.
The pre-defined tile pixel size K* of k* is to be larger than the pr-edefined tile size Kk of all tiles k by a factor of x:
K* = x * Kk, whereby
x ≥ 1
and
x ∈ R. A suitable value for x is dependent on the size of the whole map as well as the number of possible zoom levels; it is determined in the implementation (see Section 5.2.3).
The center of the whole map is the geographic center of k*.
The objective of this approach is to reduce the time-consuming reloading
of tiles during a on-the-fly zoom-out procedure (featured in Solution (A)).
Instead, k* is used as a kind of base tile, with which the majority of
the scale processes can be executed. This way, it is no longer necessary
to keep loading and scaling new tiles in order to »fill in« the white
area that would otherwise appear, especially since the high level of
detail on these tiles is not even required for ZoomOut scaling.
At a certain level of magnification, however, the extensive
»pixelation« of k* will be a disadvantage. Depending on the zoom
level intervals this can lead to an inability to identify map sections
during high-scale processes.
© June 1, 2007 |
Emanuel Schütze |
some rights reserved.
This work is licensed under the Creative Commons License
Attribution-ShareAlike 2.0 Germany.