diff --git a/packages/maps/src/components/MapView.tsx b/packages/maps/src/components/MapView.tsx index f53d3af8f..e966aaefd 100644 --- a/packages/maps/src/components/MapView.tsx +++ b/packages/maps/src/components/MapView.tsx @@ -179,12 +179,19 @@ class MapView 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);