mapbox / mapbox/mapbox-maps-ios

ViewAnnotation culling behavior customization

Open
#2,401 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged feature :green_apple:
Dominant language
Swift
Stars
601
Forks
196
PR merge metrics
No merged PRs in 30d

Description

## New Feature
I am noticing that marker components utilizing ViewAnnotation disappear when at the edge of the screen, obviously for performance reasons. However, I'm noticing markers are un-rendering when not fully offscreen, which creates a jarring and not so fluid look. I understand that PointAnnotations or SymbolLayers resolve this issue, but given some of the interactive features I need and the complex styling, I need to use ViewAnnotations.

Is there a way to ensure the marker is fully offscreen before un-rendering? My understanding is there's some internal logic that examines the viewport in order to determine if a marker should be visible. I'm hoping I can somehow configure it so that there is extra padding to the viewport, i.e. the marker does not render until it is 100px off-screen for instance.

If this is not already a feature I missed, adding this would be great.

Thanks for the help!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the ViewAnnotation viewport-culling entry point and how visibility is decided near screen edges. Determine where configurable viewport padding could be exposed, then verify that annotations remain rendered until they pass the requested off-screen margin. Done means the behavior is configurable and covered for partially visible markers.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.