You're defining a function structure() twice, once in history.php and
once in gg_demo.js. Which one gets run will be browser dependant.
> I'm expecting that the map center & zoom level are according to the ones i
> specified when initializing the map.
In the current code, Main() is called inline.
This in turn calls RenderMap() which includes
var latlng = new google.maps.LatLng(0, 0);
var myOptions = {
zoom: 1,
center: latlng, ...
so 0,0 is used when first creating the map.
Main() then goes on to call structure(), and in FF2 at least it runs
the one in history.php
A map 'resize' event is triggered, so your listener sets a 'resize'
variable true.
Eventually, a map 'idle' event is triggered, and as 'resize' is true
focusMap() is called by the listener.
An empty LatLngBounds object is created.
Various self-referencing operations are carried out the indeterminate
bounds, with an end result of bounds that are pretty arbritary.
Then map.fitBounds is called on the arbritary object.
So the map is centred and zoomed at some arbritary place, not of your
selection.