7

I am converting my old code from v2 to v3 and noticed that the map is now significantly slower when I drag it. This only happens with Firefox while there is no issue under Google Chrome. This is not caused by my code as this problem exists even in the simplest maps, such as Google's basic example.

Interestingly enough, there is no performance issue under any browser when I visit maps.google.com. The only difference with the basic example seems to be that in the basic example, new tiles appear with a fade in transition effect. Because of that, I suspect that the fade in effect is the culprit. Does anybody know if I can disable it somehow? Are there any other ideas?

Note: I have tested this with the latest versions of Firefox & Chrome under Windows & Linux, on different computers and different API versions v3.exp, v3.13. Code is available at Google's basic example, but follows an even simpler working copy of it.

<!DOCTYPE html>
<html>
  <head>
    <style>
      html, body, #map-canvas { height: 100%; }
    </style>
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
    <script>
var map;
function initialize() {
  map = new google.maps.Map(document.getElementById('map-canvas'),
      {zoom: 8, center: new google.maps.LatLng(-34.397, 150.644)});
}
google.maps.event.addDomListener(window, 'load', initialize);
    </script>
  </head>
  <body>
    <div id="map-canvas"></div>
  </body>
</html>

Update:

I never had to take screencasts before so I probably didn't used the best tools, anyway even with these pixelated videos the difference should be obvious. In Firefox the render of new tiles and the panning is laggy (this is not the case when using maps.google.com so it's not an issue of Chrome being "better" than Firefox).

psxls
  • 6,807
  • 6
  • 30
  • 50
  • I am not sure I understand what you speak about. When I pan the map, it takes some time to download the tiles so there is a grey space for a while. This happens in FF as well as in Chrome. Maybe Chrome is a little faster, but only a little - that's just the overall efficiency of the browser.... Or did I get something wrong? Maybe you should describe more precisely what you observe, and maybe measure it somehow (ie. the using the net panel in FireBug). – Tomas Nov 19 '13 at 16:26
  • @Tomas I mean that when I drag the map, it does not immediately follow the movement of mouse. Instead it lags by almost half a second. So panning feels very jerky and unresponsive. With Chrome on the other hand, everything is super smooth. The tiles are downloaded at the same rate, the problem is on how they are drawn. In the next hour I'll update the question with a screencast or something. – psxls Nov 19 '13 at 22:57
  • @psxls:Maybe you have bad firefox extension or to many? Is firefox and chrome just the default version of enhanced? What happen with the traffic when you test? – Micromega Nov 20 '13 at 11:51
  • @Phpdna Latest official versions of FF & Chrome. No plugins/extensions installed. I have tested on different computers, with different setups, and with the help of friends even from different countries. FF is always laggier than Chrome in the basic example, but they are the same when using maps.google.com. It surprises me that no one else from SO experiences the same problem! This isn't related to the traffic. It has to do with how the tiles are rendered. This is why I'm asking if there's any way to remove the fade in effect (didn't found something on the API's docs). – psxls Nov 20 '13 at 12:03
  • @downvoter, I'm open to suggestions on how to improve the question! I have researched quite a lot the issue and I didn't spent my time writing this, capturing videos and starting a bounty for nothing :) – psxls Nov 20 '13 at 12:09
  • 1
    Looking at it in the profiler it appears to be triggering sync reflows while scrolling. Little hard to see why, though, since the code is minified. Here is the profile: http://people.mozilla.org/~bgirard/cleopatra/#report=5d9b48f6bea110a9d457625fc0f766841d5fdfbb – Ben Kelly Nov 20 '13 at 17:57

3 Answers3

1

I can not believe somebody else is having this problem that i am STILL trying to figure out for more than TWO years.

You have no idea how many times i posted this issue and almost all the time got some suggestions that had nothing to do with the question.

Even i emailed some idiots working at google who told me that it is probably a bug and i should post it at some forum bla-bla-bla.

When i did post it there i explained them the problem in deep details and got some answer that still has nothing to do with my question.

What i noticed is that if i remove the video card drivers it works like charm and everything is very smooth. It is the same when i connect throught remote desktop.

I will be happy if somebody finds a solution.

P.S. On mac OS it is a little better than Windows!

This is my original question

Here you can see the responses on google forum: Click

Community
  • 1
  • 1
Joro Seksa
  • 1,525
  • 3
  • 18
  • 44
0

You can try this Google help: https://support.google.com/maps/answer/18529?hl=en. Maybe it has something to do with the hardware acceleration. But If the map is loading slow doesn't it show a message to the user?

Micromega
  • 12,486
  • 7
  • 35
  • 72
  • Thanks! But it appears that this page addresses issues with the map and/or tiles not loading at all due to browser permissions. It does not help with the performance issues I am dealing with. – psxls Nov 20 '13 at 19:52
0

If you want a work-around, try caching the map tiles of the places you most often look at (ie. your home town's greater area)

Not sure if this is against google's terms of use though, as you technically are downloading their IP without permission. If it is, you can use something like: https://code.google.com/p/ogmaps/ or https://code.google.com/p/gmapoffline/ which are third party interpretations of google's maps and royalty free.