Skip to content

Commit

Permalink
Fix callouts not showing on IOS
Browse files Browse the repository at this point in the history
  • Loading branch information
YoussefHenna committed Jul 18, 2023
1 parent f60f360 commit df78b5c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/maps/src/components/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,19 @@ class MapView<T> extends React.Component<
}

// Dismiss all other callouts except the one just pressed. Maintains that only one is opened at a time
private onMarkerPress(markerIdentifier: string) {
for (const [idenfitifer, markerRef] of this.markerRefs) {
if (idenfitifer !== markerIdentifier) markerRef.current?.hideCallout();
// Web specfic, this is the default on native
private dismissAllOtherCallouts(markerIdentifier: string) {
if (Platform.OS === "web") {
for (const [idenfitifer, markerRef] of this.markerRefs) {
if (idenfitifer !== markerIdentifier) markerRef.current?.hideCallout();
}
}
}

private onMarkerPress(markerIdentifier: string) {
this.dismissAllOtherCallouts(markerIdentifier);
}

private getMarkerRef(markerIdentifier: string) {
if (this.markerRefs.has(markerIdentifier)) {
return this.markerRefs.get(markerIdentifier);
Expand Down

0 comments on commit df78b5c

Please sign in to comment.