mapbox-maps-android
mapbox-maps-android copied to clipboard
[API Design] getters and setters for minZoom/maxZoom behave inconsistently
Environment
- Android OS version: Any
- Devices affected: Any
- Maps SDK Version: 10.8.1
Observed behavior and steps to reproduce
Given in my style I have any layer with no min/ max zoom properties set, like the following:
{
"id" : "vector_land",
"type" : "background",
"layout" : {},
"paint" : {...},
"metadata" : {
"mapbox:featureComponent" : "land-and-water",
"mapbox:group" : "Land, water, & sky, land"
}
}
By accessing the zoom properties via layer.minZoom or layer.maxZoom the values returned are Double.POSITIVE_INFINITY and Double.NEGATIVE_INFINITY.
The corresponding API to set the zoom properties though throws an exception when setting those values
val minZoomFromStyle = layer.minZoom
layer.minZoom(minZoomFromStyle)
// throws java.lang.IllegalArgumentException: Incorrect property value for minzoom: Value can not be Double.NaN, Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY
The documentation for minZoom and maxZoom is also outdated

Expected behavior
A well designed API or a changelog that contains breaking changes and accompanying documentation.