[TIMOB-8114] iOS: Mapview regionChanged event does not fire
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-03-28T10:01:07.000+0000 |
Affected Version/s | Release 1.8.2 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Varun Joshi |
Assignee | Sabil Rahim |
Created | 2012-03-20T11:28:15.000+0000 |
Updated | 2017-03-09T23:21:05.000+0000 |
Description
Ran the attached app.js file to reproduce the issue.
The regionChanged event listener is giving the same latitudeDelta and longitudeDelta values even when the mapview is zoomed in or out.
{noformat}
var win = Titanium.UI.createWindow();
win.open();
var annotation = Titanium.Map.createAnnotation({
latitude:42.334537,
longitude:-71.170101,
title:"Boston College",
subtitle:'Newton Campus, Chestnut Hill, MA',
animate:true,
leftButton:'../images/atlanta.jpg'
});
var boston = {latitude:42.334537,longitude:-71.170101,latitudeDelta:0.010, longitudeDelta:0.018};
//
// CREATE MAP VIEW
//
var mapview = Titanium.Map.createView({
mapType: Titanium.Map.STANDARD_TYPE,
region: boston,
animate:true,
regionFit:true,
userLocation:true,
annotations:[annotation]
});
win.add(mapview);
// map view click event listener
mapview.addEventListener('regionChanged',function(evt)
{
Ti.API.info('map region changed '+evt.source.region.latitudeDelta, evt.source.region.latitude);
});
{noformat}
The API info statements print out the same values on the console.
*EXPECTED BEHAVIOR*
The delta values should be updated on every zoom activity.
This is a invalid bug, for each zoom level the regionChanged updates the following values latitude, longitude, latitudeDelta, longitudeDelta and NOT source.region.* - they would remain the same for regionChanged. So the values that you are looking for are evt.latitude, evt.longitude, evt.latitudeDelta, evt.longitudeDelta. I have checked in our SDK and these values are being updated properly. For further details please refer to our [Documentation](http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Map.View.regionChanged-event.html).
Closing ticket as invalid.