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:
| Option | Type | Description |
|---|---|---|
mapID | int | Your Wemap map identifier |
token | String | Authentication token |
environment | Environment | Environment.PROD or Environment.DEV |
Location source
locationSource determines how user position is obtained:
| Value | Description |
|---|---|
LocationSource.GPS | Standard GPS (default) — works outdoors and in some indoor areas |
LocationSource.VPS | Visual Positioning System — uses the camera for precise indoor positioning |
LocationSource.SIMULATOR | Simulates user location |
Default: LocationSource.GPS
MapOptions(
mapID: yourMapId,
token: yourToken,
environment: Environment.PROD,
locationSource: LocationSource.VPS, // Enable indoor positioning
)
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.
| Option | Type | Default | Description |
|---|---|---|---|
offlineMode | bool | false | Use offline data instead of network |
packDataPath | String? | "" | Path to the pack data ZIP file (required when offline) |
rasterZipFileName | String | "" | 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
| Option | Default | Description |
|---|---|---|
levelsTabEnabled | false | Show level selector for the focused building |
filtersTabEnabled | false | Show POI filters |
searchBarEnabled | false | Show search bar (automatically enables poisListSheetEnabled) |
poisListSheetEnabled | false | Show POIs list sheet |
detailedViewEnabled | false | Show detailed view when a POI is selected |
userLocationButtonEnabled | false | Show button to center on user location |
augmentedRealityButtonEnabled | false | Show AR button (VPS only) |
Navigation and itinerary
| Option | Default | Description |
|---|---|---|
navigationWidgetEnabled | false | Show navigation UI when navigation starts |
itineraryWidgetEnabled | false | Show itinerary panel when an itinerary is added |
VPS and dialogs
| Option | Default | Description |
|---|---|---|
vpsBadConnectionDialog | false | Show dialog when VPS has poor connection |
vpsNoConnectionDialog | false | Show dialog when no internet during VPS scan |
vpsTimedOutDialog | false | Show dialog when VPS scan times out |
holdUpPhoneDialog | false | Prompt user to hold phone up during background scan |
vpsInProcessScreen | false | Show scanning overlay with dotted border and stop button |
arrivedToDestinationDialog | false | Show dialog when user arrives at destination |
navigationSuggestionDialog | false | Suggest starting navigation for current itinerary |
scanSuggestionDialog | false | Suggest 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.):
| Option | Default | Description |
|---|---|---|
locale | Device locale | Language for map UI (e.g. Locale('fr'), Locale('en')) |
fallbackLocale | Locale('en') | Fallback if chosen locale fails |
WemapMap(
options: mapOptions,
locale: const Locale('fr'),
fallbackLocale: const Locale('en'),
)
Loading and error UI
| Option | Description |
|---|---|
progressIndicator | Custom widget while map is loading (default: CircularProgressIndicator) |
mapDataLoadFailed | Builder 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,
)