Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2477] iOS: Mapview no longer allows over 100 annotations

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-07-26T12:01:26.000+0000
Affected Version/sRelease 1.6.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterKevin Ripka
AssigneeNeeraj Gupta
Created2011-04-15T03:20:50.000+0000
Updated2012-07-26T22:04:56.000+0000

Description

Mapview for iphone no longer will allow over 100 annotations. Either hard crash or annotations stop at 100.


var win = Titanium.UI.createWindow({  
    title:'Annotation Test',
    backgroundColor:'#fff'
});
win.open();


var latPlus = 49;
var longPlus = -75;

var ans = [];

for (h=0;h<101;h++) {

    ans[h] = Titanium.Map.createAnnotation({
        latitude:latPlus + (h*0.001),
        longitude:longPlus + (h*0.001),
        title:h,
        animate:true,
        subtitle:'',
        pincolor:Titanium.Map.ANNOTATION_RED,
        myid:'note' + h
    }); 



}


var mapview = Titanium.Map.createView({
    mapType: Titanium.Map.STANDARD_TYPE,
    region: {latitude:49, longitude:-75, latitudeDelta:1, longitudeDelta:1},
    animate:false,
    regionFit:true,
    userLocation:false,
    top:0,
    left:0,
    height:460,
    width:320,
    annotations:ans
});

win.add(mapview);

Comments

  1. Stephen Tramer 2012-07-26

    Cannot reproduce SDK 2.2.0.014b86f with iPhone Sim 5.1. Tested with up to 2000 annotations just to make sure. Note that adding so many annotations creates a very intense memory spike (up to 75MB) which is then immediately leveled out to about 7MB once rendering begins. The number of annotations is likely constrained by memory availability as it would be with any native app.

JSON Source