Package com.trimblemaps.mapsdk.location
Class LocationComponentActivationOptions
java.lang.Object
com.trimblemaps.mapsdk.location.LocationComponentActivationOptions
A class which holds the various options for activating the Maps SDK's
LocationComponent to eventually
show the device location on the map.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class for constructing a new instance ofLocationComponentActivationOptions. -
Method Summary
Modifier and TypeMethodDescriptionConvenience method to retrieve aLocationComponentActivationOptionsobject which is ready to build withandroid.content.Contextcontext()The application's current contextA builtLocationComponentOptionsobject, which holds the variousLocationComponentstyling optionscom.trimblemaps.android.core.location.LocationEngineTheLocationEnginewhich theLocationComponentshould usecom.trimblemaps.android.core.location.LocationEngineRequestThe location request which theLocationComponentshould usestyle()The proxy object for current map style.intstyleRes()The LocationComponent style resource (e.g.booleanTrue if you want to initialize and use the built-in location engine or false if there should be no location engine initializedbooleanTrue if you want to initialize and use the specialized location layer to render the location puck.
-
Method Details
-
builder
@NonNull public static LocationComponentActivationOptions.Builder builder(@NonNull android.content.Context context, @NonNull Style fullyLoadedMapStyle) Convenience method to retrieve aLocationComponentActivationOptionsobject which is ready to build with- Returns:
- a builder object
-
context
@NonNull public android.content.Context context()The application's current context- Returns:
- the application's current context
-
style
The proxy object for current map style. More info atStyle- Returns:
- the map's fully loaded Style object
-
locationEngine
@Nullable public com.trimblemaps.android.core.location.LocationEngine locationEngine()TheLocationEnginewhich theLocationComponentshould use- Returns:
- the engine
-
locationEngineRequest
@Nullable public com.trimblemaps.android.core.location.LocationEngineRequest locationEngineRequest()The location request which theLocationComponentshould use- Returns:
- the LocationEngineRequest object
-
locationComponentOptions
A builtLocationComponentOptionsobject, which holds the variousLocationComponentstyling options- Returns:
- the options for styling the actual LocationComponent
-
styleRes
public int styleRes()The LocationComponent style resource (e.g. R.style.style_name)- Returns:
- the style resource.
-
useDefaultLocationEngine
public boolean useDefaultLocationEngine()True if you want to initialize and use the built-in location engine or false if there should be no location engine initialized- Returns:
- whether the default LocationEngine is used
-
useSpecializedLocationLayer
public 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.
- Returns:
- whether the default specialized location layer is used
- Constants like
-