Sorry, couple of typos in my example code below...
function changeVenue(showVenue) {
// Show the HTML in page content related to venue
var selector = ''#venue'' + showVenue;
jQuery(selector).show();
// Open the appropriate info bubble & rezoom map
mapMarker = ''marker'' + showVenue;
mapMarker.openBubble();
}
So each marker is called markerX - where X is the same value as the
''showVenue'' value passed into the changeVenue() function.
Anyone have any pointers?
Thanks,
Steve
---------- Forwarded message ----------
From: Steve Kirtley <steve.kirtley at gmail.com>
Date: Sat, Mar 5, 2011 at 10:52 PM
Subject: onclick event to show infobubble
To: mapstraction at lists.mapstraction.com
Hi guys,
This should be easy - but I''m falling fowl of global/local scope and my
head
isn''t working properly.
I have used mapstraction to create a Google (v3) map with 5 markers.
Outside of the Gmap I have a list of the locations that correlate with the
markers. When I click one of the links I need the map to open the relevant
infoBubble and to recenter / zoom on that location...
So (using jQuery) have written a simple function:
function changeVenue(showVenue) {
// Show the HTML in page content related to venue
var selector = ''#venue'' + showVenue;
jQuery(selector).show();
// Open the appropriate info bubble & rezoom map
mapMarker = ''marker'' + showVenue
marker1.openBubble();
}
The first part just shows a div in the HTML content of the page.
The second bit is intended to open the relevant info bubble markerx where x
is the ID number passed into the function.
This all fails saying markerx is undefined....
As I say this is probably super simple - but running out of steam this time
of night, any pointers would be much appreciated.
Thanks
Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20110306/4c03a0c9/attachment.htm>