Thanks for the reply Barry. I couldn't agree more, it is a funny concept, and it's annoying that it's even an issue.
I'm trying to get the best of both worlds, using Google Maps as well as have a good Page Speed score, but by including Google Maps on the page (v3 at least), the Page Speed tool (and "Site Performance" in Webmaster Tools for that matter) reports that 9 js files from maps.gstatic.com and 3 js files from maps.google.com should be combined into as few files as possible (among other penalties for stuff like reducing DNS lookups). This reduces the overall score, yet I don't have any control over it. So that's why I was trying to find a way to load Maps independent of the main page load, like when the user clicks on a button to display it. But then the problem becomes that the script to load Maps v3 uses document.write, so when I inject it into the DOM after the main page is loaded, it overwrites the main page, displaying a white page. I did look into the async function, but that appears to only be with v2. (The problem with using v2 for us is that we are trying to implement a solution across many different domains, and don't see it being feasible to have that many API keys.) I'll check with the v3 group specifically as well. On Jan 27, 5:14 pm, Barry Hunter <[email protected]> wrote: > 1) v3 has its own group:http://groups.google.com/group/google-maps-js-api-v3 > > 2) Trying to 'fudge' your page just to get a better 'score' seems a > funny concept to me. > > You want to increase your page complexity just to 'lie' to 'Page > Speed' - but the user is still going to have to load the Maps API to > use the map, so its not really actully going to help the user. > > The user is the important thing not 'Page Speed' > > On the other hand you can use techniques to load the page in stages - > so the page displays as quickly as possible, and useable, only then do > you load the interactive features of the maps. So this is done with > the intention of speeding up the user experience. > > (for this last bit I beleive you can load the Maps API in a async > function via the AJAX > > 2010/1/28 Austin <[email protected]>: > > > > > > > I'm not sure if this belongs here or in the Google Page Speed group, > > but our Page Speed score is getting heavily penalized due to Google > > Maps (using v3). I've found other postings that touch on the topic, > > but nothing really addressing what we're trying to do to work around > > it. > > > One thing I've tried is to use a timeout to display the map and its > > markers after a couple seconds, but all of the Maps scripts and > > processing is included in the page when it loads, which doesn't help > > the page speed score. > > > Another thing I've tried to do is to somehow separate the Maps loading > > from the main page and load the map and the main > >http://maps.google.com/maps/api/js?sensor=falsescript that loads all > > the other 9 js files, which are what is being reported in Page Speed. > > I thought using Ajax or maybe an iframe to load all the necessary > > Google Maps files outside of the main page (to improve the Page Speed > > score), but when that fires off after the rest of the page loads (via > > appending the script dynamically), the page turns blank due to the > > document.write inhttp://maps.google.com/maps/api/js?sensor=false. > > > Does anybody have any suggestions or insight into either Page Speed or > > Maps that could help with this scenario, or because Maps v3 uses > > document.write is there no way to get around it? > > > -- > > 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 > > athttp://groups.google.com/group/google-maps-api?hl=en. > > -- > Barry > > -www.nearby.org.uk-www.geograph.org.uk- -- 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.
