Hi Larry, Yeah I've sorted it!
The problem was that I needed to remove the var from the defining of the "map" and "venue1" etc. Sorted now. I have one final question, which I'm sure you'll be able to answer easily. You see how when you click on my markers it centers around the marker and displays the info.... well when I click on the next marker the previous markers info box stays open. How do I get it to close when the next marker is clicked? Massive thanks for your help! On Jun 22, 2:57 pm, "[email protected]" <[email protected]> wrote: > On Jun 22, 6:45 am, CWR2010 <[email protected]> wrote: > > > That doesn't seem to want to work. I'm wondering if I actually need to > > be called something like map.setCenter(venue3) instead of using the co- > > ordinates aswell. > > That would probably be easier to maintain. Don't know why it isn't > working for you. > > Change that. I got a javascript error: 'map' is undefined, one time, > then it looks like it is now working. > > -- Larry > > > > > > > On Jun 22, 1:46 pm, "[email protected]" <[email protected]> > > wrote: > > > > On Jun 22, 5:20 am, CWR2010 <[email protected]> wrote: > > > > > Cheers Larry. > > > > > I've figured out out to do it with API V2. See it working > > > > here:http://www.rjt-online.com/shows_new_test2.php > > > > > The problem is, since I figured that out, I thought I would try my > > > > hand with API V3 for the Streetview functionality. Now the code I have > > > > added in my buttons doesn't work (the "onclick: map.setCenter" etc.). > > > > Any idea of a simple alteration I could make to use it with V3? Here > > > > is my page with my V3 code > > > > -http://www.rjt-online.com/shows_new_test3.php > > > > [untested] > > > The v3 setCenter method is setCenter... > > > setCenter(latlng:LatLng) > > > but it only takes one argument, to set the zoom, use setZoom: > > > setZoom(zoom:number) > > > > GLatLng doesn't exist in v3, use google.maps.LatLng > > > > onclick="map.setCenter(new GLatLng(54.966739,-1.602588), 14); > > > animatedcollapse.toggle('show3')" > > > > would be: > > > onclick="map.setCenter(new google.maps.LatLng(54.966739,-1.602588); > > > map.setZoom(14); animatedcollapse.toggle('show3')" > > > > -- Larry > > > > > Thanks > > > > > On Jun 21, 10:10 pm, "[email protected]" <[email protected]> > > > > wrote: > > > > > > On Jun 21, 1:36 pm, CWR2010 <[email protected]> wrote: > > > > > > > Thanks for the help Larry. > > > > > > > I worked through those tutorials earlier and attempted to get it up > > > > > > and running, which I did (with a sidebar). > > > > > > > How would I go about using my current buttons (the lines that say > > > > > > Cotherstone Village Hall etc) to setCenter on the markers, rather > > > > > > than > > > > > > a sidebar? > > > > > > Look at how those tutorials work. You need to add the appropriate > > > > > code and html to your current "buttons" to open the infowindow of the > > > > > associated marker (or if you want center the map on the associated > > > > > marker). It might make sense to modify the way your page works to out > > > > > put the information to create your "buttons" into xml (making the > > > > > assumption that it is coming out of some kind of a database), then > > > > > doing something like: > > > > > The Basics - Part 3 Loading the data from an XML > > > > > filehttp://econym.org.uk/gmap/basic3.htm > > > > > > or the "Store Locator" tutorial, just formating the "sidebar" as your > > > > > "buttons" are now. > > > > > > > As I say, I'm a novice with this so I'm really grateful for any > > > > > > help. > > > > > > We were all novices at one point. > > > > > > -- Larry > > > > > > > On Jun 21, 4:11 pm, "[email protected]" <[email protected]> > > > > > > wrote: > > > > > > > > On Jun 21, 6:31 am, CWR2010 <[email protected]> > > > > > > > wrote: > > > > > > > > > Hi folks. I'm new to this group so bear with me for a moment. > > > > > > > > This is > > > > > > > > the first website I've ever designed so I'm a novice at this. > > > > > > > > > I'm working on a website page (http://www.rjt-online.com/ > > > > > > > > shows_new_test2.php) at the minute that requires google maps to > > > > > > > > be > > > > > > > > interactive and for it to change location automatically when > > > > > > > > you click > > > > > > > > on different "Gig/Show" listings. > > > > > > > > > As you can see from the link, I have managed to figure out how > > > > > > > > to add > > > > > > > > an interactive google map to my page with a set location and > > > > > > > > figured > > > > > > > > out how to add markers. I would like the map to center around > > > > > > > > different markers when you click on different shows (so when > > > > > > > > you click > > > > > > > > on the show that says "Cotherstone Village Hall" it will center > > > > > > > > around > > > > > > > > the marker for Cotherstone Village Hall... then when you click > > > > > > > > on O2 > > > > > > > > Academy, it will center around the marker for O2 Academy). > > > > > > > > > As I say I'm a novice, so any help would be greatly appreciated. > > > > > > > > You have errors in the non-maps related code (the facebook and > > > > > > > twitter > > > > > > > code). > > > > > > > > Have you seen Mike Williams' tutorial?http://econym.org.uk/gmap/ > > > > > > > > In particular the page: > > > > > > > The Basics - Part 2 Adding a clickable > > > > > > > sidebarhttp://econym.org.uk/gmap/basic2.htm > > > > > > > > That is an example of how to make a clickable sidebar that opens > > > > > > > infowindows on the markers. If you don't need the infowindows, > > > > > > > just > > > > > > > center the map ( .setCenter() ) on the appropriate marker rather > > > > > > > than > > > > > > > opening the infowindow. > > > > > > > > -- Larry > > > > > > > > > I'm basing this functionality off a flash widget that can be > > > > > > > > seen here > > > > > > > > (www.rjt-online.com/shows.php) if you need to know what I'm > > > > > > > > trying to > > > > > > > > achieve. > > > > > > > > > Thanks- Hide quoted text - > > > > > > > > - Show quoted text -- Hide quoted text - > > > > > > > > - Show quoted text -- Hide quoted text - > > > > > > > - Show quoted text -- Hide quoted text - > > > > > > - Show quoted text -- Hide quoted text - > > > > > - Show quoted text -- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Google Maps API" 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-api?hl=en.
