[AC-2234] Android: Annotations with Google Maps V2 - Clicking on annotation's info window doesnt work
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2013-07-22T19:02:31.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Appcelerator Modules |
Labels | n/a |
Reporter | diego |
Assignee | Eduardo Gomez |
Created | 2013-04-02T05:59:04.000+0000 |
Updated | 2016-03-08T07:41:14.000+0000 |
Description
*Problem*
When the user clicks on an annotation's info window I need to perform an action, but I can't catch the event when the user clicks on the info window, only when the annotation pin is clicked.
I read that this is a bug, and that you should be able to click on an annotation's info window to reveal another window to show more information.
*Test case*
var MapModule = require('ti.map');
var win = Ti.UI.createWindow({
backgroundColor : 'white'
});
map1 = MapModule.createView({
userLocation : true,
mapType : MapModule.NORMAL_TYPE,
animate : true,
region : {
latitude : 37.389569,
longitude : -122.050212,
latitudeDelta : 0.1,
longitudeDelta : 0.1
},
height : 'auto',
top : 0,
left : 0,
width : 'auto'
});
var myAdd = MapModule.createAnnotation({
latitude : 37.389569,
longitude : -122.050212,
title : "Appcelerator Headquarters",
subtitle : 'Mountain View, CA',
pincolor : Ti.Map.ANNOTATION_GREEN,
myid : 1
});
//the next eventListener only works when you click de Annotation and not the little white box information.
myAnotation1.addEventListener('click', function(e) {
alert("Annotation popup clicked");
});
map1.addAnnotation(myAnotation1);
win.add(map1);
win.open();
Attachments
File | Date | Size |
---|---|---|
bug map annotation.png | 2013-04-03T00:19:29.000+0000 | 551906 |
Hi Diego, Can you please provide some additional information on this issue: - Titanium Studio Version - Titanium SDK Version - Small Reporducible test case You can see the full guidelines of how to submit a ticket here: https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report
Titanium Studio, build: 3.0.2.201302191606- 19022013160949 Titanium SDK: 3.0.2 GA Note:new image attached. if you click on the red point (Annotation) the event trigger works! so the little white box with 'title' and 'subtitle' comes up, and additionally you can put some piece of code in this event which is called from the code in this way: myAnnotation.addEventListener('click', function(e){ //some stuff }); ok, everything looks good, but... when i try to click the little white box information displayed from the annotation (surrounded with green frame in the attached image)there is the problem! it does not have any event, so i canĀ“t do anything when i want to click this little box, and other platforms y saw that you can really do! but i dont know why in Titanium this is imposible. I think it is not necessary a small reproducible test case, but anyway here is a little piece of code: [Moved to description]
Event Handling
Closing as invalid. The Map View object provides a few extra events that provide additional control for using the Map module: click - This event only fires when the user selects or deselects an Annotation object and does not respond to any other user interaction. Check the event object's annotation property to see which annotation was clicked and the clicksource property to see what part of the annotation the user clicked.Simple sample
Output
Further reading
http://docs.appcelerator.com/titanium/latest/#!/guide/Google_Maps_v2_for_Android-section-36739898_GoogleMapsv2forAndroid-EventHandlingClosing since we have not heard back from the reporter and a functional sample has been posted by [~egomez]