Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a hook to determine the contents of annotations causes other annotations to detach from map #417

Open
edfungus opened this issue Jul 15, 2024 · 3 comments

Comments

@edfungus
Copy link

Steps to Trigger Behavior

  1. Create map with annotation component that relies on zustand/immer (add a boolean to the state) (distanceRings in example repo)
  2. Add a regular annotation on the map (PointAnnotation in example repo)
  3. Toggle the boolean
  4. Move map and the regular annotation detaches

Link to Minimal Reproducible Example

https://github.com/edfungus/maplibre-example/tree/main

Map usage
Main home screen

Expected Behavior

Map would move with all annotations staying in place.

Actual Behavior

Some annotations will detatch from screen and eventually whole map will be unresponsive

Screenshots (if applicable)

Issue demo:

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-07-14.at.22.08.14.mp4

Remove distanceRing component:

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-07-14.at.22.08.36.mp4

Version(s) affected

  • Platform: iOS
  • OS version: iOS 17.5
  • Device type: iPhone 11 Pro / 15 Pro
  • Emulator/ Simulator: both
  • Development OS: MacOS 14.5
  • maplibre-react-native Version: 10.0.0-alpha.8
  • MapLibre GL version: ?
  • React Native Version: 0.74.3

Additional context

Even without the Zustand/immer component, the PointAnnontation rubber bands a bit (even on device) so I feel like something with the rendering has changed. I have tried useMemo as well to reduce calculations but it didn't seem to affect anything.

The reason I'm inclined to think it has to do with Maplibre is because:

Happy to help test and debug as well. Took me a while to get the demo cut down from the app. I can't think of anything else to try atm

@caspg
Copy link
Contributor

caspg commented Jul 15, 2024

@edfungus thanks a lot for detailed issue and example app. Could you also try with Maplibre:

  • 10.0.0-alpha.3 (before new metal renderer was used on IOS)
  • 9.1.0 (before repo was migrated to Typescript).

@edfungus
Copy link
Author

  • 10.0.0-alpha.3 crashed in simulator. No issue on device though! (jiggle seems to be gone too)
  • I can't get v9 working :/ I had issues upgrading for a while since v9.0.1 and jumped straight to v10.alpha6. I can try debugging more but I'm not super hopeful

@knecht
Copy link

knecht commented Aug 9, 2024

The first video looks very similar to a problem I am currently investigating. For me, updating maplibre-native from 6.4.0 to 6.5.3 helped. Could be worth a try in your case, too.
Note that I had to change the version manually in project.pbxproj . Specifying the desired version in Podfile according to https://github.com/maplibre/maplibre-react-native/blob/main/ios/install.md did not have any effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants