@@ -6,29 +6,47 @@ import com.mapbox.maps.plugin.locationcomponent.LocationComponentConstants.MODEL
6
6
import com.mapbox.maps.plugin.locationcomponent.LocationComponentConstants.MODEL_SOURCE
7
7
import com.mapbox.maps.plugin.locationcomponent.LocationComponentConstants.SHADOW_ICON
8
8
import com.mapbox.maps.plugin.locationcomponent.LocationComponentConstants.TOP_ICON
9
- import java.util.Objects
10
- import kotlin.Any
11
- import kotlin.Boolean
12
- import kotlin.Int
13
- import kotlin.String
14
- import kotlin.Unit
15
- import kotlin.jvm.JvmSynthetic
9
+ import java.util.*
16
10
17
11
/* *
18
12
* Initialisation options for location component to allow multiple instances
19
13
* of LocationComponent.
20
14
*/
21
15
public class LocationComponentInitOptions private constructor(
16
+ /* *
17
+ * The layer id of the location indicator layer used to draw the 2d puck.
18
+ */
22
19
public val puck2DLayerId : String ,
20
+ /* *
21
+ * The layer id of the model layer used to draw the 3d puck.
22
+ */
23
23
public val puck3DLayerId : String ,
24
+ /* *
25
+ * The source id of the model layer used to draw the 3d puck.
26
+ */
24
27
public val puck3DSourceId : String ,
28
+ /* *
29
+ * The top icon image id for the 2d puck.
30
+ */
25
31
public val topIconImageId : String ,
32
+ /* *
33
+ * The shadow icon image id for the 2d puck.
34
+ */
26
35
public val shadowIconImageId : String ,
36
+ /* *
37
+ * The bearing icon image id for the 2d puck.
38
+ */
27
39
public val bearingIconImageId : String
28
40
) {
41
+ /* *
42
+ * Convert the LocationComponentInitOptions to a String.
43
+ */
29
44
public override fun toString () =
30
45
" LocationComponentInitOptions(puck2DLayerId=$puck2DLayerId ,puck3DLayerId=$puck3DLayerId , puck3DSourceId=$puck3DSourceId , topIconImageId=$topIconImageId ,shadowIconImageId=$shadowIconImageId , bearingIconImageId=$bearingIconImageId )"
31
46
47
+ /* *
48
+ * Compares two LocationComponentOptions.
49
+ */
32
50
public override fun equals (other : Any? ): Boolean = other is LocationComponentInitOptions &&
33
51
puck2DLayerId == other.puck2DLayerId &&
34
52
puck3DLayerId == other.puck3DLayerId &&
@@ -37,11 +55,17 @@ public class LocationComponentInitOptions private constructor(
37
55
shadowIconImageId == other.shadowIconImageId &&
38
56
bearingIconImageId == other.bearingIconImageId
39
57
58
+ /* *
59
+ * The hashcode of the LocationComponentOptions.
60
+ */
40
61
public override fun hashCode (): Int = Objects .hash(
41
62
puck2DLayerId, puck3DLayerId, puck3DSourceId,
42
63
topIconImageId, shadowIconImageId, bearingIconImageId
43
64
)
44
65
66
+ /* *
67
+ * Convert LocationComponentOptions to a Builder.
68
+ */
45
69
public fun toBuilder (): Builder = Builder ()
46
70
.setPuck2DLayerId(this .puck2DLayerId)
47
71
.setPuck3DLayerId(this .puck3DLayerId)
@@ -58,21 +82,39 @@ public class LocationComponentInitOptions private constructor(
58
82
* @property
59
83
*/
60
84
public class Builder {
85
+ /* *
86
+ * The layer id of the location indicator layer used to draw the 2d puck.
87
+ */
61
88
@set:JvmSynthetic
62
89
public var puck2DLayerId: String = LOCATION_INDICATOR_LAYER
63
90
91
+ /* *
92
+ * The layer id of the model layer used to draw the 3d puck.
93
+ */
64
94
@set:JvmSynthetic
65
95
public var puck3DLayerId: String = MODEL_LAYER
66
96
97
+ /* *
98
+ * The source id of the model layer used to draw the 3d puck.
99
+ */
67
100
@set:JvmSynthetic
68
101
public var puck3DSourceId: String = MODEL_SOURCE
69
102
103
+ /* *
104
+ * The top icon image id for the 2d puck.
105
+ */
70
106
@set:JvmSynthetic
71
107
public var topIconImageId: String = TOP_ICON
72
108
109
+ /* *
110
+ * The shadow icon image id for the 2d puck.
111
+ */
73
112
@set:JvmSynthetic
74
113
public var shadowIconImageId: String = SHADOW_ICON
75
114
115
+ /* *
116
+ * The bearing icon image id for the 2d puck.
117
+ */
76
118
@set:JvmSynthetic
77
119
public var bearingIconImageId: String = BEARING_ICON
78
120
@@ -158,9 +200,15 @@ public class LocationComponentInitOptions private constructor(
158
200
}
159
201
}
160
202
203
+ /* *
204
+ * Companion object of [LocationComponentInitOptions].
205
+ */
161
206
companion object {
162
207
private var customLocationComponentCount = 0
163
208
209
+ /* *
210
+ * Create a unique LocationComponentInitOptions with incremental layer/source/image ids.
211
+ */
164
212
@JvmStatic
165
213
fun getNextUniqueLocationComponentOptions () = LocationComponentInitOptions {
166
214
puck2DLayerId = " custom_location_component_2d_layer_$customLocationComponentCount "
0 commit comments