{ "id": "61405", "key": "TIMOB-773", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11223", "name": "Release 1.3.0", "archived": true, "released": true, "releaseDate": "2010-05-05" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:54:12.000+0000", "created": "2011-04-15T02:36:06.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:54:12.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

premium ticket:

\n

http://helpdesk.appcelerator.net/tickets/1871

\n

two issues

\n

1) click on the bottom right annotation, you will see that the\npin above it obscures part of the annotation (something like a\nzIndex problem)

\n

2) clicking zoom out repeatedly will cause a crash. seems to be\nrelated to doing a zoom out when you can't zoom out any\nfarther.

\n

here's the code you can drop into app.js

\n
\n\n   var win= Ti.UI.createWindow();\n   win.title = 'Map View Bug Demo';\n   \n   var testState = 0;\n   \n   var m0 = [47.608941,-122.340145,'3/27/2010 22:13','Jumping bush cricket','1521 1st Ave Seattle'];\n   var m1 = [47.613591,-122.344394,'3/27/2010 22:13','Common true katydid','2222 2nd Ave Seattle'];\n   var m2 = [47.624562,-122.356442,'3/27/2010 22:13','Fall field cricket','14 Mercer St Seattle'];\n   var m3 = [47.606366,-122.337656,'3/27/2010 22:13','Fork-tailed bush katydid 1','1225 1st Ave Seattle'];\n   var m4 = [47.612825,-122.34567,'3/27/2010 22:13','Fork-tailed bush katydid 2','2230 1st Ave Seattle'];\n   var m5 = [47.605961,-122.34036,'3/27/2010 22:13','Greater anglewing','1301 Alaskan Way Seattle'];\n   var m6 = [47.613975,-122.345467,'3/27/2010 22:13','Greater anglewing katydid 1','2234 2nd Ave Seattle'];\n   var m7 = [47.617215,-122.326584,'3/27/2010 22:13','Greater anglewing katydid 2','1416 E Olive Way Seattle'];\n   var m8 = [47.610127,-122.342838,'3/27/2010 22:13','Lesser anglewing','1908 Pike Place Seattle'];\n   var m9 = [47.624562,-122.356442,'3/27/2010 22:13','Oblong-winged katydid','14 Mercer St Seattle'];\n   var markers = [m0,m1,m2,m3,m4,m5,m6,m7,m8,m9];\n\n   //\n   // CREATE ANNOTATIONS\n   //\n   var myAnnotations = [];\n\n   function clearAnnotations(){\n       for (i=myAnnotations.length-1;i>=0;i--) {\n           mapview.removeAnnotation(myAnnotations[i]);//if any exist from reading DB\n       }\n       myAnnotations = [];\n   }\n\n   function addAnnotations() {\n       for (i=0;i<markers.length-1;i++){\n           dbMarker = Titanium.Map.createAnnotation({\n               animate:true,\n               rightButton:Titanium.UI.iPhone.SystemButton.DISCLOSURE,\n               pincolor:Titanium.Map.ANNOTATION_PURPLE,\n               latitude:markers[i][0],  //latitude\n               longitude:markers[i][1],  //longitude\n               title:markers[i][3],  //cricket name\n               subtitle:markers[i][2],  //date\n               comment:markers[i][4]  //comment - custom parameter\n            });\n           //Titanium.API.info('Row:' + i + ', longitude:' +longitude+', latitude:'+latitude);\n           myAnnotations.push(dbMarker);\n       }\n       for (i=0;i<myAnnotations.length;i++){\n           mapview.addAnnotation(myAnnotations[i]); //put pin on map\n       }\n   }\n   \n   function flagAnnotations(theTestState){\n       //  change the annotation on the fly\n       for (i=myAnnotations.length-1;i>=0;i--) {\n           if(theTestState == 2){//change to new annotation properties\n                myAnnotations[i].pincolor=Titanium.Map.ANNOTATION_RED;\n                myAnnotations[i].leftButton='../images/appcelerator_small.png';\n                myAnnotations[i].rightButton='../images/apple_logo.jpg';\n            } else if(theTestState == 1){ //restore original annotation properties\n                myAnnotations[i].pincolor=Titanium.Map.ANNOTATION_PURPLE;\n                myAnnotations[i].leftButton=null; //replace prior image\n                myAnnotations[i].rightButton=Titanium.UI.iPhone.SystemButton.DISCLOSURE;\n            } else {\n               Titanium.UI.createAlertDialog({title:'Logi error',message:'flagAnnotations() has bad parameter'}).show();\n           }\n       }\n   }\n\n   //\n   // CREATE MAP VIEW\n   //\n   mapview = Titanium.Map.createView({\n       mapType:Titanium.Map.STANDARD_TYPE,\n       region:{latitude:47.612825, longitude:-122.34567, animate:true, latitudeDelta:0.01, longitudeDelta:0.01},\n       animate:true,\n       regionFit:true,\n       userLocation:true\n       //annotations:[]\n   });\n   win.add(mapview);\n   \n   // map view click event listener\n   mapview.addEventListener('click',function(evt) {\n       // map event properties\n       Titanium.API.info('MAPVIEW EVENT');\n    \n       var annotation = evt.annotation;\n       var clickSource = evt.clicksource;\n       var comment = annotation.comment;\n   \n       if (clickSource == 'rightButton') {\n           if (testState==2){//State#2\n               Titanium.UI.createAlertDialog({title:'right Button State #2',message:'rightButton click while in State#2'}).show();\n          } else if (testState==1) {//show the marker's comment\n               Titanium.UI.createAlertDialog({title:'right Button State #1',message:comment}).show();\n           }\n       }\n       if (clickSource == 'leftButton') {\n           if (testState==2){//user can use new button\n                Titanium.UI.createAlertDialog({title:'left Button State #2',message:'leftButton click while in State#2'}).show();\n            }\n       }\n   });\n   \n   \n   //\n   // TOOLBAR BUTTONS\n   //\n   var state0 = Titanium.UI.createButton({\n       style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED,\n       title:'Init State 1'\n   });\n\n   var state1 = Titanium.UI.createButton({\n       style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED,\n       title:'To State 2'\n   });\n   \n   var state2 = Titanium.UI.createButton({\n       style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED,\n       title:'Back To State 1'\n   });\n   \n   state0.addEventListener('click', function(){\n       testState = 1;\n       clearAnnotations();\n       addAnnotations();\n       state0.enabled = false;\n       state1.enabled = true;\n       state2.enabled = false;\n   });\n   state1.addEventListener('click', function(){ //go to state 2\n       testState = 2;\n       state0.enabled = false;\n       state1.enabled = false;\n       state2.enabled = true;\n       flagAnnotations(testState); //change the annotation on the fly\n   });\n   \n   state2.addEventListener('click', function(){ //back to state 1\n       testState = 1;\n       state0.enabled = true;\n       state1.enabled = false;\n       state2.enabled = false;\n       flagAnnotations(testState); //change the annotation on the fly\n   });\n   \n   state0.enabled = true;\n   state1.enabled = false;\n   state2.enabled = false;\n   \n   \n   var flexSpace = Titanium.UI.createButton({\n    systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE\n   });\n   \n   // button to zoom-in\n   var  zoomin = Titanium.UI.createButton({\n        title:'+',\n        style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED\n    });\n   zoomin.addEventListener('click',function(){\n    mapview.zoom(1);\n   });\n\n   // button to zoom-out\n   var  zoomout = Titanium.UI.createButton({\n        title:'-',\n        style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED\n    });\n   zoomout.addEventListener('click',function(){\n    mapview.zoom(-1);\n   });\n   \n   \n   var tb = Ti.UI.createToolbar({\n    height:44,\n    bottom:0,\n    items:[flexSpace,state0,flexSpace,state1,flexSpace,state2,flexSpace,zoomin,flexSpace,zoomout,flexSpace]\n   });\n\n   win.add(tb);\n\n   win.open();\n
{html}", "attachment": [], "flagged": false, "summary": "map problems (annotation zIndex + zoom out crash)", "creator": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "123999", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [274b3c1f8bd76274c21222ea9cffe707ded1c0bd])\nCloses #773 in both issues \nhttp://github.com/appcelerator/titanium_mobile/commit/274b3c1f8bd76...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:36:07.000+0000", "updated": "2011-04-15T02:36:07.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }