Closed Trinea closed 8 years ago
I tried reproducing this issue with current state of master but I'm not getting the same result.
See this clip:
This is the code I used in MainActivity.java
:
mMapboxMap.setOnMapLongClickListener(new MapboxMap.OnMapLongClickListener() {
@Override
public void onMapLongClick(@NonNull LatLng point) {
MarkerOptions marker = new MarkerOptions()
.position(point)
.title("Dropped Pin")
.snippet(LAT_LON_FORMATTER.format(point.getLatitude()) + ", " +
LAT_LON_FORMATTER.format(point.getLongitude()));
mMarkerList.add(marker);
Marker m = mapboxMap.addMarker(marker);
Snackbar.make(mCoordinatorLayout, "Marker added with id "+m.getId(),Snackbar.LENGTH_SHORT).show();
}
});
mMapboxMap.setOnMarkerClickListener(new MapboxMap.OnMarkerClickListener() {
@Override
public boolean onMarkerClick(@NonNull Marker marker) {
Snackbar.make(mCoordinatorLayout, "Marker Click on marker with id " + marker.getId(), Snackbar.LENGTH_SHORT).show();
return false;
}
});
Sorry for not being able to give you the commit where this was fixed. A lot has changed over the lasts months and it's hard to keep track on all the changes. Going to close this issue for now, reopen if you can reproduce this with the SNAPSHOT.
ok
I have added a marker on map, but when i clicked the marker, its getId() is not same to the marker I have added before. this caused to i cannot distinguish markersin
public boolean onMarkerClick(@NonNull Marker marker)
Example code:
and the output of logcat after i clicked the marker be added is: