Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2322] iOS/Android: Add mapclick event to MapView in Ti.Map Module

GitHub Issuen/a
TypeNew Feature
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-05-24T22:14:14.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.2.0
ComponentsMap
Labelsandroid, community, ios
ReporterNick Kemp
AssigneeHans Knöchel
Created2017-01-25T07:48:24.000+0000
Updated2018-08-06T17:49:22.000+0000

Description

Tapping on a map to create points of interest seems like a fairly common use-case. The current module explicitly states that the MapView click event is fired for annotations, shapes etc. and not the view itself. I have added a new mapclick event to the ios implementation in our branch of the module. Wondering if someone can chime in with an android implementation?

Comments

  1. Hans Knöchel 2017-01-25

    Interesting feature request, I'd agree to have this included. Can you do a PR on the ti.map module and link the PR here - together with a quick demo-code (single app.js) to demonstrate the behavior? Then we can help doing the docs and further adjustments. Thx! :-) Moving to MOD
  2. Sharif AbuDarda 2017-02-20

    Hello [~nickkemp], Can you go ahead and create the PR and a demo code? Thanks.
  3. Nick Kemp 2017-02-20

    [https://github.com/appcelerator-modules/ti.map/pull/198]
       var MapModule = require('ti.map');
       var win = Ti.UI.createWindow({
           title: "Ti.Map",
           includeOpaqueBars: true,
           extendEdges: [Ti.UI.EXTEND_EDGE_ALL]
       });
       
       var nav = Ti.UI.iOS.createNavigationWindow({
           window: win
       });
       
       var mapView = MapModule.createView({
           userLocation: false,
           mapType: MapModule.NORMAL_TYPE,
           rotatesEnabled: true,
           animate: true,
           region: { 
               latitude: -37.7870, 
               longitude: 175.2793,
               latitudeDelta: 0.1,
               longitudeDelta: 0.1
           },
           // height: '50%',
           width: Ti.UI.FILL,  
       });
       win.add(mapView);
       
       function handlMapClick(e) {
           Ti.API.warn("\"mapclick\" event fired!");
           Ti.API.warn(e);
       }
       
       mapView.addEventListener("mapclick", handlMapClick);
       
       win.add(mapView);
       nav.open();
       
  4. Hans Knöchel 2017-05-24

    [~nickkemp] I merged iOS, but forgot about Android. Can you provide the parity-PR for it?
  5. Nick Kemp 2017-05-24

    sorry don't have the tooling atm - on a totally different project - I've put a request out on TiSlack. Would be good to keep the momentum. Thanks Hans.
  6. Eric Merriman 2018-08-06

    Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.

JSON Source