Commit bcd5faa
[MAPSAND-2541] Clarify scale/pixel density docs for addStyleImage and addImage (#10400)
### Summary
Fixes https://mapbox.atlassian.net/browse/MAPSAND-2541
- Updated `@param scale` KDoc in `addStyleImage` to explain pixel
density semantics with a concrete example
- Added pixel density explanation paragraphs to all 4 `addImage`
overloads in `MapboxStyleManager.kt`
### Problem
The `scale` parameter in `addStyleImage` was documented only as "A scale
factor for the image," giving no indication of how scale affects
rendering. Similarly, `addImage` overloads had no documentation
explaining how pixel dimensions relate to display size, causing
developer confusion when images appear at unexpected sizes.
### Solution
Clarify that `scale` represents pixel density: image pixel dimensions
are divided by the scale value to determine display size in dp. For
`addImage`, document that pixel dimensions are assumed to match device
screen density, and point users to `addStyleImage` when custom density
is needed.
### Key Changes
- **`MapboxStyleManager.kt` — `addStyleImage`**: `@param scale` updated
from "A scale factor for the image" to full pixel density explanation
with 100x100 @ scale=2.0 → 50x50dp example
- **`Style.kt` — `addStyleImage`**: Same `@param scale` clarification
applied
- **`MapboxStyleManager.kt` — `addImage` (×4 overloads)**: Added
paragraph explaining dimensions assumed to match device screen density,
with reference to `addStyleImage` for custom density
### Validation
- [x] Documentation-only change — no behavioral or API surface changes
- [x] Verified wording is consistent across all affected overloads
- [x] Confirm generated KDoc output renders correctly
cc @mapbox/maps-android
GitOrigin-RevId: bb6f72c95065ad19163d733caad2bfa12e71a1fb1 parent 6a42c1c commit bcd5faa
2 files changed
Lines changed: 22 additions & 2 deletions
File tree
- maps-sdk/src/main/java/com/mapbox/maps
- sdk-base/src/main/java/com/mapbox/maps
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
782 | | - | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
783 | 785 | | |
784 | 786 | | |
785 | 787 | | |
| |||
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1216 | 1216 | | |
1217 | 1217 | | |
1218 | 1218 | | |
1219 | | - | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
1220 | 1222 | | |
1221 | 1223 | | |
1222 | 1224 | | |
| |||
1541 | 1543 | | |
1542 | 1544 | | |
1543 | 1545 | | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
1544 | 1550 | | |
1545 | 1551 | | |
1546 | 1552 | | |
| |||
1566 | 1572 | | |
1567 | 1573 | | |
1568 | 1574 | | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
1569 | 1579 | | |
1570 | 1580 | | |
1571 | 1581 | | |
| |||
1588 | 1598 | | |
1589 | 1599 | | |
1590 | 1600 | | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
1591 | 1605 | | |
1592 | 1606 | | |
1593 | 1607 | | |
| |||
1619 | 1633 | | |
1620 | 1634 | | |
1621 | 1635 | | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
1622 | 1640 | | |
1623 | 1641 | | |
1624 | 1642 | | |
| |||
0 commit comments