How does the scrolling on "Google Maps for Mobile" work?
Visit http://www.google.com/gmm with a mobile device - th开发者_开发技巧e scrolling is super smooth even with floating toolbars. How are they accomplishing this with GWT?
Update
I mean the site as seen by a mobile browser, not the native app. And I always assumed any Google web apps were GWT - I guess I assumed wrong.
I don't see anything that indicates they're using GWT. Based on the links at the bottom of the site, they're either telling people to use an already-installed native Google Maps app (iPhone) or referring them to a site that will download a native maps app for whichever mobile platform they happen to be using.
I've developed a couple of Google Maps apps, one using the plain Javascript version of the maps APIv3, and another using GWT. Even a very plain map using the v3 API, which has optimizations for mobile devices, doesn't have scrolling anywhere near as smoothly as the native Google Maps app on any of the platforms I've tried.
Scrolling in mobile WebKit has issues: http://www.quirksmode.org/webkit.html . Look for overflow
.
The solution to this is iScroll.
If you use CSS to place the floating toolbars, they'll stay put more cleanly than they will if you use JavaScript (or GWT evet handlers) to update their positions. Of course, this would only apply if you were scrolling around the content of a page, and it doesn't look like that's the case here.
CSS3 supports animations - perhaps they're looking at your drag gesture, determining the speed you're moving, and then just apply velocities to the images that make up the map?
Google maps for mobile is not done using web technology, it's written natively, probably in C. Which is going to be WAY faster for most stuff....similar animations that run smoothly natively on android and especially iphone run much more jerkily in the browser or webviews.
精彩评论