Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2261] iOS ti.map pinchangedragstate event never fired.

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-05-31T07:52:24.000+0000
Affected Version/sRelease 5.2.0
Fix Version/sRelease 5.4.0
ComponentsMap
Labelsios, map, module, qe-5.4.0
ReporterJeff Messick
AssigneeHans Knöchel
Created2016-03-13T21:18:17.000+0000
Updated2016-07-19T22:44:25.000+0000

Description

Using map module ti.map 2.7.0 crashes app when trying to drag pin on map. Map loads pin drops, holding and raging pin causes crash with no errors in console. I have also tried using older versions of the map module with same results. Steps to reproduce: New classic project use code from doc's http://docs.appcelerator.com/platform/latest/#!/guide/iOS_Map_Kit
var MapModule = require('ti.map');
var win = Ti.UI.createWindow({backgroundColor: 'white'});
var appc = MapModule.createAnnotation({
    latitude: 37.389569,
    longitude: -122.050212,
    title: 'Appcelerator HQ',
    subtitle: 'Mountain View, CA',
    pincolor: MapModule.ANNOTATION_GREEN,
    draggable: true
});
var mapview = MapModule.createView({
    mapType: MapModule.HYBRID_TYPE,
    region: {latitude: 37.389569, longitude: -122.050212, latitudeDelta: 0.2, longitudeDelta: 0.2},
    annotations: [appc]
});
mapview.addEventListener('pinchangedragstate', function(e){
    Ti.API.info(e.type);
    Ti.API.info(JSON.stringify(e.newState));
}); 
mapview.addEventListener('click', function(e){
    Ti.API.info(e.type);
    Ti.API.info(JSON.stringify(e.clicksource));
});
mapview.addEventListener('regionchanged', function(e){
    Ti.API.info(e.type);
    Ti.API.info(e.latitude + "," + e.longitude);
});
mapview.addEventListener('complete', function(e){
    Ti.API.info(e.type);
});
win.add(mapview);
win.open();

Attachments

FileDateSize
Screen Shot 2016-03-14 at 9.07.51 PM.png2016-03-14T15:14:48.000+0000840802
Screen Shot 2016-03-14 at 9.08.08 PM.png2016-03-14T15:14:53.000+0000850246

