Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2194] Ti.Map: iOS event for regionwillchange

GitHub Issuen/a
TypeNew Feature
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-01-21T11:49:35.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.4.0
ComponentsMap
Labelsios, qe-5.4.0, ti.map
ReporterJoseph Sachs
AssigneeHans Knöchel
Created2016-01-26T12:53:17.000+0000
Updated2017-01-21T11:49:42.000+0000

Description

It would be nice to implement this event trigger on iOS:
// regionwillchange to be triggered before the existing regionchanged event in Ti
- (void)mapView:(MKMapView *)mapView regionWillChangeAnimated:(BOOL)animated
We do have regionDidChangeAnimated in ti.map for iOS & Android, however regionWillChangeAnimated is just as good to have :)

Comments

  1. Hans Knöchel 2016-01-26

    Valid feature request, submitted via Github issue.
  2. Hans Knöchel 2016-01-26

    *PR*: https://github.com/appcelerator-modules/ti.map/pull/146 *Test*: Use the below code and drag the map view. *Expected behavior*: Start dragging and the regionwillchange event gets fired. Stop dragging and the regionchanged event gets fired.
       var window = Ti.UI.createWindow();
       var Map = require("ti.map");
       var mapView = Map.createView();
       
       mapView.addEventListener("regionwillchange", function(e) {
         Ti.API.warn("Region will change now!");
         Ti.API.warn(e);
       });
       
       mapView.addEventListener("regionchanged", function(e) {
         Ti.API.warn("Region did change!");
         Ti.API.warn(e);
       });
       
       window.add(mapView);
       window.open();
       
  3. Harry Bryant 2016-07-12

    Verified as fixed, When dragging the map view, "Region will change no!" warning is shown in the console. along with an object obtaining the current position. "Region did change!" event does not fire until dragging is stopped, which returns an object obtaining the new position. Tested On: iPhone 6S (9.3.2) Device & iPhone 6 Plus (8.3) Device Ti.Map (2.7.1) Mac OSX El Capitan 10.11.5 Ti SDK: 5.4.0.v20160712013704 Appc Studio: 4.7.0.201607111053 Appc NPM: 4.2.7 App CLI: 5.4.0-31 Xcode 7.3 Node v4.4.7 *Closing ticket.*

JSON Source