Skip to content

[Bug]: Marker disappears when intersecting with edge of the screen #4096

@LeunensMichiel

Description

@LeunensMichiel

Mapbox Implementation

Mapbox

Mapbox Version

11.6.6

React Native Version

0.85.5

React Native Architecture

New Architecture (Fabric/TurboModules)

Platform

iOS, Android

@rnmapbox/maps version

10.2.7

Standalone component to reproduce

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


class BugReportExample extends React.Component {
  render() {
    return (
      <MapView
  	style={{height: '100%'}}
  	projection="mercator"
  	styleURL="mapbox://styles/mapbox/standard"
  >
  	<MarkerView
  		coordinate={[4.3572, 50.8477]}
  	>
  			<View
				style={{
					width: 40,
					height: 40,
					backgroundColor: "red"
				}}
			></View>
  	</MarkerView>
  </MapView>
    );
  }
}

Observed behavior and steps to reproduce

You'll see when the marker (size 40px), is 20px over the edge of the screen, the marker disappears. This is extra visible when you play with custom anchor points. When you play with a custom anchor (eg 1,1), you'll see the marker disappearing way too soon (a marker with size of 40px will already disappear when its 40px away from the edge)

Expected behavior

The map should remove the marker from the view when the marker is 100% outside of bounds as an optimization. When the marker is still halfway visible, it should not disappear. This avoids pop-in/pop-uit effects

Notes / preliminary analysis

No response

Additional links and references

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions