[TIMOB-10220] iOS: Annotations caret is offset from pin top and overlaps pin top
GitHub Issue | n/a |
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-08-14T11:02:30.000+0000 |
Affected Version/s | Release 2.1.0 |
Fix Version/s | Sprint 2012-16 API, Release 2.1.2, Release 3.0.0 |
Components | iOS |
Labels | SupportTeam, api, module_map, qe-testadded |
Reporter | Varun Joshi |
Assignee | Vishal Duggal |
Created | 2012-07-27T15:06:27.000+0000 |
Updated | 2012-08-14T18:01:14.000+0000 |
Description
Issue
In iOS the annotations on both retina and non-retina devices are offset from the pins top and they also overlap the pin. The annotation should be directly above the pin with no overlap like iOS does in its native maps application.
The screenshots illustrate this issue. Notice in the native maps application the caret is directly above the pin. It does not overlap the pin and it is not offset.
Sample Code
{noformat}
var win = Ti.UI.createWindow();
win.open();
//create object instance, a parasitic subclass of Observable
var self = Ti.UI.createView();
var mapObject = Titanium.Map.createView({
mapType: Titanium.Map.STANDARD_TYPE,
animate:true,
regionFit:true,
userLocation:true,
height:Ti.UI.FILL,
zoomEnabled:true,
region: {latitude:37.77501, longitude:-122.419,
latitudeDelta:0.01, longitudeDelta:0.01},
});
var selectAnnotations = Ti.UI.createButton({
title:"Select Annotations",
bottom:'20dp',
height:'35dp',
width:'180dp'
});
var annotation = Titanium.Map.createAnnotation({
animate:true,
title: 'Hello I am an annotation with lots of information:',
subtitle: 'This is a subtitle to an large annotation',
pincolor:Titanium.Map.ANNOTATION_RED,
latitude:parseFloat(37.776),
longitude:parseFloat(-122.419)
});
var annotation2 = Titanium.Map.createAnnotation({
animate:true,
title: '#2 Hello I am an annotation with lots of information:',
subtitle: 'This is a subtitle to an large annotation',
pincolor:Titanium.Map.ANNOTATION_RED,
latitude:parseFloat(37.77501),
longitude:parseFloat(-122.419)
});
var annotation3 = Titanium.Map.createAnnotation({
animate:true,
title: '#3 Hello I am an annotation with lots of information:',
subtitle: 'This is a subtitle to an large annotation',
pincolor:Titanium.Map.ANNOTATION_RED,
latitude:parseFloat(37.770),
longitude:parseFloat(-122.419)
});
var annotation4 = Titanium.Map.createAnnotation({
animate:true,
title: '#4 Hello I am an annotation with lots of information:',
subtitle: 'This is a subtitle to an large annotation',
pincolor:Titanium.Map.ANNOTATION_RED,
latitude:parseFloat(37.770),
longitude:parseFloat(-122.43)
});
mapObject.addAnnotation(annotation);
mapObject.addAnnotation(annotation2);
mapObject.addAnnotation(annotation3);
mapObject.addAnnotation(annotation4);
self.add(mapObject);
self.add(selectAnnotations);
var thisObj = this;
selectAnnotations.addEventListener('click', function(e) {
mapObject.selectAnnotation({annotation: annotation2, center: false});
});
win.add(self);
{noformat}
Attachments
Pull pending https://github.com/appcelerator/titanium_mobile/pull/2662
NOTE
Test case select Annotation click event listener is wrong. It should be calling.Reopening to update Fixversion to Release 2.1.2 label