Titanium JIRA Archive
Appcelerator Community (AC)

[AC-325] Annotation click on leftButton/rightButton not firing as expected

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2015-11-12T11:49:00.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsclick, mapView, pin
ReporterAlberto Marcone
AssigneeMostafizur Rahman
Created2015-08-26T14:59:10.000+0000
Updated2015-11-12T11:49:00.000+0000

Description

The click on the leftButton or rightButton are simply not fired. The click is fired if I click on the pin, and I get a response like this:
click {
      annotation = "[object TiMapAnnotation]";
      bubbles = 1;
      cancelBubble = 0;
      clicksource = pin;
      index = 0;
      map = "[object mapview]";
      source = "[object mapview]";
      title = Cupertino;
      type = click;
 }
Sample project: index.js
Ti.Map = require("ti.map");

var annotation = Ti.Map.createAnnotation({
	latitude : "37.322998",
	longitude : "-122.032182",
        title : "Cupertino",
	subtitle : "",
	leftButton : Titanium.UI.iPhone.SystemButton.DISCLOSURE,
});
$.mapview.addAnnotation(annotation);	

$.mapview.region = {
	 latitude : "37.322998",
            longitude : "-122.032182",
            latitudeDelta : 0.3,
            longitudeDelta : 0.3
};

$.mapview.selectAnnotation(annotation);

$.mapview.addEventListener("click", function(e) {
	console.log("click",e);
});
$.index.open();
index.xml
<Alloy>
	<Window>
		<View id="mapview" module="ti.map">
        </View>
	</Window>
</Alloy>

Comments

  1. Jebun Naher 2015-11-12

    Hello, We couldn't reproduce this issue as a bug in our environment. leftButton/rightButton annotation click works as expected. *Test Result*
       [INFO] :   click pin
       [INFO] :   click leftButton
       [INFO] :   click rightButton
       
    [Screenshot](http://postimg.org/image/7rbxb9ovx/) *Testing Environment:* Appcelerator Command-Line Interface, version 5.0.4 Appcelerator Studio, build: 4.3.3.201510212245 Ti SDK Version : 5.0.2.GA Node.js Version : 0.10.37 Mac OS X,Version : 10.10.1 Jdk version : 1.7.0_80.jdk simulator : iPhone 6(8.2) *Steps to test:* 1. Create an Alloy project. 2. Copy below test codes to respective files of your project. 3. Run the project. Click on leftButton and rightButton and observe the output in console. *Test Case:* index.xml
       <Alloy>
       	<Window>
       		<View id="mapview" module="ti.map">
               </View>
       	</Window>
       </Alloy>
       
    index.js
       Ti.Map = require("ti.map");
        
       var annotation = Ti.Map.createAnnotation({
       	latitude : "37.322998",
       	longitude : "-122.032182",
       	title : "Cupertino",
       	subtitle : "",
       	leftButton : Titanium.UI.iPhone.SystemButton.DISCLOSURE,
       	rightButton : Titanium.UI.iPhone.SystemButton.DISCLOSURE,
       });
       $.mapview.addAnnotation(annotation);
        
       $.mapview.region = {
       	latitude : "37.322998",
       	longitude : "-122.032182",
       	latitudeDelta : 0.3,
       	longitudeDelta : 0.3
       };
        
       $.mapview.selectAnnotation(annotation);
       $.mapview.addEventListener("click", function(e) {
       	console.log("click", e.clicksource);
       });
       $.index.open(); 
       
    Thanks.

JSON Source