Skip to content

fix(android): ignore camera padding for marker view#3888

Merged
mfazekas merged 2 commits into
rnmapbox:mainfrom
ghitier:fix/marker-view-ignore-camera-padding
Aug 6, 2025
Merged

fix(android): ignore camera padding for marker view#3888
mfazekas merged 2 commits into
rnmapbox:mainfrom
ghitier:fix/marker-view-ignore-camera-padding

Conversation

@ghitier

@ghitier ghitier commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

Description

Fixes #3887

Checklist

  • I've read CONTRIBUTING.md
  • I updated the doc/other generated code with running yarn generate in the root folder
  • I have tested the new feature on /example app.
    • In V11 mode/ios
    • In New Architecture mode/ios
    • In V11 mode/android
    • In New Architecture mode/android
  • I added/updated a sample - if a new feature was implemented (/example)

Screenshot OR Video

See demo GIFs in #3887. Android now behaves the same as iOS (marker views don't disappear anymore).

Component to reproduce the issue you're fixing

See demo code in #3887.

@ghitier ghitier had a problem deploying to CI with Mapbox Tokens June 20, 2025 09:28 — with GitHub Actions Failure
@ghitier ghitier had a problem deploying to CI with Mapbox Tokens June 20, 2025 09:28 — with GitHub Actions Failure
@ghitier ghitier had a problem deploying to CI with Mapbox Tokens June 20, 2025 09:28 — with GitHub Actions Failure
@ghitier ghitier had a problem deploying to CI with Mapbox Tokens June 20, 2025 09:28 — with GitHub Actions Failure
@ghitier ghitier had a problem deploying to CI with Mapbox Tokens June 20, 2025 09:28 — with GitHub Actions Failure
@ghitier ghitier had a problem deploying to CI with Mapbox Tokens June 20, 2025 09:28 — with GitHub Actions Failure
@ghitier ghitier had a problem deploying to CI with Mapbox Tokens June 20, 2025 09:28 — with GitHub Actions Failure
@ghitier ghitier force-pushed the fix/marker-view-ignore-camera-padding branch from 2a2d20e to 49bc97f Compare July 22, 2025 11:21
@ghitier ghitier had a problem deploying to CI with Mapbox Tokens July 22, 2025 11:21 — with GitHub Actions Failure
@ghitier ghitier temporarily deployed to CI with Mapbox Tokens July 22, 2025 11:21 — with GitHub Actions Inactive
@ghitier ghitier had a problem deploying to CI with Mapbox Tokens July 22, 2025 11:21 — with GitHub Actions Error
@ghitier ghitier temporarily deployed to CI with Mapbox Tokens July 22, 2025 11:21 — with GitHub Actions Inactive
@ghitier ghitier had a problem deploying to CI with Mapbox Tokens July 22, 2025 11:21 — with GitHub Actions Failure
@ghitier ghitier temporarily deployed to CI with Mapbox Tokens July 22, 2025 11:21 — with GitHub Actions Inactive
@ghitier ghitier temporarily deployed to CI with Mapbox Tokens July 22, 2025 11:21 — with GitHub Actions Inactive
@mfazekas

Copy link
Copy Markdown
Contributor

@ghitier thanks much, is this Mapbox 11 only? For now we'll need to add some shim that's a noop on Mapbox 10, if that doesn't supports it.

file:///home/runner/work/maps/maps/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXMarkerView.kt:189:13 Unresolved reference 'ignoreCameraPadding'.

@ghitier

ghitier commented Jul 28, 2025

Copy link
Copy Markdown
Contributor Author

Hi @mfazekas. Thanks for getting back to me on this PR.

Yes, actually this fix is only for Mapbox v11. I didn't realise the ignoreCameraPadding view annotation option didn't exist in v10. I'm glad the pipelines caught that mistake.

I did take a quick look today: If I understand right I should add some sort of function in android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/Annotation.kt and in android/src/main/mapbox-v11-compat/v11/com/rnmapbox/rnmbx/v11compat/Annotation.kt, that I would then call from android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXMarkerView.kt. Does that seem right ?

Anyways, I will try to take a look.

EDIT 1 : I just realised I can do the exact same as for allowOverlapWithPuck view annotation option. Which is also mapbox 11 only.

EDIT 2 : Should be fixed now ✅

@ghitier ghitier had a problem deploying to CI with Mapbox Tokens July 29, 2025 07:15 — with GitHub Actions Error
@ghitier ghitier had a problem deploying to CI with Mapbox Tokens July 29, 2025 07:15 — with GitHub Actions Error
@ghitier ghitier had a problem deploying to CI with Mapbox Tokens July 29, 2025 07:15 — with GitHub Actions Error
@ghitier ghitier had a problem deploying to CI with Mapbox Tokens July 29, 2025 07:15 — with GitHub Actions Error
@ghitier ghitier had a problem deploying to CI with Mapbox Tokens July 29, 2025 07:15 — with GitHub Actions Error
@ghitier ghitier had a problem deploying to CI with Mapbox Tokens July 29, 2025 07:15 — with GitHub Actions Error
@ghitier ghitier had a problem deploying to CI with Mapbox Tokens July 29, 2025 07:15 — with GitHub Actions Error
@ghitier ghitier force-pushed the fix/marker-view-ignore-camera-padding branch from 800eed4 to 66e3a58 Compare July 29, 2025 07:23
@ghitier ghitier temporarily deployed to CI with Mapbox Tokens August 6, 2025 07:37 — with GitHub Actions Inactive
@ghitier ghitier temporarily deployed to CI with Mapbox Tokens August 6, 2025 07:37 — with GitHub Actions Inactive
@ghitier ghitier temporarily deployed to CI with Mapbox Tokens August 6, 2025 07:37 — with GitHub Actions Inactive
@ghitier ghitier temporarily deployed to CI with Mapbox Tokens August 6, 2025 07:37 — with GitHub Actions Inactive
@ghitier ghitier temporarily deployed to CI with Mapbox Tokens August 6, 2025 07:37 — with GitHub Actions Inactive
@ghitier ghitier temporarily deployed to CI with Mapbox Tokens August 6, 2025 07:37 — with GitHub Actions Inactive
@ghitier ghitier temporarily deployed to CI with Mapbox Tokens August 6, 2025 07:37 — with GitHub Actions Inactive
@mfazekas mfazekas merged commit cc2dfd3 into rnmapbox:main Aug 6, 2025
11 checks passed
efstathiosntonas pushed a commit to efstathiosntonas/maps that referenced this pull request Aug 8, 2025
* fix(android): ignore camera padding for marker view

* fix(android): mapbox 10 build error (due to cameraIgnorePadding option)
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

Successfully merging this pull request may close these issues.

[Bug]: Camera padding affects MarkerView differently on iOS and Android

2 participants