### MapView Error Handling and Setup Source: https://github.com/mapbox/mapbox-maps-android/blob/main/maps-sdk/api/Release/metalava.txt Methods for adding and removing listeners for renderer setup errors. ```APIDOC ## MapView Error Handling and Setup ### Description Methods for adding and removing listeners for renderer setup errors. ### Methods - `addRendererSetupErrorListener(com.mapbox.maps.renderer.RendererSetupErrorListener rendererSetupErrorListener)`: Adds a listener for renderer setup errors. - `removeRendererSetupErrorListener(com.mapbox.maps.renderer.RendererSetupErrorListener rendererSetupErrorListener)`: Removes a listener for renderer setup errors. ``` -------------------------------- ### Install Required Android SDK Components Source: https://github.com/mapbox/mapbox-maps-android/blob/main/DEVELOPING.md Use the sdkmanager to install necessary platform tools, build tools, and libraries for building the Android project. Ensure JDK 11 or higher is installed and JAVA_HOME is set. ```bash $ ${ANDROID_HOME}/tools/bin/sdkmanager \ "platform-tools" \ "platforms;android-33" \ "build-tools;30.0.3" \ "build-tools;33.0.0" \ "extras;android;m2repository" \ "patcher;v4" \ "extras;google;m2repository" \ "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2" \ "ndk;23.2.8568313"\ "cmake;3.22.1" ``` -------------------------------- ### Example Commit Message Source: https://github.com/mapbox/mapbox-maps-android/blob/main/DEVELOPING.md An example of a well-formatted commit message that includes a subject line and a detailed body explaining the changes. ```text [logo] Rename visibility feature to enabled. This is to align plugin vocabulary across the codebase and the plugin system. Enabled is now made part of the Plugin interface and removed from the Logo specific interface. All tests and referneces in the SDK and test applications have been updated to resemble this change. ``` -------------------------------- ### Install Secret Shield Pre-commit Hook Source: https://github.com/mapbox/mapbox-maps-android/blob/main/DEVELOPING.md Install the secret-shield pre-commit hook by running the provided script. This ensures secrets are checked before each commit. ```bash scripts/install-pre-commit/install-pre-commit.sh ``` -------------------------------- ### Perform Initial SDK Build Source: https://github.com/mapbox/mapbox-maps-android/blob/main/DEVELOPING.md Run the make sdk-build command to compile the project and verify the initial setup. ```bash $ make sdk-build ``` -------------------------------- ### Default Fill Extrusion Base Source: https://github.com/mapbox/mapbox-maps-android/blob/main/extension-style/api/Release/metalava.txt Gets the default base elevation for fill extrusions. This property defines the starting Z-value for extruded elements. ```APIDOC ## getDefaultFillExtrusionBase ### Description Retrieves the default base elevation for fill extrusions. This value determines the ground level from which extrusions originate. ### Method GET ### Endpoint N/A (SDK Method) ### Parameters None ### Response #### Success Response - **Double** (Double?) - The default base elevation. ``` -------------------------------- ### Setup Map Style and Initial Camera Source: https://github.com/mapbox/mapbox-maps-android/blob/main/extension-compose/README.md Configure the initial map style and camera position using MapboxMap composable. ```kotlin override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { MapboxMap( Modifier.fillMaxSize(), mapViewportState = rememberMapViewportState { setCameraOptions { center(Point.fromLngLat(24.9384, 60.1699)) zoom(9.0) } }, style = { MapStyle(style = Style.SATELLITE_STREETS) } ) } } ``` -------------------------------- ### Configure MapboxLibraryPlugin with Dokka Source: https://github.com/mapbox/mapbox-maps-android/blob/main/mapbox-convention-plugin/README.md Example of how to apply the MapboxLibraryPlugin and configure Dokka documentation generation with a custom list of sources and report undocumented settings. ```gradle plugins { id("com.mapbox.gradle.library") } mapboxLibrary { dokka { extraListOfSources = File("api-doc-list-maps-core.txt").readLines() reportUndocumented = false } } ``` -------------------------------- ### Create and Transition Viewport States Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-viewport/README.md Example of creating FollowPuckViewportState and OverviewViewportState instances using the ViewportPlugin. Demonstrates transitioning to these states with default and immediate transitions. ```kotlin val viewportPlugin = mapView.viewport val followPuckViewportState: FollowPuckViewportState = viewportPlugin.makeFollowPuckViewportState( FollowPuckViewportStateOptions.Builder() .bearing(FollowPuckViewportStateBearing.Constant(0.0)) .animationDurationMs(500) .padding(EdgeInsets(200.0 * resources.displayMetrics.density, 0.0, 0.0, 0.0)) .build() ) val overviewViewportState: OverviewViewportState = viewportPlugin.makeOverviewViewportState( OverviewViewportStateOptions.Builder() .geometry(routePoints) .padding(EdgeInsets(100.0, 100.0, 100.0, 100.0)) .build() ) } val immediateTransition = viewportPlugin.makeImmediateViewportTransition() // transition from idle(the default state) to the created followPuckViewportState with default transition viewportPlugin.transitionTo(followPuckViewportState) { isFinished -> // the transition has been completed with flag to check the finished status } ... // transition from followPuckViewportState to overviewViewportState with immediate transition viewportPlugin.transitionTo(overviewViewportState, immediateTransition) { isFinished -> // the transition has been completed with flag to check the finished status } ``` -------------------------------- ### Build with Vulkan Renderer Enabled (Command Line) Source: https://github.com/mapbox/mapbox-maps-android/blob/main/DEVELOPING.md Compile the app or compose app with the Vulkan renderer enabled by passing the -PvulkanEnabled=true property on the command line. Restrict ABIs to arm64-v8a if needed. ```bash $ ./gradlew :app:assembleDebug -Pmapbox.abis=arm64-v8a -PvulkanEnabled=true $ ./gradlew :compose-app:assembleDebug -Pmapbox.abis=arm64-v8a -PvulkanEnabled=true ``` -------------------------------- ### Remove Render Frame Started Listener Source: https://github.com/mapbox/mapbox-maps-android/blob/main/maps-sdk/api/Release/metalava.txt Removes a previously registered render frame started listener. This method is deprecated. ```APIDOC ## removeOnRenderFrameStartedListener ### Description Removes a listener that was registered to be notified when a render frame has started. This method is deprecated. ### Method `removeOnRenderFrameStartedListener` ### Parameters - `onRenderFrameStartedListener` (com.mapbox.maps.plugin.delegates.listeners.OnRenderFrameStartedListener) - The listener to remove. ### Returns `void` ``` -------------------------------- ### IndoorSelectorSettings.Builder Source: https://github.com/mapbox/mapbox-maps-android/blob/main/sdk-base/api/Release/metalava.txt Builder class for creating and configuring IndoorSelectorSettings. ```APIDOC ## Class IndoorSelectorSettings.Builder ### Description Provides a fluent API for constructing `IndoorSelectorSettings` objects. ### Methods - **setEnabled(boolean enabled)**: Sets whether the indoor selector is enabled. - **setMarginBottom(float marginBottom)**: Sets the bottom margin. - **setMarginLeft(float marginLeft)**: Sets the left margin. - **setMarginRight(float marginRight)**: Sets the right margin. - **setMarginTop(float marginTop)**: Sets the top margin. - **setPosition(int position)**: Sets the position of the indoor selector. - **build()**: Constructs and returns the `IndoorSelectorSettings` object. ``` -------------------------------- ### Install Secret Shield Source: https://github.com/mapbox/mapbox-maps-android/blob/main/DEVELOPING.md Install the secret-shield npm package globally to help block secrets like access tokens. This is a prerequisite for using the secret-shield tool. ```bash npm install -g @mapbox/secret-shield ``` -------------------------------- ### MapInitOptions Source: https://github.com/mapbox/mapbox-maps-android/blob/main/maps-sdk/api/Release/metalava.txt Provides methods for creating and accessing map initialization options, including default settings and configuration parameters. ```APIDOC ## Class: MapInitOptions ### Description Represents the options used to initialize a Mapbox map. ### Methods - **copy(...)**: Creates a copy of MapInitOptions with specified parameters. - **getAntialiasingSampleCount()**: Returns the antialiasing sample count. - **getAttrs()**: Returns the attribute set. - **getCameraOptions()**: Returns the camera options. - **getContext()**: Returns the application context. - **getMapName()**: Returns the map name. - **getMapOptions()**: Returns the map options. - **getPlugins()**: Returns the list of plugins. - **getStyleUri()**: Returns the style URI. - **getTextureView()**: Returns whether texture view is enabled. - **setAntialiasingSampleCount(int)**: Sets the antialiasing sample count. - **setAttrs(android.util.AttributeSet?)**: Sets the attribute set. - **setCameraOptions(com.mapbox.maps.CameraOptions?)**: Sets the camera options. - **setMapName(String)**: Sets the map name. - **setMapOptions(com.mapbox.maps.MapOptions)**: Sets the map options. - **setPlugins(java.util.List)**: Sets the list of plugins. - **setTextureView(boolean)**: Sets whether texture view is enabled. ### Properties - **antialiasingSampleCount** (int): The antialiasing sample count. - **attrs** (android.util.AttributeSet?): The attribute set. - **cameraOptions** (com.mapbox.maps.CameraOptions?): The camera options. - **context** (android.content.Context): The application context. - **mapName** (String): The map name. - **mapOptions** (com.mapbox.maps.MapOptions): The map options. - **plugins** (java.util.List): The list of plugins. - **styleUri** (String?): The style URI. - **textureView** (boolean): Whether texture view is enabled. ## Class: MapInitOptions.Companion ### Description Companion object for MapInitOptions. ### Methods - **getDefaultMapOptions(android.content.Context context)**: Gets the default map options. - **getDefaultPluginList()**: Gets the default plugin list. ### Properties - **defaultPluginList** (java.util.List): The default plugin list. ## Class: MapInitOptionsKt ### Description Extension functions for MapInitOptions. ### Methods - **applyDefaultParams(com.mapbox.maps.MapOptions.Builder, android.content.Context context)**: Applies default parameters to a MapOptions builder. - **applyDefaultParams(com.mapbox.maps.MapOptions.Builder, float pixelRatio)**: Applies default parameters to a MapOptions builder with a specified pixel ratio. ``` -------------------------------- ### get Source: https://github.com/mapbox/mapbox-maps-android/blob/main/extension-style/api/Release/metalava.txt Creates a 'get' expression to retrieve a property value from a feature or feature state. Can specify a key directly or use an expression for dynamic key retrieval. ```APIDOC ## get ### Description Creates a 'get' expression to retrieve a property value from a feature or feature state. Can specify a key directly or use an expression for dynamic key retrieval. ### Method `static Expression get(Function1 block)` ### Method `static Expression get(String key)` ### Method `static Expression get(String key, Expression expression)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **Expression** (Expression) - The resulting get expression. #### Response Example None ``` -------------------------------- ### FollowPuckViewportStateOptions.Builder Source: https://github.com/mapbox/mapbox-maps-android/blob/main/sdk-base/api/Release/metalava.txt Builder class for creating `FollowPuckViewportStateOptions`. ```APIDOC ## FollowPuckViewportStateOptions.Builder ### Description Builder class for constructing `FollowPuckViewportStateOptions`. Use this to set various properties for the FollowPuck viewport state. ### Methods - `bearing(FollowPuckViewportStateBearing? options)`: Sets the bearing configuration. - `build()`: Builds the `FollowPuckViewportStateOptions` object. - `padding(EdgeInsets? padding)`: Sets the padding for the viewport. - `pitch(Double? pitch)`: Sets the pitch of the camera. - `zoom(Double? zoom)`: Sets the zoom level of the camera. ``` -------------------------------- ### getSymbolZOrder() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the Z-order for symbols. ```APIDOC ## getSymbolZOrder() ### Description Gets the Z-order for symbols. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **SymbolZOrder?** - The Z-order for symbols. ``` -------------------------------- ### OverviewViewportStateOptions.Builder Source: https://github.com/mapbox/mapbox-maps-android/blob/main/sdk-base/api/Release/metalava.txt Builder class for creating `OverviewViewportStateOptions`. ```APIDOC ## OverviewViewportStateOptions.Builder ### Description Builder class for constructing `OverviewViewportStateOptions`. Use this to define the parameters for the Overview viewport state. ### Methods - `animationDurationMs(long duration)`: Sets the animation duration in milliseconds. - `bearing(Double? bearing)`: Sets the bearing of the camera. - `build()`: Builds the `OverviewViewportStateOptions` object. - `geometry(Geometry geometry)`: Sets the geometry to focus on. - `geometryPadding(EdgeInsets geometryPadding)`: Sets the padding for the geometry. - `maxZoom(Double? maxZoom)`: Sets the maximum zoom level. - `offset(ScreenCoordinate offset)`: Sets the screen offset. - `padding(EdgeInsets? padding)`: Sets the padding around the viewport. - `pitch(Double? pitch)`: Sets the pitch of the camera. ``` -------------------------------- ### getSymbolZOffset() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the Z-offset for symbols. ```APIDOC ## getSymbolZOffset() ### Description Gets the Z-offset for symbols. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Double?** - The Z-offset value. ``` -------------------------------- ### getSymbolSpacing() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the spacing between symbols. ```APIDOC ## getSymbolSpacing() ### Description Gets the spacing between symbols. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Double?** - The spacing value. ``` -------------------------------- ### getTextJustify() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the justification for text labels. ```APIDOC ## getTextJustify() ### Description Gets the justification for text labels. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **TextJustify?** - The justification for text labels. ``` -------------------------------- ### Implement MapboxCarMapObserver Source: https://github.com/mapbox/mapbox-maps-android/blob/main/extension-androidauto/README.md Example of implementing the MapboxCarMapObserver interface to handle map events and load styles. This is useful for custom map experiences. ```kotlin class MyCustomMapExperience : MapboxCarMapObserver { override fun onAttached(mapboxCarMapSurface: MapboxCarMapSurface) { val mapboxMap = mapboxCarMapSurface?.mapSurface?.getMapboxMap()!! mapboxMap.loadStyle( --snip-- ) } } ``` -------------------------------- ### getTextField() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the text field for labels. ```APIDOC ## getTextField() ### Description Gets the text field for labels. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **String?** - The text field. ``` -------------------------------- ### Implement Session and MapScreen Source: https://github.com/mapbox/mapbox-maps-android/blob/main/extension-androidauto/README.md Example of creating a custom session and map screen using the Mapbox Android Auto extension. This sets up the MapboxCarMap and customizes the map experience. ```kotlin class MySession : Session() { private val mapboxCarMap = mapboxMapInstaller() .onCreated(CarMapWidgets()) .install { carContext -> // Callback is triggered when the Session calls onCreate. This allows you to specify // custom MapInitOptions. MapInitOptions(carContext) } override fun onCreateScreen(intent: Intent): Screen = MapScreen(mapboxCarMap) } class MyMapScreen( mapboxCarMap: MapboxCarMap ) : Screen(mapboxCarMap.carContext) { private val carCameraController = CarCameraController() private val myCustomExperience = MyCustomMapExperience() init { mapboxMapInstaller(mapboxCarMap) .onCreated(carCameraController) .gestureHandler(carCameraController.gestureHandler) .onResumed(myCustomExperience) .install() } override fun onGetTemplate(): Template { val builder = NavigationTemplate.Builder() --snip-- ``` -------------------------------- ### getTextEmissiveStrength() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the emissive strength of the text. ```APIDOC ## getTextEmissiveStrength() ### Description Gets the emissive strength of the text. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Double?** - The emissive strength value. ``` -------------------------------- ### Generate API Documentation Source: https://github.com/mapbox/mapbox-maps-android/blob/main/DEVELOPING.md Generate Kotlin API documentation using Dokka. The output will be available in `build/dokka/htmlCollector`. ```bash $ make dokka-html ``` -------------------------------- ### LightUtils Methods Source: https://github.com/mapbox/mapbox-maps-android/blob/main/extension-style/api/Release/metalava.txt Utility methods for managing light sources in the map style, including setting, getting, and creating dynamic lights. ```APIDOC ## LightUtils ### Description Provides utility methods for interacting with light sources in the Mapbox map style. ### Static Methods - `dynamicLight(com.mapbox.maps.extension.style.light.generated.AmbientLight ambientLight, com.mapbox.maps.extension.style.light.generated.DirectionalLight directionalLight)`: Creates a dynamic light configuration. - `getLight(com.mapbox.maps.MapboxStyleManager delegate, String lightId)`: Retrieves a light by its ID. - `setLight(com.mapbox.maps.MapboxStyleManager delegate, com.mapbox.maps.extension.style.light.generated.AmbientLight ambientLight, com.mapbox.maps.extension.style.light.generated.DirectionalLight directionalLight)`: Sets ambient and directional lights for the style. - `setLight(com.mapbox.maps.MapboxStyleManager delegate, com.mapbox.maps.extension.style.light.generated.FlatLight flatLight)`: Sets a flat light for the style. - `setLights(com.mapbox.maps.MapboxStyleManager delegate, java.util.List lights)`: Sets a list of lights for the style. ``` -------------------------------- ### getSymbolSortKey() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the sort key for symbols. ```APIDOC ## getSymbolSortKey() ### Description Gets the sort key for symbols. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Double?** - The sort key value. ``` -------------------------------- ### getSymbolPlacement() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the placement strategy for symbols. ```APIDOC ## getSymbolPlacement() ### Description Gets the placement strategy for symbols. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **SymbolPlacement?** - The placement strategy for symbols. ``` -------------------------------- ### Run Metalava API Checks and Updates Source: https://github.com/mapbox/mapbox-maps-android/blob/main/metalava/README.md Use these make targets to interact with Metalava for API management. Ensure the SDK is compiled first to provide necessary dependencies. ```bash $> make check-api $> make update-api ``` -------------------------------- ### getSymbolElevationReference() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the elevation reference for symbols. ```APIDOC ## getSymbolElevationReference() ### Description Gets the elevation reference for symbols. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **SymbolElevationReference?** - The elevation reference for symbols. ``` -------------------------------- ### SkyLayer Creation Source: https://github.com/mapbox/mapbox-maps-android/blob/main/extension-style/api/Release/metalava.txt Static method to create and configure a SkyLayer. ```APIDOC ## SkyLayer Factory Method ### Description Creates a new SkyLayer instance with the specified ID and a configuration block. ### Method Signature `skyLayer(String layerId, Function1 block)` ### Parameters - `layerId` (String): The unique identifier for the layer. - `block` (Function1): A lambda function to configure the SkyLayer properties. ``` -------------------------------- ### getSlot() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the slot name for the annotation. ```APIDOC ## getSlot() ### Description Gets the slot name for the annotation. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **String?** - The slot name. ``` -------------------------------- ### FollowPuckViewportStateOptions Source: https://github.com/mapbox/mapbox-maps-android/blob/main/sdk-base/api/Release/metalava.txt Options for configuring the FollowPuck viewport state, allowing control over bearing, padding, pitch, and zoom. ```APIDOC ## FollowPuckViewportStateOptions ### Description Options for configuring the FollowPuck viewport state. This allows for fine-grained control over how the camera follows the location puck. ### Methods - `getBearing()`: Returns the current bearing configuration. - `getPadding()`: Returns the current padding configuration. - `getPitch()`: Returns the current pitch configuration. - `getZoom()`: Returns the current zoom configuration. - `toBuilder()`: Returns a builder to create a new `FollowPuckViewportStateOptions` instance. ### Properties - `bearing` (FollowPuckViewportStateBearing?): Configuration for the bearing. - `padding` (EdgeInsets?): Padding around the viewport. - `pitch` (Double?): The pitch of the camera. - `zoom` (Double?): The zoom level of the camera. ``` -------------------------------- ### FlatLight Configuration Source: https://github.com/mapbox/mapbox-maps-android/blob/main/extension-style/api/Release/metalava.txt Configure the properties of a flat light layer using the FlatLight DSL. ```APIDOC ## FlatLight Configuration ### Description This section details how to configure the `FlatLight` layer properties using the provided DSL receiver. ### Methods #### `flatLight(id: String = "flat", block: FlatLightDslReceiver.() -> Unit): FlatLight` Creates and configures a `FlatLight` layer. - **id** (String) - Optional - The unique identifier for the light. Defaults to "flat". - **block** (Function1) - Required - A lambda function to configure the light properties using `FlatLightDslReceiver`. #### `anchor(anchor: Anchor = Anchor.VIEWPORT): FlatLight` Sets the anchor of the light. - **anchor** (Anchor) - Optional - The anchor type. Defaults to `Anchor.VIEWPORT`. #### `anchor(anchor: Expression): FlatLight` Sets the anchor of the light using an expression. - **anchor** (Expression) - Required - An expression defining the anchor. #### `color(@ColorInt color: Int): FlatLight` Sets the color of the light using an integer color value. - **color** (Int) - Required - The color value. #### `color(color: String = "#ffffff"): FlatLight` Sets the color of the light using a string representation. - **color** (String) - Optional - The color string. Defaults to "#ffffff". #### `color(color: Expression): FlatLight` Sets the color of the light using an expression. - **color** (Expression) - Required - An expression defining the color. #### `colorTransition(options: StyleTransition): FlatLight` Sets the transition options for the color property. - **options** (StyleTransition) - Required - The transition options. #### `colorTransition(block: StyleTransition.Builder.() -> Unit): FlatLight` Configures the transition options for the color property using a builder block. - **block** (Function1) - Required - A lambda function to configure the `StyleTransition.Builder`. #### `colorUseTheme(colorUseTheme: String): FlatLight` Sets the theme to use for the light color (experimental). - **colorUseTheme** (String) - Required - The theme name. #### `colorUseTheme(colorUseTheme: Expression): FlatLight` Sets the theme to use for the light color using an expression (experimental). - **colorUseTheme** (Expression) - Required - An expression defining the theme. #### `intensity(intensity: Double = 0.5): FlatLight` Sets the intensity of the light. - **intensity** (Double) - Optional - The intensity value. Defaults to 0.5. #### `intensity(intensity: Expression): FlatLight` Sets the intensity of the light using an expression. - **intensity** (Expression) - Required - An expression defining the intensity. #### `intensityTransition(options: StyleTransition): FlatLight` Sets the transition options for the intensity property. - **options** (StyleTransition) - Required - The transition options. #### `intensityTransition(block: StyleTransition.Builder.() -> Unit): FlatLight` Configures the transition options for the intensity property using a builder block. - **block** (Function1) - Required - A lambda function to configure the `StyleTransition.Builder`. #### `position(radialCoordinate: Double, azimuthalAngle: Double, polarAngle: Double): FlatLight` Sets the position of the light using spherical coordinates. - **radialCoordinate** (Double) - Required - The radial coordinate. - **azimuthalAngle** (Double) - Required - The azimuthal angle. - **polarAngle** (Double) - Required - The polar angle. #### `position(position: LightPosition = LightPosition(1.15, 210.0, 30.0)): FlatLight` Sets the position of the light using a `LightPosition` object. - **position** (LightPosition) - Optional - The light position. Defaults to `LightPosition(1.15, 210.0, 30.0)`. #### `position(position: Expression): FlatLight` Sets the position of the light using an expression. - **position** (Expression) - Required - An expression defining the position. #### `positionTransition(options: StyleTransition): FlatLight` Sets the transition options for the position property. - **options** (StyleTransition) - Required - The transition options. #### `positionTransition(block: StyleTransition.Builder.() -> Unit): FlatLight` Configures the transition options for the position property using a builder block. - **block** (Function1) - Required - A lambda function to configure the `StyleTransition.Builder`. ``` -------------------------------- ### getLayerFilter() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the layer filter expression. ```APIDOC ## getLayerFilter() ### Description Gets the layer filter expression. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Expression?** - The layer filter expression. ``` -------------------------------- ### Configure Mapbox Maven Repository and Plugin Dependency Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-indoorselector/README.md Configure the Mapbox Maven repository in your root build.gradle file and add the indoor selector plugin dependency in your app's build.gradle file. Ensure your Mapbox access token has the DOWNLOADS:READ scope. ```groovy // In the root build.gradle file // The Mapbox access token needs to a scope set to DOWNLOADS:READ allprojects { repositories { maven { url 'https://api.mapbox.com/downloads/v2/releases/maven' authentication { basic(BasicAuthentication) } credentials { username = "mapbox" password = "INSERT_MAPBOX_ACCESS_TOKEN_HERE" } } } } // In the app build.gradle file dependencies { implementation 'com.mapbox.plugin:maps-indoorselector:11.17.0' } ``` -------------------------------- ### getIconSize() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the size of the icon image. ```APIDOC ## getIconSize() ### Description Gets the size of the icon image. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Double?** - The size of the icon image. ``` -------------------------------- ### MapInitOptions Constructors Source: https://github.com/mapbox/mapbox-maps-android/blob/main/maps-sdk/api/Release/metalava.txt Details the various constructors available for the MapInitOptions class, allowing for flexible map initialization. ```APIDOC ## Class MapInitOptions ### Description Options for initializing a Mapbox map. ### Constructors - **MapInitOptions(Context context, MapOptions mapOptions = getDefaultMapOptions(context), List plugins = defaultPluginList, CameraOptions? cameraOptions = null, boolean textureView = false, String? styleUri = "mapbox://styles/mapbox/standard", AttributeSet? attrs = null, int antialiasingSampleCount = 1, String mapName = "")**: Constructor with all possible options. - **MapInitOptions(Context context, MapOptions mapOptions = getDefaultMapOptions(context), List plugins = defaultPluginList, CameraOptions? cameraOptions = null, boolean textureView = false, String? styleUri = "mapbox://styles/mapbox/standard", AttributeSet? attrs = null, int antialiasingSampleCount = 1)**: Constructor without mapName. - **MapInitOptions(Context context, MapOptions mapOptions = getDefaultMapOptions(context), List plugins = defaultPluginList, CameraOptions? cameraOptions = null, boolean textureView = false, String? styleUri = "mapbox://styles/mapbox/standard", AttributeSet? attrs = null)**: Constructor without antialiasingSampleCount and mapName. - **MapInitOptions(Context context, MapOptions mapOptions = getDefaultMapOptions(context), List plugins = defaultPluginList, CameraOptions? cameraOptions = null, boolean textureView = false, String? styleUri = "mapbox://styles/mapbox/standard")**: Constructor without attrs, antialiasingSampleCount, and mapName. - **MapInitOptions(Context context, MapOptions mapOptions = getDefaultMapOptions(context), List plugins = defaultPluginList, CameraOptions? cameraOptions = null, boolean textureView = false)**: Constructor without styleUri, attrs, antialiasingSampleCount, and mapName. - **MapInitOptions(Context context, MapOptions mapOptions = getDefaultMapOptions(context), List plugins = defaultPluginList, CameraOptions? cameraOptions = null)**: Constructor without textureView, styleUri, attrs, antialiasingSampleCount, and mapName. - **MapInitOptions(Context context, MapOptions mapOptions = getDefaultMapOptions(context), List plugins = defaultPluginList)**: Constructor without cameraOptions, textureView, styleUri, attrs, antialiasingSampleCount, and mapName. - **MapInitOptions(Context context, MapOptions mapOptions = getDefaultMapOptions(context))**: Constructor with only context and mapOptions. - **MapInitOptions(Context context)**: Basic constructor with only context. ### Methods - **component1()**: Returns the context. - **component2()**: Returns the MapOptions. - **component3()**: Returns the list of plugins. - **component4()**: Returns the CameraOptions. - **component5()**: Returns the textureView flag. - **component6()**: Returns the styleUri. - **component7()**: Returns the AttributeSet. - **component8()**: Returns the antialiasingSampleCount. - **component9()**: Returns the mapName. ``` -------------------------------- ### getIconRotate() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the rotation of the icon image. ```APIDOC ## getIconRotate() ### Description Gets the rotation of the icon image. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Double?** - The rotation angle in degrees. ``` -------------------------------- ### getIconPadding() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the padding of the icon image. ```APIDOC ## getIconPadding() ### Description Gets the padding of the icon image. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Double?** - The padding value. ``` -------------------------------- ### Create Style Transition Options Source: https://github.com/mapbox/mapbox-maps-android/blob/main/extension-style/api/Release/metalava.txt Use the `transitionOptions` function to create `StyleTransition.Builder` configurations. This is useful for defining animation durations and delays for style properties. ```kotlin package com.mapbox.maps.extension.style.utils import com.mapbox.maps.TransitionOptions import com.mapbox.maps.extension.style.types.StyleTransition fun TypeUtilsKt.transition(block: (StyleTransition.Builder) -> Unit): TransitionOptions { val builder = StyleTransition.Builder() block(builder) return builder.build() } ``` -------------------------------- ### getIconOpacity() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the opacity of the icon image. ```APIDOC ## getIconOpacity() ### Description Gets the opacity of the icon image. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Double?** - The opacity value. ``` -------------------------------- ### StyleTransitionKt.transitionOptions Source: https://github.com/mapbox/mapbox-maps-android/blob/main/extension-style/api/Release/metalava.txt Extension function to create `StyleTransition` options using a DSL builder. ```APIDOC ## StyleTransitionKt.transitionOptions ### Description Extension function to create `StyleTransition` options using a DSL builder. ### Parameters - **block** (Function1) - A lambda function that configures the `StyleTransition.Builder`. ``` -------------------------------- ### getIconOffset() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the offset of the icon image. ```APIDOC ## getIconOffset() ### Description Gets the offset of the icon image. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **List?** - The offset values [x, y]. ``` -------------------------------- ### BackgroundLayer Methods Source: https://github.com/mapbox/mapbox-maps-android/blob/main/extension-style/api/Release/metalava.txt Provides methods for configuring the background layer properties such as color, opacity, and visibility, along with transition options. ```APIDOC ## BackgroundLayer Methods ### Description Methods for configuring background layer properties. ### Methods - `backgroundColorTransition(block: Function1)` - `backgroundColorUseTheme(backgroundColorUseTheme: String)` - `backgroundColorUseTheme(backgroundColorUseTheme: Expression)` - `backgroundEmissiveStrength(backgroundEmissiveStrength: Double = 0.0)` - `backgroundEmissiveStrength(backgroundEmissiveStrength: Expression)` - `backgroundEmissiveStrengthTransition(options: StyleTransition)` - `backgroundEmissiveStrengthTransition(block: Function1)` - `backgroundOpacity(backgroundOpacity: Double = 1.0)` - `backgroundOpacity(backgroundOpacity: Expression)` - `backgroundOpacityTransition(options: StyleTransition)` - `backgroundOpacityTransition(block: Function1)` - `backgroundPattern(backgroundPattern: String)` - `backgroundPattern(backgroundPattern: Expression)` - `backgroundPitchAlignment(backgroundPitchAlignment: BackgroundPitchAlignment = BackgroundPitchAlignment.MAP)` - `backgroundPitchAlignment(backgroundPitchAlignment: Expression)` - `maxZoom(maxZoom: Double)` - `minZoom(minZoom: Double)` - `slot(slot: String)` - `visibility(visibility: Visibility)` - `visibility(visibility: Expression)` ``` -------------------------------- ### getIconOcclusionOpacity() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the opacity of the icon when occluded. ```APIDOC ## getIconOcclusionOpacity() ### Description Gets the opacity of the icon when occluded. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Double?** - The opacity value when occluded. ``` -------------------------------- ### Download Unstripped Binary for Native Crash Symbolication Source: https://github.com/mapbox/mapbox-maps-android/blob/main/DEVELOPING.md Use this command to download the zipped version of the Mapbox Android binaries, which includes shared objects with debug symbols necessary for symbolication. Replace placeholders with your specific token and version. ```bash $ curl --user mapbox:{SDK_REGISTRY_TOKEN} https://api.mapbox.com/downloads/v2/mobile-maps-android-core/releases/android/{VERSION}/android-core-all.zip --output android-core-all.zip ``` -------------------------------- ### getIconEmissiveStrength() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the emissive strength of the icon. ```APIDOC ## getIconEmissiveStrength() ### Description Gets the emissive strength of the icon. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Double?** - The emissive strength value. ``` -------------------------------- ### Run Unit Tests Source: https://github.com/mapbox/mapbox-maps-android/blob/main/DEVELOPING.md Execute all unit tests for the Mapbox Maps SDK for Android locally. ```bash $ make unit-tests ``` -------------------------------- ### Get Style Transition Source: https://github.com/mapbox/mapbox-maps-android/blob/main/sdk-base/api/Release/metalava.txt Retrieves the current style transition options. ```APIDOC ## getStyleTransition ### Description Retrieves the current style transition options. ### Method GET ### Endpoint /style/transition ### Parameters None ### Response #### Success Response (200) - **transitionOptions** (TransitionOptions) - The current style transition options. ### Response Example ```json { "transitionOptions": { "duration": 300, "delay": 0 } } ``` ``` -------------------------------- ### getIconColorSaturation() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the saturation for the icon color. ```APIDOC ## getIconColorSaturation() ### Description Gets the saturation for the icon color. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Double?** - The saturation value. ``` -------------------------------- ### getIconColorContrast() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the contrast for the icon color. ```APIDOC ## getIconColorContrast() ### Description Gets the contrast for the icon color. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Double?** - The contrast value. ``` -------------------------------- ### Load Map Style with Custom Source and Layer Source: https://github.com/mapbox/mapbox-maps-android/blob/main/extension-style/README.md Use the Kotlin DSL to load a map style, define a GeoJSON source, and add a circle layer with custom properties. This example demonstrates basic style construction. ```kotlin mapView.mapboxMap.loadStyle( style(styleUri = Style.MAPBOX_STREETS) { +geojsonSource(id = "earthquakes") { url(GEOJSON_URL) cluster(false) } +circleLayer(layerId = "earthquakeCircle", sourceId = "earthquakes") { circleRadius(get { literal("mag") }) circleColor(Color.RED) circleOpacity(0.3) circleStrokeColor(Color.WHITE) } }, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NotNull Style style) { // Map is set up and the style has loaded. Now you can add data or make other map adjustments. } }, new MapboxMap.OnMapLoadErrorListener() { @Override public void onMapLoadError(@NotNull MapLoadError mapLoadError, @NotNull String s) { // Error occurred when loading the map, try to handle it gracefully here } }); ``` -------------------------------- ### LogoSettingsKt Source: https://github.com/mapbox/mapbox-maps-android/blob/main/sdk-base/api/Release/metalava.txt Utility class for creating LogoSettings instances. ```APIDOC ## Class LogoSettingsKt ### Description Utility class for creating `LogoSettings` instances. ### Methods - **LogoSettings(Function1 initializer)**: Creates a `LogoSettings` object using an initializer block. ``` -------------------------------- ### getTextMaxWidth() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the maximum width for text labels. ```APIDOC ## getTextMaxWidth() ### Description Gets the maximum width for text labels. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Double?** - The maximum width. ``` -------------------------------- ### getTextMaxAngle() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the maximum angle for text labels. ```APIDOC ## getTextMaxAngle() ### Description Gets the maximum angle for text labels. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Double?** - The maximum angle in degrees. ``` -------------------------------- ### Fill Layer Configuration Methods Source: https://github.com/mapbox/mapbox-maps-android/blob/main/extension-style/api/Release/metalava.txt This section details methods for configuring various properties of a Fill Layer, such as fill color, outline color, opacity, and z-offset. These methods allow for direct value setting or configuration via expressions and transitions. ```APIDOC ## Fill Layer Configuration ### Description Methods for configuring fill layer properties. ### Methods - `fillTunnelStructureColor(Expression)`: Sets the color of tunnel structures using an expression. - `fillTunnelStructureColor(@ColorInt int)`: Sets the color of tunnel structures using an integer color. - `fillTunnelStructureColorTransition(StyleTransition)`: Sets the transition for the tunnel structure color. - `fillTunnelStructureColorTransition(Function1)`: Sets the transition for the tunnel structure color using a builder block. - `fillTunnelStructureColorUseTheme(String)`: Sets the theme for the tunnel structure color. - `fillTunnelStructureColorUseTheme(Expression)`: Sets the theme for the tunnel structure color using an expression. - `fillZOffset(double)`: Sets the z-offset for the fill layer. - `fillZOffset(Expression)`: Sets the z-offset for the fill layer using an expression. - `fillZOffsetTransition(StyleTransition)`: Sets the transition for the z-offset. - `fillZOffsetTransition(Function1)`: Sets the transition for the z-offset using a builder block. - `filter(Expression)`: Sets a filter expression for the fill layer. ``` -------------------------------- ### Runtime Styling with Layers and Sources Source: https://github.com/mapbox/mapbox-maps-android/blob/main/extension-compose/README.md Demonstrates how to create a GeoJsonSourceState and use it with CircleLayer and SymbolLayer for runtime styling. Layers can be added to the map directly or within style composables. ```kotlin override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { // Create a geoJsonSourceState to be used later with layers. val geoJsonSource: GeoJsonSourceState = rememberGeoJsonSourceState { // Set the initial geoJsonData as a Point data = GeoJSONData(Point.fromLngLat(0.0, 0.0)) } MapboxMap( style = { // Load mapbox standard style MapboxStandardStyle( // Add a background layer to the 'top' slot of the standard style topSlot = { BackgroundLayer { backgroundColor = ColorValue(Color.Yellow) backgroundOpacity = DoubleValue(0.3) } } ) { // Set the light preset of Mapbox standard style to dawn through configuration. lightPreset = LightPresetValue.DAWN } } ) { // Insert a circle layer with the given geoJsonSource, to display a background circle. CircleLayer( sourceState = geoJsonSource ) { circleColor = ColorValue(Color.Cyan) circleRadius = DoubleValue(50.0) circleRadiusTransition = Transition(durationMillis = 1000L) } // Insert a symbol layer with the same geoJsonSource, to display a text above the circle. SymbolLayer( sourceState = geoJsonSource ) { textField = FormattedValue("Hello") textColor = ColorValue(Color.Black) // Use expression to set the text size as data driven property textSize = DoubleValue( Expression.interpolate { linear() zoom() stop { literal(0.0) literal(10.0) } stop { literal(10.0) literal(20.0) } } ) } } } } ``` -------------------------------- ### getTextLineHeight() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the line height for text labels. ```APIDOC ## getTextLineHeight() ### Description Gets the line height for text labels. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Double?** - The line height value. ``` -------------------------------- ### LogoSettings.Builder Methods Source: https://github.com/mapbox/mapbox-maps-android/blob/main/sdk-base/api/Release/metalava.txt Methods for building and configuring `LogoSettings` objects, allowing programmatic control over logo properties. ```APIDOC ## LogoSettings.Builder Methods ### Description Methods used to construct and configure `LogoSettings` objects. ### Methods - `build()`: Constructs the `LogoSettings` object. - `getEnabled()`: Gets the enabled state. - `getMarginBottom()`: Gets the bottom margin. - `getMarginLeft()`: Gets the left margin. - `getMarginRight()`: Gets the right margin. - `getMarginTop()`: Gets the top margin. - `getPosition()`: Gets the position. - `setEnabled(boolean enabled)`: Sets the enabled state. - `setMarginBottom(float marginBottom)`: Sets the bottom margin. - `setMarginLeft(float marginLeft)`: Sets the left margin. - `setMarginRight(float marginRight)`: Sets the right margin. - `setMarginTop(float marginTop)`: Sets the top margin. - `setPosition(int position)`: Sets the position. ``` -------------------------------- ### getTextLetterSpacing() Source: https://github.com/mapbox/mapbox-maps-android/blob/main/plugin-annotation/api/Release/metalava.txt Gets the letter spacing for text labels. ```APIDOC ## getTextLetterSpacing() ### Description Gets the letter spacing for text labels. ### Parameters None ### Method GET ### Endpoint N/A (Method call within the SDK) ### Response #### Success Response (200) * **Double?** - The letter spacing value. ``` -------------------------------- ### Add Clustered Point Annotations Source: https://github.com/mapbox/mapbox-maps-android/blob/main/extension-compose/README.md This example demonstrates adding multiple `PointAnnotations` with clustering support. It allows for customization of cluster appearance and interaction handling. ```kotlin override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { MapboxMap(modifier = Modifier.fillMaxSize()) { PointAnnotationGroup( annotations = points.map { PointAnnotationOptions() .withPoint(it) }, annotationConfig = AnnotationConfig( annotationSourceOptions = AnnotationSourceOptions( clusterOptions = ClusterOptions( textColorExpression = Expression.color(Color.YELLOW), textColor = Color.BLACK, textSize = 20.0, circleRadiusExpression = literal(25.0), colorLevels = listOf( Pair(100, Color.RED), Pair(50, Color.BLUE), Pair(0, Color.GREEN) ) ) ) ), ) { // Apply icon image to the whole annotation group. iconImage = IconImage(ICON_FIRE_STATION) interactionsState.onClicked { Toast.makeText( this@PointAnnotationClusterActivity, "Clicked on Point Annotation Cluster: $it", Toast.LENGTH_SHORT ).show() true } .onLongClicked { Toast.makeText( this@PointAnnotationClusterActivity, "Long clicked on Circle Annotation Cluster's item: $it", Toast.LENGTH_SHORT ).show() true } .onClusterClicked { Toast.makeText( this@PointAnnotationClusterActivity, "On cluster Click - ID: ${it.clusterId}, points: ${it.pointCount}", Toast.LENGTH_SHORT ).show() true } .onClusterLongClicked { Toast.makeText( this@PointAnnotationClusterActivity, "On cluster Long Click - ID: ${it.clusterId}, points: ${it.pointCount}", Toast.LENGTH_SHORT ).show() true } } } } } ```