Leaflet / Leaflet

πŸƒ JavaScript library for mobile-friendly interactive maps πŸ‡ΊπŸ‡¦
https://leafletjs.com
BSD 2-Clause "Simplified" License
40.09k stars 5.75k forks source link

Uncertain error with Zoom(ing) in html5 App on Android(PhoneGap). #1485

Closed Nisk closed 11 years ago

Nisk commented 11 years ago

Hi,

I'm using your library in a html5 App which I'm deploying to Android/iOS using PhoneGap, so I'm aware that this is a rare use case and my problem might not be to do with the library itself, per say. Basically, my build succeeds and I can use the maps on the device/emulator (for Android) and everything's fine, except the whole App crashes when I try to zoom out(but not always and at different levels).

The code itself is very simple, creates a map to fill up the whole screen with given co-ordinates. I'm really not sure what the problem is, could be with PhoneGap itself...but at least this way people will be aware that there are some issues in this use-case, perhaps we could pin them down.

danzel commented 11 years ago

There are heaps of issues with android and 3d acceleration on different devices and version of android. (Just search for android in issues)

What device / version of android are you on?

You can probably set window.L_DISABLE_3D=true; before including leaflet which will probably 'fix' the issue.

Nisk commented 11 years ago

I'm developing on the emulator(Android v4.1.2) and HTC One X(Android v4.1.1), both are crashing.

I've tried setting the window.L_DISABLE_3D option but that actually made it worse (it took a couple of zoom levels before, now consistently fewer).

I've also tried setting the window.L_PREFER_CANVAS but that also didn't stop the crashing. Is there any test/code I can do that can help out?

danzel commented 11 years ago

Okay that's really weird, if L_DISABLE_3D doesn't sort it then I'm a bit lost :|

Nisk commented 11 years ago

Yeah, me too man. It's probably to do with Android/Phonegap really, it's just that I tried google maps and that worked, so I thought it might be to do with the library - but that's a long shot at best...at a black cat in the dark. Thanks for trying to help, I'll try a few more things and post here if I find a solution (decided to park the maps side of things for a while). Cheers.

danzel commented 11 years ago

If you run it just in the android browser how does it go?

Nisk commented 11 years ago

Hey, sorry - I wasn't setting the L_DISABLE_3D before including leaflet! It was also pointed out to me that this is pretty much a duplicate of issue #909. That did the job, so I'll mark it as solved (oh Android). Thanks for your helps and sorry for the duplicate!