maplibre / maplibre-native

MapLibre Native - Interactive vector tile maps for iOS, Android and other platforms.
https://maplibre.org
BSD 2-Clause "Simplified" License
1.03k stars 299 forks source link

Android Documentation: Changing Style at Runtime #2532

Open louwers opened 3 months ago

louwers commented 3 months ago

Suggestion from @lepigocher

louwers commented 2 months ago

I will add the example code from RuntimeStyleActivity.kt to the documentation.

alasram commented 2 months ago

What does it mean to dynamically change style? One thing I consider doing is fast transition between many different styles. Depending on camera sensor parameters such as brightness and glare, an interpolation factor between two styles is used to generate a new style (Mostly color values of the different feature change in the final style). Would this documentation help with what I'm trying to do?

louwers commented 2 months ago

@alasram It just means to change a style on the fly. E.g. switch from a light style to a dark style. You can check out the example activity that I linked.

I think changing a style is a quite expensive operation so you wouldn't do it as the camera is changing, it's not that dynamic.