Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7908] iOS: User Location blue dot disappears often disappears on the device when using annotations

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-05-03T10:47:56.000+0000
Affected Version/sRelease 1.8.2
Fix Version/sRelease 2.0.0, Sprint 2012-06
ComponentsiOS
Labelsmodule_map, qe-testadded
ReporterVarun Joshi
AssigneeMax Stepanov
Created2012-03-06T17:12:59.000+0000
Updated2012-05-03T10:47:56.000+0000

Description

The blue dot that is used to indicate the user's current location disappears randomly when adding and removing annotations. Run the attached sample app.js to reproduce the issue: (test only on the device) 1. Initially, the user location and annotation is shown on the map. 2. Now, click on the "remove" button to remove the annotation. Then click on "add" button to add a different annotation. 3. The blue dot now disappears from the map. Here is the file:

var win = Ti.UI.createWindow({
    backgroundColor:'white',
    fullscreen: false
});


var mountainView = Titanium.Map.createAnnotation({
    latitude:37.390749,
    longitude:-122.081651,
    title:"Appcelerator Headquarters",
    subtitle:'Mountain View, CA',
    pincolor:Titanium.Map.ANNOTATION_RED,
    animate:true,
    leftButton: '../images/download.png',
    myid:1 // Custom property to uniquely identify this annotation.
});
 
var mapview = Titanium.Map.createView({
    mapType: Titanium.Map.STANDARD_TYPE,
    //region: {latitude:33.74511, longitude:-84.38993, 
            //latitudeDelta:0.01, longitudeDelta:0.01},
    animate:true,
    regionFit:true,
    userLocation:true,
    annotations:[mountainView]
});
 
win.add(mapview);

var bottomview = Ti.UI.createView({
    bottom: 0,
    height : 50,
    width : '100%',
    backgroundColor: 'gray'
});

win.add(bottomview);

var removebutton = Ti.UI.createButton({
    top:10,
    left: 20,
    width: 100,
    title: 'Remove'
});
bottomview.add(removebutton);

var addbutton = Ti.UI.createButton({
    top:10,
    right: 20,
    width: 100,
    title: 'Add'
});
bottomview.add(addbutton);

removebutton.addEventListener('click', function(){
   mapview.removeAllAnnotations(); 
});

var addAnno = Titanium.Map.createAnnotation({
        latitude:37.490749,
        longitude:-122.081651,
        title:"Added Annotation",
        //subtitle:'add subtitle',
        pincolor: Titanium.Map.ANNOTATION_GREEN,
        animate:false,
        draggable:true
    }); 

addbutton.addEventListener('click', function(){
   mapview.addAnnotation (addAnno);
});


win.open();

This works on the simulator but not on iPad or iPhone device.

Comments

  1. Blain Hamon 2012-03-14

    Merged pull #1663
  2. Dustin Hyde 2012-03-16

    Closing as Fixed. SDK: 2.0.0.v20120316130302 Studio: 2.0.0.201203152033 OS: Snow Leopard Devices Tested: iPad2 4.3.5, iPhone4 5.0.1 Note: The simulator does not have a blue dot at all.
  3. Michael Pettiford 2012-05-03

    Reopening to add/remove labels

JSON Source