Am I doing things to a map after I first created it, if I only create
it upon clicking the unhide link?
To clearify, I'm not loading the smaller maps via the getMap function
before I click the respective unhide link.
The div in question is already existent and is not resized during the
unhide process, unless changing the display option is actually
considered resizing.
The way I was thinking about this function is this:
the function itself is a once and done thing. It does what it is
supposed to do and then everything is gone. Hence I thought I can call
the same function over and over again to achieve the same effect on
different mapdivs.
As you can see there is an index added to the div-reference (box).
Therefore the function will always work on a new map. If I leave the
marker out, the 'mymap' variable is referenced nowhere again, so it
couldn't be really relevant to the problem as even the first map
(aside from the main map) doesn't display properly.
Feel free to disillusionate me on that sight of things.
In light of that could someone propose a code change which would
incorporate the array approach into this function:
"function getMap(box,latitude,longitude) {
var mylatlng = new google.maps.LatLng(latitude,longitude);
var myOptions = {
zoom: 14,
center: mylatlng,
mapTypeId: google.maps.MapTypeId.HYBRID
};
var mymap = new
google.maps.Map(document.getElementById('CLUB_overlay_map_window_' +
box), myOptions);
var marker = new google.maps.Marker({
position: mylatlng,
map: mymap
});
}"
Cheers and TIA,
Joe
On 15 Jan., 12:46, Rossko <[email protected]> wrote:
> > Does every smaller map have to have an unique map object?
>
> It does, if you want to 'do things' to it or with it after you have
> first created it. (Things like triggering a resize). How else is the
> browser to know what you are trying to act on?
>
> You can keep your map objects in an array to make naming/managing
> easier.
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.