[TIMOB-7868] iOS: change map annotation to fire event when the annotation pin is clicked
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2017-08-01T22:37:35.000+0000 |
Affected Version/s | Release 1.8.0.1, Release 1.8.1, Release 1.8.2, Release 3.1.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | module_map, parity, qe-testadded |
Reporter | Dustin Hyde |
Assignee | Eric Merriman |
Created | 2012-03-02T14:57:59.000+0000 |
Updated | 2017-08-01T22:37:35.000+0000 |
Description
When a map annotation is visible and the related pin is clicked, no annotation click event is fired. It works on Android. Parity.
Clone of TIMOB-7272.
Steps to Reproduce:
1. Run code.
var win = Ti.UI.createWindow();
var atlantaParams = {
latitude:33.74511,
longitude:-84.38993,
title:"Atlanta, GA",
subtitle:'Atlanta Braves Stadium\nfoo',
animate:true,
rightButton: Titanium.UI.iPhone.SystemButton.DISCLOSURE,
myid:3 // CUSTOM ATTRIBUTE THAT IS PASSED INTO EVENT OBJECTS
};
atlantaParams.pincolor = Titanium.Map.ANNOTATION_PURPLE;
var atlanta = Titanium.Map.createAnnotation(atlantaParams);
var mapview = Titanium.Map.createView({
mapType: Titanium.Map.STANDARD_TYPE,
region:{latitude:33.74511, longitude:-84.38993, latitudeDelta:0.5, longitudeDelta:0.5},
animate:true,
regionFit:true,
userLocation:true,
annotations:[atlanta]
});
mapview.addEventListener("click", function(e) {
var info = '\n';
info += 'type: ' + e.type + '\n';
info += 'clicksource: ' + e.clicksource + '\n';
info += 'title: ' + e.title + '\n';
info += 'index: ' + e.index + '\n';
info += 'annotation: ' + e.annotation + '\n';
info += 'map: ' + e.map + '\n';
info += 'source: ' + e.source + '\n';
Ti.API.info(info);
alert(info);
});
mapview.addAnnotation(atlanta);
win.add(mapview);
win.open();
2. Click pin to open annotation. Close first alert.
3. Click pin again when annotation is open.
Expected Result:
Annotation event should fire, with alert.
Actual Result:
No event fired, as it would in Android.
Now that we actually have gesture listeners, we can implement click detection on maps. There are some long-standing parity bugs involving map click detection.
Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0
I'm subscribing to this bug, still occurs on 3.1.2.GA / iPhone Simulator 6.0 Really annoying because the only way to listen click on markers is to set a title and have this not very nice black bubble above the marker. I don't know if there is a workaround to force the black bubble to stay hidden.
Closing due to inactivity. If this issue still exists, please raise a new ticket.