When working with CMS or templates, the asynchronous load is usually a better fit:
Using the Google AJAX API Loader http://code.google.com/apis/maps/documentation/javascript/v2/basics.html#AJAX_Loader You can use that code with 3[.x] versions and it Just Works. Cheers, Miguel On Tue, Jun 1, 2010 at 15:44, duffnut <[email protected]> wrote: > Sorry Esa for the spam, I did not realise this was a google group, > will open my question to the community: > > I am creating a website for my charity using wordpress and a CMS > theme, so the only way to edit the body tag is to edit the theme > files, and have the onload event in every page (I would have guessed > that was a bad thing, but if not, just let me know). It seems the > solution you suggest is better as I only need maps with markers on 1 > or 2 pages. But I wouldn't know where to put the API object as my > scripting skills are limited to ctrl-c --> ctrl-v for the moment. > > I would like to use Esa's solution, but being a complete novice, I do > not know where to place the object. could someone point out where > using the google tutorial as an example: > > <html> > <head> > <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> > <script type="text/javascript" src="http://maps.google.com/maps/api/js? > sensor=set_to_true_or_false"></script> > <script type="text/javascript"> > function initialize() { > var latlng = new google.maps.LatLng(-34.397, 150.644); > var myOptions = { > zoom: 8, > center: latlng, > mapTypeId: google.maps.MapTypeId.ROADMAP > }; > var map = new > google.maps.Map(document.getElementById("map_canvas"), myOptions); > } > > </script> > </head> > <body onload="initialize()"> > <div id="map_canvas" style="width:100%; height:100%"></div> > </body> > </html> > > Many Thanks > > On Apr 26, 8:23 pm, Esa <[email protected]> wrote: > > Using API event object is better > > > > google.maps.event.addDomListener(window, "load", initialize); > > > > It makes sure that you will not overwrite any other window.onload > (orbody.onload) function calls. > > > > -- > > 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]<google-maps-js-api-v3%[email protected]> > . > > For more options, visit this group athttp:// > groups.google.com/group/google-maps-js-api-v3?hl=en. > > -- > 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]<google-maps-js-api-v3%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-maps-js-api-v3?hl=en. > > -- 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.
