LogoLogo
CMSGitHubSupportBook a demo
  • Documentation
  • Academy
  • Help Center
  • Academy
  • Boost Performance
    • Pre-Loading Data in Mobile Apps
  • Map Styling
    • Styling Your Map
  • Using the CMS
    • Interface Overview
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Boost Performance

Pre-Loading Data in Mobile Apps

Last updated 2 months ago

Was this helpful?

If your app’s main interface is not the MapsIndoors map — such as a welcome screen with an overview of features as on the screenshot below — you can improve performance by loading MapsIndoors data separately from displaying the map.

This approach, available in mobile SDKs for Android, iOS, Flutter, and React Native, ensures users can interact with the map instantly without waiting for data to load.

How to Pre-Load MapsIndoors Data

You don’t need to change how you initialise MapsIndoors, but you should decouple loading the data from showing the map. Instead of loading data only when the user requests the map, load it as early as possible.

In this approach, data loading only begins when the user requests the map, causing delays.

Not recommended: Loading Data on Demand

// MyController.swift

func showMapOnUserRequest() {
    try await MPMapsIndoors.shared.load(apiKey: "mapspeople3d")
    // Create MPMapConfig instance
    // Create MPMapControl instance
    // Show and use the map
}

Instead, start loading MapsIndoors data as soon as the app launches. Then, when the user requests the map, it will be ready to display instantly.

Recommended approach: Pre-loading Data in Advance

// AppDelegate.swift

func loadMapsIndoorsData() {
    try await MPMapsIndoors.shared.load(apiKey: "mapspeople3d")
}

When the user requests the map, you can display it immediately with the pre-loaded data:

// MyMapController.swift

func showMapOnUserRequest() {
    // Create MPMapConfig instance
    // Create MPMapControl instance
    // Show and use the map
}

By pre-loading data, you ensure a smooth and responsive experience for your users, making your MapsIndoors-powered app feel faster and more seamless.

Page cover image