Skip to content

[Bug]: Touches on map markers don’t block map gestures on Android #3981

@mariusud

Description

@mariusud

Mapbox Implementation

Mapbox GL

Mapbox Version

11.9.0

React Native Version

0.79.2

Platform

Android

@rnmapbox/maps version

10.1.39

Standalone component to reproduce

import React from 'react';
import Mapbox, { Camera, MapView, MarkerView } from '@rnmapbox/maps';
import { StyleSheet, View } from 'react-native';

export default function App() {
  return (
    <View style={{ flex: 1 }}>
      <MapView style={{ flex: 1 }}>
        <Camera zoomLevel={11} centerCoordinate={[10.63, 59.91]} />
        <MarkerView coordinate={[10.63, 59.91]}>
          <View style={styles.marker} />
        </MarkerView>
      </MapView>
    </View>
  );
}

const styles = StyleSheet.create({
  marker: {
    width: 28,
    height: 28,
    borderRadius: 14,
    backgroundColor: 'blue',
    borderWidth: 2,
    borderColor: 'white',
  },
});

Observed behavior and steps to reproduce

Long-press and drag the marker. You will see different behaviour depending on your device:

  • iOS: The marker stays under the finger, the map does not move.
  • Android: The map moves underneath, the marker does not drag.

Expected behavior

Behavior should be consistent between iOS and Android.
on iOS touch interactions on MarkerView (same goes for ShapeSource, PointAnnotation etc) are consumed by the marker and the map does not pan/zoom/rotate, which is the expected behaviour. While a marker is being pressed/dragged on android, the map should pans/zooms/rotates which is unexpected.

Notes / preliminary analysis

No response

Additional links and references

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    AndroidAndroid related ticketsbug 🪲Something isn't workingreproducedThe issue could be reproduced

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions