[TIMOB-15888] Android: WebView cannot pinch zoom on map
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-04-08T21:21:31.000+0000 |
Affected Version/s | Release 3.1.3 |
Fix Version/s | 2014 Sprint 07, 2014 Sprint 07 SDK, Release 3.3.0 |
Components | Android |
Labels | SupportTeam, dev-investigate, module_webview, qe-closed-3.3.0, qe-testadded, triage |
Reporter | Stephan Jensen |
Assignee | Sunila |
Created | 2013-11-21T12:20:08.000+0000 |
Updated | 2014-04-28T08:09:18.000+0000 |
Description
Problem Description
The WebView is unable to zoom in on maps using pinch gestures. The issue seems to go away if the user pinch zooms another part of the page or on a previous page, before pinch zooming the map. Android API level is set to 11 in the tiapp.xml manifest.Extra info
Example pages where pinch zooming doesn't work: http://leafletjs.com/examples/mobile-example.html https://maps.google.com/ Viewport metatag is being used on the page to correctly scale the html on the device Q&A about the issue: http://developer.appcelerator.com/question/158749/titanium-webview-leafletgmaps-pinch-zoom-not-working-properlyTestcase
var win = Ti.UI.createWindow({
top: '20dp',
width: Ti.UI.FILL,
height: Ti.UI.FILL
});
win.add(Ti.UI.createWebView({
width: Ti.UI.FILL,
height: Ti.UI.FILL,
url: 'http://leafletjs.com/examples/mobile-example.html'
//url: 'https://maps.google.com'
}));
win.open();
I was looking through the TiMapView source, and the following method caught my attention
I then created a new module, added a native webview, and added the above method. Pinch zooming seems to be working perfectly after adding the above.
The issue cannot reproduce with the release master 3.2.0 Tested with: Titanium Studio, build: 2.1.2.201208301612 Titanium SDK version: 3.2.0 Tested on Device: Samsung galaxy s duos Android version: 4.0.4
The issue still persists in version 3.2.0.GA Tested with: Titanium Studio, build: 3.2.0.201312191547 Titanium SDK version: 3.2.0.GA Tested on Nexus 5 (4.4.2) Samsung galaxy S4 (4.3) Samsung galaxy S2 (4.2)
Any updates on the issue, or have you forgot all about it?
Use scaleDetector only if PINCH event needs to be handled as it interfere with the WebView pinch zoom. Issue is more visible with google map https://github.com/appcelerator/titanium_mobile/pull/5345
Is there a workaround for this issue until 3.3.0 is released ?
Verified the fix using: OSX: 10.9.2 Xcode: 5.1.1 Studio - 3.3.0.201404251359 SDK - 3.3.0.v20140425191906 acs-1.0.14 alloy-1.4.0-dev npm-1.3.2 titanium-3.3.0-dev titanium-code-processor-1.1.1-beta1 Device: LG-P970 (4.0.4) As expected Pinch zoom works fine on the map.