Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2388] Android ti.map module does not update bearing, tilt or zoom attributes when region changes

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsMap
Labelsn/a
ReporterMichael Garwood
AssigneeUnknown
Created2018-01-17T17:57:54.000+0000
Updated2018-03-06T18:52:19.000+0000

Description

When the user alters the map view the bearing, tilt and zoom region properties are not updated and in fact are undefined. This can be reproduced with the following test case:
var Map = require('ti.map');
var mapview = Map.createView({
		        mapType: Map.SATELLITE_TYPE,
		        region: {latitude: latitude, longitude: longitude, zoom: 15},
		        animate:true,
		        regionFit:true,
		        userLocation: false			        
		    });
[console.log("Original Bearing," + mapview.region.bearing);
console.log("Original Tilt," + mapview.region.tilt);
console.log("Original Zoom," + mapview.region.zoom);
// manipulate map to alter zoom, bearing and/or tilt on map view
console.log("New Bearing," + mapview.region.bearing);
console.log("New Tilt," + mapview.region.tilt);
console.log("New Zoom," + mapview.region.zoom);
Possible fix is to include the following in the onCameraMoveStarted and onCameraIdle event handlers in src/ti/map/TIUIMapView.java:
d.put(MapModule.PROPERTY_BEARING, position.bearing);
d.put(MapModule.PROPERTY_ZOOM, position.zoom);
d.put(MapModule.PROPERTY_TILT, position.tilt);

Comments

No comments

JSON Source