Skip to content
Developers Docs

Self-Hosted / Online Basemap

The outdoor area around your indoor property is filled by an online basemap. By default the SDK uses Carto's free CDN, but in 26.7.1 you can point it at your own tiles instead — self-hosted OpenMapTiles vector tiles or a custom raster provider — or disable the online fallback entirely.

Availability

New in iOS SDK 26.7.1. Configuration is on MapstedMapCustomParameters (import MapstedMap). Set these values before you set up the map SDK — they are read during initialization.

Choosing a provider

onlineBasemapProvider selects the source. OnlineBasemapProvider has five cases:

Case Source Requires
.cartoCdn Carto's free public CDN raster (default, no key)
.osmDirect tile.openstreetmap.org raster Respect the OSM usage policy (low/medium volume)
.openmaptilesSelfHosted Your self-hosted OpenMapTiles vector tiles onlineBasemapVectorTileUrl + onlineBasemapStyleAsset
.customRaster Your own raster tile CDN onlineBasemapRasterTileUrl
.none Disable the online fallback entirely

Self-hosted OpenMapTiles (vector)

Point the SDK at your vector tile endpoint and bundle a Carto-compatible style asset (a .zip in your app bundle):

import com.mapsted.map.views.MapParams;

// Set these before you set up the map SDK; they are read during initialization.
MapParams.onlineBasemapProvider = MapParams.OnlineBasemapProvider.OPENMAPTILES_SELF_HOSTED;
MapParams.onlineBasemapVectorTileUrl = "https://your-host.example.com/tiles/{z}/{x}/{y}.pbf";
MapParams.onlineBasemapStyleAsset = "styles/your-style.json";
import MapstedMap

let params = MapstedMapCustomParameters.shared
params.onlineBasemapProvider = .openmaptilesSelfHosted
params.onlineBasemapVectorTileUrl = "https://tiles.example.com/data/v3/{z}/{x}/{y}.pbf"
params.onlineBasemapStyleAsset = "my-basemap-style.zip"   // in your app bundle

Custom raster provider

If you serve raster tiles from your own CDN, use .customRaster with a {z}/{x}/{y} URL template:

import com.mapsted.map.views.MapParams;

MapParams.onlineBasemapProvider = MapParams.OnlineBasemapProvider.CUSTOM_RASTER;
MapParams.onlineBasemapRasterTileUrl = "https://your-host.example.com/tiles/{z}/{x}/{y}.png";
import MapstedMap

let params = MapstedMapCustomParameters.shared
params.onlineBasemapProvider = .customRaster
params.onlineBasemapRasterTileUrl = "https://tiles.example.com/{z}/{x}/{y}.png"

Disabling the online basemap

To render only the Mapsted property with no online fallback around it:

import com.mapsted.map.views.MapParams;

// Disable the online basemap entirely (indoor property layers still render).
MapParams.onlineBasemapProvider = MapParams.OnlineBasemapProvider.NONE;
import MapstedMap

MapstedMapCustomParameters.shared.onlineBasemapProvider = .none

styleAssetFileName names the style .zip (in your app bundle) used to render the property and building layers — separate from the online basemap. It defaults to the SDK's bundled style:

import com.mapsted.map.views.MapParams;

// The property style asset used for the online basemap style.
MapParams.onlineBasemapStyleAsset = "styles/your-style.json";
import MapstedMap

MapstedMapCustomParameters.shared.styleAssetFileName = "mapsted47.zip"

Tips & Considerations

  • Set every value before SDK setup. MapstedMapCustomParameters.shared is read during map initialization; changing it afterward has no effect on the current session.
  • Match the required properties to the provider. .openmaptilesSelfHosted needs both onlineBasemapVectorTileUrl and onlineBasemapStyleAsset; .customRaster needs onlineBasemapRasterTileUrl. A provider with its URL unset falls back to the sparse world basemap.
  • .osmDirect is subject to the OpenStreetMap tile usage policy — use it only for low-to-medium volume, and prefer a self-hosted or custom provider in production.
  • The online basemap is the outdoor fill, distinct from your indoor property style (styleAssetFileName) and from the base-map theme (see Base-Map Theme).