mapsplugin / cordova-plugin-googlemaps

Google Maps plugin for Cordova
Apache License 2.0
1.66k stars 912 forks source link

Anything to be done about choppy scrolling? #710

Closed benallfree closed 8 years ago

benallfree commented 8 years ago

If I load the map in an Ionic view that scrolls, the scrolling will cause the map to 'jump' rather than scroll smoothly. Not sure if this is an Ionic issue or not, but I only observe it with this plugin.

Any ideas?

hirbod commented 8 years ago

You need to understand how this plugin work. It is nothing like the JSmap, it's a native view behind your web view. When you scroll, the maps watchdog will sync itself. So there is no chance of an synced movement. If you want to increase the speed, you can call map.setWatchdogTimer(1) and after a timeout, call the same function with (false) as parameter, to reset the watching timer (1ms)

benallfree commented 8 years ago

Thanks @Hirbod, I did read about how it's a native overlay that tries to stay in sync. Thanks for the timeout idea, I'll try that.

hirbod commented 8 years ago

But as we don't have WKWebView support, scroll end will trigger after momentum/inertial finished, so it won't be that nice... As soon as we have official WKWebView support, the improvements on scroll will be much better

husmen73 commented 8 years ago

I'm using it for this problem:

on ion-content , add this on-scroll="refreshMap()" then add this to function map.refreshLayout();