Chapter 12 — The Realtors and Archaeologists Toolkit 247
Then you set the initial timeout, either by calling this function within onLoad()or by calling
the setTimeout()method on the windowobject within onLoad(); the effect is the same:
window.setTimeout(‘recenter()’,60000);
Resetting the Object Opacity
One final element of convenience is to ensure that the overlay is visible when the user changes
between map types. For example, when changing from satellite to map, it can be useful to get
reacquainted with the position of the new office block on the map. To achieve this, another lis-
tener is added to the map. This one is triggered each time the map type is changed, and it
explicitly resets the opacity of the overlay image:
GEvent.addListener(map, ‘maptypechanged’, function() {
photo.setOpacity(50);
opacity = 50;
});
Final Overlay Application
The final map application can be seen in Figure 12-11, showing the initial overlay highlighted
on the satellite image of the field, just as shown earlier in the chapter.
FIGURE12-11: Overlay image.