Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] reintroduce OnMapChange invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasPaczos authored and Łukasz Paczos committed Nov 6, 2018
1 parent afe7e8d commit 5ad0c81
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,19 @@ public void onSurfaceCreated(GL10 gl, EGLConfig config) {
nativeMapView = new NativeMapView(
getContext(), getPixelRatio(), crossSourceCollisions, this, mapChangeReceiver, mapRenderer
);

// deprecated API
nativeMapView.addOnMapChangedListener(new OnMapChangedListener() {
@Override
public void onMapChanged(int change) {
// dispatch events to external listeners
if (!onMapChangedListeners.isEmpty()) {
for (OnMapChangedListener onMapChangedListener : onMapChangedListeners) {
onMapChangedListener.onMapChanged(change);
}
}
}
});
}

private void onSurfaceCreated() {
Expand Down Expand Up @@ -1063,9 +1076,7 @@ public void addOnMapChangedListener(@NonNull OnMapChangedListener listener) {
*/
@Deprecated
public void removeOnMapChangedListener(@NonNull OnMapChangedListener listener) {
if (onMapChangedListeners.contains(listener)) {
onMapChangedListeners.remove(listener);
}
onMapChangedListeners.remove(listener);
}

/**
Expand Down

0 comments on commit 5ad0c81

Please sign in to comment.