Basemap.withStyle constructor

Basemap.withStyle(
  1. BasemapStyle style, {
  2. BasemapStyleParameters? parameters,
})

Creates a basemap from an initial BasemapStyle with additional parameters to control settings like language.

These basemaps are secured and access requires either an API key or an authenticated user.

The initial state of the Basemap is LoadStatus.notLoaded. When the Basemap is loaded the values specified in the BasemapStyleParameters are evaluated. See BasemapStyleParameters for information about the expected behavior for each parameter when the Basemap is loaded.

Parameters:

  • style — The initial basemap style.
  • parameters — Parameters that control how the BasemapStyle is used - for example by adjusting the language used for basemap labels.

Implementation

factory Basemap.withStyle(
  BasemapStyle style, {
  BasemapStyleParameters? parameters,
}) {
  _initializeArcGISEnvironmentIfNeeded();
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_Basemap_createWithStyleCombined(
      style.coreValue,
      parameters?._handle ?? ffi.nullptr,
      errorHandler,
    );
  });
  return Basemap._instanceCache.instanceWith(handle);
}