Lucian Novac
Lucian Novac

Reputation: 1265

Mapbox select pin listener

How to get listener for MapBox pin. I want to change the drawable icon when I tap on the marker.

Marker marker = new Marker(myMapBoxView,title, details, new LatLng(latitude,longitude));
                marker.setIcon(new Icon(myDrawable)));

If I will tap this marker I will want to change the drawable. What is the listener to get this action.

Thank you!

Upvotes: 0

Views: 867

Answers (1)

Lucian Novac
Lucian Novac

Reputation: 1265

I spend almost one day to find it. If somebody have same problem you can find the listener here:

myMapBoxView.setMapViewListener(new MapViewListener() {
            @Override
            public void onShowMarker(MapView mapView, Marker marker) {

            }

            @Override
            public void onHideMarker(MapView mapView, Marker marker) {

            }

            @Override
            public void onTapMarker(MapView mapView, Marker marker) {

            }

            @Override
            public void onLongPressMarker(MapView mapView, Marker marker) {

            }

            @Override
            public void onTapMap(MapView mapView, ILatLng iLatLng) {

            }

            @Override
            public void onLongPressMap(MapView mapView, ILatLng iLatLng) {

            }
        });

Upvotes: 3

Related Questions