# 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:

```kotlin
Nextbillion.setWellKnownTileServer(
    NGLWellKnownTileServer.NGLMapTiler,
)
```

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._
