Tile Server Switching
Here we deal with applications that switch between TomTom and MapTiler by disabling offline-map actions when the active tile server does not support offline regions.
Use the Nextbillion API to switch the global tile server:
After switching to MapTiler, online maps continue to use MapTiler's primary cache and network data. Every Regional Offline public method checks the current tile server: suspend APIs return UnsupportedTileServer, while synchronous APIs return a safe empty value or false, or perform no operation. The underlying validation does not throw directly. The application should disable the offline entry point and display a localized message that TomTom is required.
After switching back to NGLTomTom, Regional Offline public methods become available again on an initialized instance without the need to recreate clients. If the application starts while configured for MapTiler, initialize() returns false. Call initialize() again after switching back to TomTom.
RegionalOfflineConfig.fromTileServer() only creates a configuration value. It does not switch the global tile server. A MapTiler configuration cannot initialize Regional Offline Maps. Do not call RegionalOffline.onTileServerChanged() or internal Release APIs directly. The host application remains responsible for custom-style compatibility and reloading.