public static class LocationComponentActivationOptions.Builder
extends java.lang.Object
LocationComponentActivationOptions
.Constructor and Description |
---|
Builder(android.content.Context context,
Style style)
Constructor for the
LocationComponentActivationOptions builder class. |
Modifier and Type | Method and Description |
---|---|
LocationComponentActivationOptions |
build()
Method which actually builds the
LocationComponentActivationOptions object while
taking the various options into account. |
LocationComponentActivationOptions.Builder |
locationComponentOptions(LocationComponentOptions locationComponentOptions) |
LocationComponentActivationOptions.Builder |
locationEngine(LocationEngine locationEngine)
Deliver your own
LocationEngine to the LocationComponent. |
LocationComponentActivationOptions.Builder |
locationEngineRequest(LocationEngineRequest locationEngineRequest) |
LocationComponentActivationOptions.Builder |
styleRes(int styleRes) |
LocationComponentActivationOptions.Builder |
useDefaultLocationEngine(boolean useDefaultLocationEngine) |
LocationComponentActivationOptions.Builder |
useSpecializedLocationLayer(boolean useSpecializedLocationLayer)
True if you want to initialize and use the specialized location layer to render the location puck.
|
public Builder(@NonNull android.content.Context context, @NonNull Style style)
LocationComponentActivationOptions
builder class.
While other activation options are optional, the activation process always requires
context and a fully-loaded map Style
object, which is why the two are in this
constructor.@NonNull public LocationComponentActivationOptions.Builder locationEngine(@Nullable LocationEngine locationEngine)
LocationEngine
to the LocationComponent.
The true/false
LocationComponentActivationOptions.useDefaultLocationEngine()
activation option is ignored when a non-null LocationEngine
is set via
this `locationEngine()` method.
locationEngine
- a LocationEngine
objectLocationComponentActivationOptions.Builder
object being constructedpublic LocationComponentActivationOptions.Builder locationEngineRequest(LocationEngineRequest locationEngineRequest)
locationEngineRequest
- the location request which the
LocationComponent
should useLocationComponentActivationOptions.Builder
object being constructedpublic LocationComponentActivationOptions.Builder locationComponentOptions(LocationComponentOptions locationComponentOptions)
locationComponentOptions
- a built LocationComponentOptions
object,
which holds the various LocationComponent
styling optionsLocationComponentActivationOptions.Builder
object being constructedpublic LocationComponentActivationOptions.Builder styleRes(int styleRes)
styleRes
- the LocationComponent style resource (e.g. R.style.style_name)LocationComponentActivationOptions.Builder
object being constructedpublic LocationComponentActivationOptions.Builder useDefaultLocationEngine(boolean useDefaultLocationEngine)
useDefaultLocationEngine
- true if you want to initialize and use the
built-in location engine or false if there
should be no location engine initialized
This is ignored when null is set as the parameter
for (Context, Style)#locationEngine()
.LocationComponentActivationOptions.Builder
object being constructedpublic LocationComponentActivationOptions.Builder useSpecializedLocationLayer(boolean useSpecializedLocationLayer)
The specialized layer is not based on runtime styling. This brings significant performance improvements, but since it's not based on the runtime styling, it's not fully compatible with the traditional implementation. The incompatibilities are:
LocationComponentConstants.BACKGROUND_LAYER
,
LocationComponentConstants.ACCURACY_LAYER
or LocationComponentConstants.LOCATION_SOURCE
are ignored.
The only usable and valid for relative positioning layer ID is
LocationComponentConstants.FOREGROUND_LAYER
.
LocationComponentOptions.foregroundName()
, are ignored.
Use LocationComponentOptions.foregroundDrawable()
to alter the image rendered as the puck.
LocationComponentOptions
'
pulsing methods such as LocationComponentOptions.pulseEnabled()
or
LocationComponentOptions.pulseColor()
, are useless when using the
the specialized location layer.
useSpecializedLocationLayer
- true if you want to initialize and use the
specialized location layer. Defaults to false.LocationComponentActivationOptions.Builder
object being constructedpublic LocationComponentActivationOptions build()
LocationComponentActivationOptions
object while
taking the various options into account.LocationComponentActivationOptions
object