[MOD-2442] Android: MapView with clustering does not send click event
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2018-08-17T21:52:04.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Ti.Map Android 4.3.1 |
Components | Map |
Labels | n/a |
Reporter | Yordan Banev |
Assignee | Yordan Banev |
Created | 2018-07-25T09:52:52.000+0000 |
Updated | 2018-08-17T21:52:04.000+0000 |
Description
When using a MapView with clustering support clicking an Annotation not in a cluster does not trigger a
click
event, but opens the InfoWindow.
*Sample code:*
_app.js_
var MapModule = require('ti.map');
var win = Ti.UI.createWindow({ backgroundColor: 'white' });
var opera = MapModule.createAnnotation({
latitude: -33.8569,
longitude: 151.2153,
centerOffset: { x: 80, y: 25 },
pincolor: MapModule.ANNOTATION_RED,
//image: 'SydneyOperaHouse.jpg',
title: 'Sydney Opera',
subtitle: 'Sydney, New South Wales, Australia',
// For eventing, use the Map View's click event
// and monitor the clicksource property for 'rightButton'.
//rightButton: Ti.UI.ios.SystemButton.CONTACT_ADD
});
var mapview = MapModule.createView({
mapType: MapModule.NORMAL_TYPE,
region: { latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 },
annotations: [opera]
});
win.add(mapview);
mapview.addEventListener('click', function(e) {
if (e.annotation === opera) {
mapview.removeAnnotation(opera);
opera = null;
opera = MapModule.createAnnotation({
latitude: -33.8569,
longitude: 151.2153,
pincolor: MapModule.ANNOTATION_BLUE,
//title: 'Test Annotation'
});
mapview.addAnnotation(opera);
}
});
win.open();
PR: https://github.com/appcelerator-modules/ti.map/pull/239
Not working correctly for me.
that are not inside a cluster return "pin" but annotations inside a cluster - that are visible when zooming in - only open the infobox but won't return "pin"
[~michael] I have updated the PR. Would you be able to give it a shot now?
[~ybanev] much better now! Click on the cluster still zooms, click on each annotation (normal or out of a cluster) fires the "pin" source. I like the removal of the TiClusterMarker so it's easier to handle the items!