Comments

  1. Sharif AbuDarda 2016-03-14

    Hello, I tried the module ti.map version 2.7.0 with SDK 5.2.0.GA. The app seems to be working as expected with iPhone simulator (9.1). Dragging map pin did not crash the app. See the screenshots to compare and see the console log for region change. *Platform Info*
       Operating System
         Name                        = Mac OS X
         Version                     = 10.11.3
         Architecture                = 64bit
         # CPUs                      = 4
         Memory                      = 8589934592
       Node.js
         Node.js Version             = 4.2.2
         npm Version                 = 2.14.7
       Titanium CLI
         CLI Version                 = 5.0.6
       Titanium SDK
         SDK Version                 = 5.2.0.GA
         Target Platform             = iphone
       [INFO] :   Found Titanium module id=ti.map version=2.7.0 platform=iphone deploy-type=development path=/Users/gsl001/Library/Application Support/Titanium/modules/iphone/ti.map/2.7.0
       [INFO] :   Deploy type: development
       
    Thanks.
  2. Jeff Messick 2016-03-14

    Do you get the same results when running on an iPhone device? I have run this on the device and in the Sim. On the device I click the pin, The bubble appears, when I press and hold to drag the pin it crashes. Console Output:
       [INFO] :   regionchanged
       [INFO] :   37.38956832885742,-122.05020904541016
       [INFO] :   complete
       [INFO] :   click
       [INFO] :   "pin"
       [INFO] :   click
       [INFO] :   "map"
       [INFO] :   pinchangedragstate
       
    In the simulator same steps as below but it does not crash but the new state return undefined.
       [INFO] :   Launching iOS Simulator
       [INFO] :   regionchanged
       [INFO] :   37.38956832885742,-122.05020904541016
       [INFO] :   complete
       [INFO] :   click
       [INFO] :   "pin"
       [INFO] :   click
       [INFO] :   "map"
       [INFO] :   pinchangedragstate
       [INFO] :   "e.newState undefined"
       [INFO] :   pinchangedragstate
       [INFO] :   "e.newState undefined"
       [INFO] :   pinchangedragstate
       [INFO] :   "e.newState undefined"
       [INFO] :   pinchangedragstate
       [INFO] :   "e.newState undefined"
       [INFO] :   pinchangedragstate
       [INFO] :   "e.newState undefined"
       [INFO] :   pinchangedragstate
       [INFO] :   "e.newState undefined"
       [INFO] :   click
       [INFO] :   "pin"
       [INFO] :   click
       [INFO] :   "map"
       
  3. Jeff Messick 2016-03-19

    Any Update on this?
  4. Mostafizur Rahman 2016-03-21

    Hello, Tested this issue using the test steps and sample code provided by the reporter. iOS ti.map *pinchangedragstate* is not firing as expected. 
 *Test Environment:* Appcelerator Studio, build: 4.5.0.201602170821, Operating System Mac OS X -EI Capitan, Versio-10.11.1, Appcelerator Command-Line Interface, version 5.2.0, SDK Version = 5.2.0.GA , Node.js Version : 4.2.2 npm Version: 2.14.7, iOS SDK: 9.1, iPad Device, iPhone 6 Plus, ti.map-2.7.0 
 *Test Steps:* 1.Create an app, add ti.map module and add the sample code provided by the reporter.
 2.Deploy to iPad device and simulator
 3.On the device I click the pin, the bubble appears, when I press and hold to drag the pin , pinchangedragstate event is not firing.

 
 *Test Results:* *Console logs:* *Device(iPad):*
       
       [INFO] :   iosalssicmap/1.0 (5.2.0.384775e)
       
       [INFO] :   regionchanged
       
       [INFO] :   37.38956832885742,-122.05020904541016
       
       [INFO] :   complete
       
       [INFO] :   click
       
       [INFO] :   "pin"
       
       [INFO] :   regionchanged
       
       [INFO] :   37.39053153280749,-122.05100784266874
       
       [INFO] :   click
       
       [INFO] :   "map"
       
       [INFO] :   regionchanged
       
       [INFO] :   37.387639133305015,-122.05390429967613
       
       [INFO] :   complete
       
       [INFO] :   regionchanged
       
       [INFO] :   38.34932036324542,-121.20480532028215
       
       [INFO] :   complete
       
       [INFO] :   regionchanged
       
       [INFO] :   41.793901953019514,-119.5990639099765
       
       [INFO] :   regionchanged
       
       [INFO] :   36.31113842121833,-125.09285414798671
       
       [INFO] :   regionchanged
       
       [INFO] :   36.28735163342695,-121.06412699391568
       
       [INFO] :   regionchanged
       
       [INFO] :   36.10871966812097,-122.64315180984553
       
       [INFO] :   complete
       
       [INFO] :   regionchanged
       
       [INFO] :   35.98685466319999,-122.63302472012599
       
       [INFO] :   regionchanged
       
       [INFO] :   51.857418483525265,-125.51084932281654
       
       [INFO] :   complete
       
       [INFO] :   regionchanged
       
       [INFO] :   48.304851425270584,-134.98076018456592
       
       [INFO] :   regionchanged
       
       [INFO] :   30.840309517447743,-147.4076720566215
       
       [INFO] :   regionchanged
       
       [INFO] :   27.928121723971486,-149.29734445757927
       
       [INFO] :   regionchanged
       
       [INFO] :   49.840043690567704,-111.68513909367448
       
       [INFO] :   regionchanged
       
       [INFO] :   48.963214366773855,-92.72296027404256
       
       [INFO] :   regionchanged
       
       [INFO] :   49.66166333750585,-97.26390108633144
       
       [INFO] :   regionchanged
       
       [INFO] :   49.5377927951084,-101.8616296175275
       
       [INFO] :   regionchanged
       
       [INFO] :   47.67746120548658,-100.24343762184088
       
       [INFO] :   regionchanged
       
       [INFO] :   49.840043690567704,-111.84469705032475
       
       [INFO] :   complete
       
       [INFO] :   regionchanged
       
       [INFO] :   43.75241124146114,-91.22023405603855
       
       [INFO] :   regionchanged
       
       [INFO] :   45.33907113301809,-122.8600271330803
       
       [INFO] :   regionchanged
       
       [INFO] :   49.001560242589356,-95.90760981480805
       
       [INFO] :   click
       
       [INFO] :   "pin"
       
       [INFO] :   click
       
       [INFO] :   "map"
       
       [INFO] :   click
       
       [INFO] :   "pin"
       
       [INFO] :   regionchanged
       
       [INFO] :   13.250142475879628,-26.187065458638404
       
       [INFO] :   regionchanged
       
       [INFO] :   41.679973153072645,-45.8494962610225
       
       [INFO] :   click
       
       [INFO] :   "map"
       
       [INFO] :   click
       
       [INFO] :   "pin"
       
       [INFO] :   click
       
       [INFO] :   "map"
       
       [INFO] :   click
       
       [INFO] :   "pin"
       
       [INFO] :   click
       
       [INFO] :   "map"
       
       [INFO] :   click
       
       
       
       [INFO] :   "pin"
       
       
    
 *Simulator logs(iPhone 6 Plus):*
       
       [INFO] :   Application started
       
       [INFO] :   iosalssicmap/1.0 (5.2.0.384775e)
       
       [INFO] :   regionchanged
       
       [INFO] :   37.38956832885742,-122.05020904541016
       
       [INFO] :   complete
       
       [INFO] :   complete
       
       [INFO] :   click
       
       [INFO] :   "pin"
       
       [INFO] :   click
       
       [INFO] :   "map"
       
       [INFO] :   click
       
       [INFO] :   "pin"
       
       [INFO] :   regionchanged
       
       [INFO] :   37.41489673600074,-122.05020904541016
       
       [INFO] :   click
       
       [INFO] :   "map"
       
       [INFO] :   click
       
       
       
       [INFO] :   "pin"
       
       
    Thanks.
  5. Francisco Ruaro Varisco 2016-04-06

    Any updates?
  6. Jeff Messick 2016-04-06

    It would be nice to have an update on this.
  7. jack sparrow 2016-04-30

    any solution ?
  8. Taylor Thompson 2016-05-17

    I too am running into this issue. This seems to be an issue in the Ti.Map module, when I revert back to ti.map 2.2.2 there is no longer an issue. Appcelerator Studio, build: 4.5.0.201602170831 Ti SDK 5.2.0 GA ti.map 2.5.2 & 2.7.0 iPhone Simulator 9.2 OSX 10.10.5
  9. Hans Knöchel 2016-05-30

    PR: https://github.com/appcelerator-modules/ti.map/pull/164 Ok, so here are some thoughts that took me a while to realize. First of all, I removed a type-warning back in the days that caused the issue (between 2.2.2 and 2.2.3). Casting it correctly fixes the issue because the wrong casting brook all properties after it as well. So the fix might not seem related, but please try the following packaged module to verify: [ti.map-iphone-2.7.1.zip](https://github.com/appcelerator-modules/ti.map/releases/download/untagged-4cbab7537114c27b5b2a/ti.map-iphone-2.7.1.zip) I would put it into 5.4.0 as well, but all of you guys could already use it before, since it would be published to Github after it's successful review. So please leave your feedback, thanks!
  10. Chee Kiat Ng 2016-05-31

    CR and FT passed! PR merged! Let's have a PR for the packaged module please :)
  11. Josh Longton 2016-07-19

    Verified as fixed. Tested on: iPhone 6 plus (9.1) iOS Simulator (9.3) 
Mac OSX El Capitan 10.11.6 Studio: 4.7.0.201607130543 
Ti SDK: 5.4.0.v20160713141635 
Xcode 7.3.1 
Appc NPM: 4.2.7 Appc CLI: 5.4.0-33 Node v4.4.4 *
Closing Ticket*

JSON Source