Skip to main content

Flutter Native - Map Configuration

This guide covers MapOptions and WemapMap configuration in depth. You'll learn how to customize the map environment, location source, offline mode, UI features, and debugging options.


Overview

MapOptions is passed to WemapMap via the options parameter. It controls how the map connects to Wemap services, which location provider to use, and various behavioral settings. The WemapMap widget itself also offers display and UX options.


Core options (required)

These three options are always required:

OptionTypeDescription
mapIDintYour Wemap map identifier
tokenStringAuthentication token
environmentEnvironmentEnvironment.PROD or Environment.DEV

Location source

locationSource determines how user position is obtained:

ValueDescription
LocationSource.GPSStandard GPS (default) — works outdoors and in some indoor areas
LocationSource.VPSVisual Positioning System — uses the camera for precise indoor positioning
LocationSource.SIMULATORSimulates user location

Default: LocationSource.GPS

MapOptions(
mapID: yourMapId,
token: yourToken,
environment: Environment.PROD,
locationSource: LocationSource.VPS, // Enable indoor positioning
)

Note: GPS and VPS are covered separately in GPS and VPS.


Offline mode

When offlineMode is true, the map uses locally stored data instead of the network. You must provide a path to the pack data file via packDataPath.

OptionTypeDefaultDescription
offlineModeboolfalseUse offline data instead of network
packDataPathString?""Path to the pack data ZIP file (required when offline)
rasterZipFileNameString""Optional separate raster tiles ZIP when not bundled in pack data
MapOptions(
mapID: yourMapId,
token: yourToken,
environment: Environment.PROD,
offlineMode: true,
packDataPath: "/path/to/packdata.zip",
)

Note: Downloading and managing pack data is covered in Offline Mode.


WemapMap display options

Beyond MapOptions, the WemapMap widget accepts options that control which UI elements are shown. All default to false.

Map features

OptionDefaultDescription
levelsTabEnabledfalseShow level selector for the focused building
filtersTabEnabledfalseShow POI filters
searchBarEnabledfalseShow search bar (automatically enables poisListSheetEnabled)
poisListSheetEnabledfalseShow POIs list sheet
detailedViewEnabledfalseShow detailed view when a POI is selected
userLocationButtonEnabledfalseShow button to center on user location
augmentedRealityButtonEnabledfalseShow AR button (VPS only)
OptionDefaultDescription
navigationWidgetEnabledfalseShow navigation UI when navigation starts
itineraryWidgetEnabledfalseShow itinerary panel when an itinerary is added

VPS and dialogs

OptionDefaultDescription
vpsBadConnectionDialogfalseShow dialog when VPS has poor connection
vpsNoConnectionDialogfalseShow dialog when no internet during VPS scan
vpsTimedOutDialogfalseShow dialog when VPS scan times out
holdUpPhoneDialogfalsePrompt user to hold phone up during background scan
vpsInProcessScreenfalseShow scanning overlay with dotted border and stop button
arrivedToDestinationDialogfalseShow dialog when user arrives at destination
navigationSuggestionDialogfalseSuggest starting navigation for current itinerary
scanSuggestionDialogfalseSuggest scanning to localize when not positioned

Example: enabling common features

WemapMap(
options: MapOptions(
mapID: yourMapId,
token: yourToken,
environment: Environment.PROD,
),
levelsTabEnabled: true,
filtersTabEnabled: true,
poisListSheetEnabled: true,
searchBarEnabled: true,
detailedViewEnabled: true,
userLocationButtonEnabled: true,
navigationWidgetEnabled: true,
itineraryWidgetEnabled: true,
)

Note: Widget details are in Widgets; itinerary usage is in Itinerary; navigation in Navigation.


Locale and theming

Locale

Control the language of built-in UI (labels, buttons, etc.):

OptionDefaultDescription
localeDevice localeLanguage for map UI (e.g. Locale('fr'), Locale('en'))
fallbackLocaleLocale('en')Fallback if chosen locale fails
WemapMap(
options: mapOptions,
locale: const Locale('fr'),
fallbackLocale: const Locale('en'),
)

Loading and error UI

OptionDescription
progressIndicatorCustom widget while map is loading (default: CircularProgressIndicator)
mapDataLoadFailedBuilder for custom error UI when map data fails to load
WemapMap(
options: mapOptions,
progressIndicator: const Center(
child: Text('Loading map...'),
),
mapDataLoadFailed: (context, error, stackTrace) => Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(Icons.error_outline, size: 48),
const SizedBox(height: 16),
Text('Failed to load map: $error'),
],
),
),
)

Complete configuration example

WemapMap(
options: MapOptions(
mapID: yourMapId,
token: yourToken,
environment: Environment.PROD,
locationSource: LocationSource.GPS,
offlineMode: false,
),
locale: const Locale('en'),
levelsTabEnabled: true,
filtersTabEnabled: true,
searchBarEnabled: true,
poisListSheetEnabled: true,
detailedViewEnabled: true,
userLocationButtonEnabled: true,
navigationWidgetEnabled: true,
itineraryWidgetEnabled: true,
)