mapbox / mapbox/mapbox-maps-android

Polygon breaks when zooming in

Open
#733 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

:stop_sign: blocked auto-triaged bug :beetle:
Dominant language
Kotlin
Stars
578
Forks
161
PR merge metrics
No merged PRs in 30d

Description

## Environment

- Android OS version: Android 11
- Devices affected: Samsung S10+
- Maps SDK Version: 9.7.0, "com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0", **Reproduced in v10 as well.**

Reproduced on Emulator Pixel 4 API 29 as well.

## Observed behavior and steps to reproduce

Add a hexagon with the following points, using the **Plugin Annotation**:
`[[35.52482636074315,24.014679947948405],[35.51114716956354,24.01391178034676],[35.50374631403231,24.02820018964633],[35.51002341064811,24.043258382501087],[35.52370239640629,24.044030629840638],[35.53110449138368,24.02974060478422]]`

This point is on Greece (but it doesn't matter you can add any hexagon you like). When zooming up to a certain point (<13 based on `mapboxMap.cameraPosition.zoom`) everything is OK. **As soon as you zoom >=13 the polygon breaks.** If you zoom back to <13 it is OK etc etc. I have attached these two screenshots to understand the difference:

**Correct Polygon:**
![2](https://user-images.githubusercontent.com/19330987/136657076-939baf17-75cf-425b-b189-7d1bb0bbf8c3.jpg)

**Broken Polygon:**
![1](https://user-images.githubusercontent.com/19330987/136657077-6558a4bf-1b5c-4498-97f2-ce9c997a8fe2.jpg)

## Expected behavior

The polygon should keep its format. The bounding points haven't changed at all.

## Notes / preliminary analysis

Same thing happens with bigger polygons as well, after a certain zoom level they break.

## Additional links and references

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

Reproduce the issue with the supplied hexagon points using the Plugin Annotation and vary mapboxMap.cameraPosition.zoom around 13. Trace the polygon rendering path for the annotation plugin and compare behavior below and at zoom 13; done means the polygon keeps the same shape while zooming.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
computer-graphics, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.