setMapStyleByPath method

void setMapStyleByPath(
  1. String path, {
  2. bool smoothTransition = false,
})

Set map view style by content path.

Applies a map style from a file path. The path can point to a .style file in your app's assets or a custom style file. Optionally enable smooth transitions to animate between the old and new styles.

Parameters

  • path: (String) Content path (see ContentStoreItem.fileName).
  • smoothTransition: (bool) When true, animates the transition between styles.

Example

controller.preferences.setMapStyleByPath(
  'assets/map_styles/dark_theme.style',
  smoothTransition: true,
);

See also:

Implementation

void setMapStyleByPath(
  final String path, {
  final bool smoothTransition = false,
}) {
  objectMethod(
    _pointerId,
    'MapViewPreferences',
    'setMapStyleByPath',
    args: <String, Object>{
      'path': path,
      'smoothTransition': smoothTransition,
    },
    dependencyId: _mapPointerId,
  );
}