Package com.trimblemaps.mapsdk.location
Class LocationComponentActivationOptions.Builder
java.lang.Object
com.trimblemaps.mapsdk.location.LocationComponentActivationOptions.Builder
- Enclosing class:
- LocationComponentActivationOptions
Builder class for constructing a new instance of
LocationComponentActivationOptions.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Method which actually builds theLocationComponentActivationOptionsobject while taking the various options into account.locationComponentOptions(LocationComponentOptions locationComponentOptions) locationEngine(com.trimblemaps.android.core.location.LocationEngine locationEngine) Deliver your ownLocationEngineto the LocationComponent.locationEngineRequest(com.trimblemaps.android.core.location.LocationEngineRequest locationEngineRequest) styleRes(int styleRes) useDefaultLocationEngine(boolean useDefaultLocationEngine) useSpecializedLocationLayer(boolean useSpecializedLocationLayer) True if you want to initialize and use the specialized location layer to render the location puck.
-
Constructor Details
-
Builder
Constructor for theLocationComponentActivationOptionsbuilder class. While other activation options are optional, the activation process always requires context and a fully-loaded mapStyleobject, which is why the two are in this constructor.
-
-
Method Details
-
locationEngine
@NonNull public LocationComponentActivationOptions.Builder locationEngine(@Nullable com.trimblemaps.android.core.location.LocationEngine locationEngine) Deliver your ownLocationEngineto the LocationComponent.The true/false
LocationComponentActivationOptions.useDefaultLocationEngine()activation option is ignored when a non-nullLocationEngineis set via this `locationEngine()` method.- Parameters:
locationEngine- aLocationEngineobject- Returns:
- the
LocationComponentActivationOptions.Builderobject being constructed
-
locationEngineRequest
public LocationComponentActivationOptions.Builder locationEngineRequest(com.trimblemaps.android.core.location.LocationEngineRequest locationEngineRequest) - Parameters:
locationEngineRequest- the location request which theLocationComponentshould use- Returns:
- the
LocationComponentActivationOptions.Builderobject being constructed
-
locationComponentOptions
public LocationComponentActivationOptions.Builder locationComponentOptions(LocationComponentOptions locationComponentOptions) - Parameters:
locationComponentOptions- a builtLocationComponentOptionsobject, which holds the variousLocationComponentstyling options- Returns:
- the
LocationComponentActivationOptions.Builderobject being constructed
-
styleRes
- Parameters:
styleRes- the LocationComponent style resource (e.g. R.style.style_name)- Returns:
- the
LocationComponentActivationOptions.Builderobject being constructed
-
useDefaultLocationEngine
public LocationComponentActivationOptions.Builder useDefaultLocationEngine(boolean useDefaultLocationEngine) - Parameters:
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().- Returns:
- the
LocationComponentActivationOptions.Builderobject being constructed
-
useSpecializedLocationLayer
public LocationComponentActivationOptions.Builder useSpecializedLocationLayer(boolean useSpecializedLocationLayer) True if you want to initialize and use the specialized location layer to render the location puck.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:
- Constants like
LocationComponentConstants.BACKGROUND_LAYER,LocationComponentConstants.ACCURACY_LAYERorLocationComponentConstants.LOCATION_SOURCEare ignored. The only usable and valid for relative positioning layer ID isLocationComponentConstants.FOREGROUND_LAYER. - All options that alter the image ID, like
LocationComponentOptions.foregroundName(), are ignored. UseLocationComponentOptions.foregroundDrawable()to alter the image rendered as the puck. - The LocationComponent's pulsing effect. Any of the
LocationComponentOptions' pulsing methods such asLocationComponentOptions.pulseEnabled()orLocationComponentOptions.pulseColor(), are useless when using the the specialized location layer.
- Parameters:
useSpecializedLocationLayer- true if you want to initialize and use the specialized location layer. Defaults to false.- Returns:
- the
LocationComponentActivationOptions.Builderobject being constructed
- Constants like
-
build
Method which actually builds theLocationComponentActivationOptionsobject while taking the various options into account.- Returns:
- a built
LocationComponentActivationOptionsobject
-