MapCameraState
A snapshot of the map camera.
An immutable value type on purpose — MapLibre's CameraPosition carries fields this SDK does not expose (altitude, roll, field of view, padding), so equality and change detection on it are unreliable.
Two states are equal when they frame the same view of the world, and that takes two departures from a data class's generated equality — which is why equals/hashCode/copy are hand-written here, the same reasoning as com.getwemap.sdk.core.model.entities.Coordinate:
lastChangeReason is excluded, because why the camera moved does not change where it is. A camera the integrator builds has no reason and the map always reports one, so including it would make every update compare unequal.
The scalars are compared with a small epsilon. MapLibre round-trips a camera through its own math, so one you apply comes back a few ULPs off — apply a bearing of
30.0and the map reports29.999999999999996. Under exact equality the camera you set would never equal the camera the map reports.
Together, those are what let a two-way camera state recognise its own value instead of re-applying it in a loop. hashCode uses the exact values and is therefore not consistent with equals — the same deliberate trade-off Coordinate makes.