[MOD-2559] Android: Add "ti.map" View.zoom() method
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-05-20T07:42:23.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.2.0 |
Components | Map |
Labels | 2020-Q3, android, map, module, parity, zoom |
Reporter | Lokesh Choudhary |
Assignee | Aakash Jain |
Created | 2019-12-11T18:29:48.000+0000 |
Updated | 2020-07-27T08:48:49.000+0000 |
Description
Summary
The iOS version of "ti.map" module'sView
type has a zoom()
method that is missing on Android. We should add this View.zoom()
method for parity.
The module's docs do not indicate that the zoom()
function is Android only. This suggests that it's cross-platform, which is wrong.
Work-Around
Currently, the only method that supports zooming on Android and iOS isView.setLocation()
via its "latitudeDelta" and "longitudeDelta" settings.
Steps to reproduce:
1. Use the code below in your app.js:
var MapModule = require('ti.map');
var win = Ti.UI.createWindow({fullscreen: false, layout: "vertical"});
var map = MapModule.createView({
enableZoomControls: false,
mapType: MapModule.NORMAL_TYPE,
animate: true,
});
var b4 = Ti.UI.createButton({
title: "Zoom in/out"
});
var zoomLevel = 1;
b4.addEventListener('click', function(){
map.zoom(zoomLevel);
zoomLevel = -zoomLevel;
});
win.add(b4);
win.add(map);
win.open();
2. Setup your app for using android map module.
3. Build for device/emulator.
4. After the app launches tap on ZOOM IN/OUT
.
Attachments
File | Date | Size |
---|---|---|
MOD-2559_log.txt | 2020-05-20T07:41:57.000+0000 | 73010 |
MOD-2559_Screenshot_1.png | 2020-05-20T07:42:02.000+0000 | 459049 |
MOD-2559_Screenshot_2.png | 2020-05-20T07:42:04.000+0000 | 605353 |