Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6626] Android: ti.map 5.3.0 clicks are not working correctly

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterMichael Gangolf
AssigneeAbir Mukherjee
Created2020-11-03T14:26:06.000+0000
Updated2021-01-22T17:06:38.000+0000

Description

I've created an issue on github already when the PR got merged: https://github.com/appcelerator-modules/ti.map/issues/342 With this https://github.com/appcelerator-modules/ti.map/pull/336 PR the Marker popups are not opening every time and a click on the boxes don't fire a click. *infoWindow click:* https://github.com/appcelerator-modules/ti.map/blob/master/android/src/ti/map/TiMapInfoWindow.java#L208 p is null and https://github.com/appcelerator-modules/ti.map/blob/master/android/src/ti/map/TiMapInfoWindow.java#L213 is returning 0/0 for me so it is not going into the if-case *pin click to open infoWindow* looks like it depends on the zoom level somehow *example*
var Map = require('ti.map');
var win = Titanium.UI.createWindow();
var annotations = [];

var mapview = Map.createView({
    mapType: Map.NORMAL_TYPE,
    animate: true,
    regionFit: true
});


for (var i = 0; i < 10; i++) {
	annotations.push(Map.createAnnotation({
		title: 'Appcelerator Inc.',
		subtitle: 'TiRocks!',
		clusterIdentifier: 'abc', // Required for clusters
		collisionMode: Map.ANNOTATION_VIEW_COLLISION_MODE_RECTANGLE,
		showAsMarker: true,
		markerGlyphText: i.toString(),
		markerColor: 'blue',
		markerGlyphColor: 'green',
		markerTitleVisibility: Map.FEATURE_VISIBILITY_VISIBLE,
		markerSubtitleVisibility: Map.FEATURE_VISIBILITY_HIDDEN,
		markerGlyphImage: 'path/to/flag.png',
		markerSelectedGlyphImage: 'path/to/flag-selected.png',
		annotationDisplayPriority: Map.FEATURE_DISPLAY_PRIORITY_DEFAULT_LOW,
		latitude: 40 + Math.random() * 0.1,
		longitude: 10 + Math.random() * 0.1,
	}));
}

mapview.region = {
	latitude: 40 + Math.random() * 0.1,
	longitude: 10 + Math.random() * 0.1,
	latitudeDelta: 0.2,
	longitudeDelta: 0.2
}


mapview.addEventListener('clusterstart', function(e) {
	Ti.API.info('clustering started!');

	var clusterAnnotation = Map.createAnnotation({
		showAsMarker: true,
		markerText: e.memberAnnotations.length.toString(),
		title: 'Cluster Title',
		subtitle: 'Cluster Subtitle',
	});

	mapview.setClusterAnnotation({
		annotation: clusterAnnotation,
		memberAnnotations: e.memberAnnotations
	});
});
mapview.addEventListener('click', function(event) {
    Ti.API.info('Clicked ' + event.clicksource + ' on ' + event.latitude + ', ' + event.longitude);
});
mapview.annotations = annotations;
win.add(mapview);
win.open();
Annoations not opening all the time. Working fine with 5.2.0

Comments

  1. Michael Gangolf 2021-01-22

    PR: https://github.com/appcelerator-modules/ti.map/pull/386

JSON Source