Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onTap/onCalloutTap not working from XML declared map #49

Closed
bradmartin opened this issue Oct 26, 2016 · 2 comments
Closed

onTap/onCalloutTap not working from XML declared map #49

bradmartin opened this issue Oct 26, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@bradmartin
Copy link
Contributor

bradmartin commented Oct 26, 2016

 <!-- MapBox -->
<map:Mapbox row="1" col="0" rowSpan="5" colSpan="5" id="map" disableRotation="true" mapStyle="streets" mapReady="{{ onMapReady }}" latitude="39.8282" longitude="-98.5795" zoomLevel="2.42" showUserLocation="true" hideLogo="true" hideAttribution="true" accessToken="myKey"></map:Mapbox>
 /**
     * onMapReady
     */
    public onMapReady(args) {

        this._map = args.map;

        let opts: Array<MapBox.AddMarkersOption> = [{
            lat: 36.3884,
            lng: -86.4467,
            title: 'Gallatin, TN',
            subtitle: 'Hello World!',
            onTap: function (marker) {
                console.log('MARKER: ' + marker);
                console.log('TAP 1');
            },
            onCalloutTap: function () { console.log("'Nice location' marker callout tapped"); }
        }];
        args.map.addMarkers(opts);

    }

Marker is present on the map but tapping the marker and the callout do not log anything.

@EddyVerbruggen EddyVerbruggen self-assigned this Oct 26, 2016
@EddyVerbruggen
Copy link
Collaborator

Oh damn, found the culprit - the click listener is only wired on Android in case you use the show function. Let me refactor that a bit..

@EddyVerbruggen
Copy link
Collaborator

Part of 2.2.1 which is not released yet. You can get the bugfix by updating mapbox.android.js manually if you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants