react-google-maps icon indicating copy to clipboard operation
react-google-maps copied to clipboard

[Bug] CollisionBehavior and conditional rendering for AdvancedMarker

Open soszik opened this issue 1 year ago • 1 comments

Description

Hi, I noticed unexpected behavior for Advanced Markers with collision behavior OPTIONAL_AND_HIDES_LOWER_PRIORITY. <AdvancedMarker key={id} position={{ lat: latValue, lng: lngValue }} zIndex={800} collisionBehavior={CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY} > In my particular case I render an array of markers for when zoom is within given level (showMarkers is set to true) showMarkers && <Markers> When markers are not visible and then zoom changes to certain level and they should be rendered, at first ALL Markers are visible and after short amount of time (less than 1 s) the overlapping markers are hidden.

Expected behavior: only not-overlapping markers should be visible from the beginning.

Steps to Reproduce

Render array of Advanced Marker with CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY with optional rendering based on Boolean flag. When they rendered after flag is set to true ALL markers are visible for max 1s, then overlapping markers disappear.

Environment

  • Library version: 1.1.0
  • Google maps version: weekly
  • Browser and Version: Chrome 126.0.6478.127 (Official Build) (64-bit)
  • OS: Windows 10

Logs

No response

soszik avatar Jul 15 '24 10:07 soszik

Unfortunately, this is an issue in the maps API, I filed an issue here: https://issuetracker.google.com/issues/356896467

usefulthink avatar Aug 01 '24 20:08 usefulthink