@@ -33,11 +33,6 @@ export type MarkerOptions = {
33
33
} ;
34
34
35
35
const defaultOptions : MarkerOptions = {
36
- anchor : 'center' ,
37
- color : '#3FB1CE' ,
38
- scale : 1 ,
39
- draggable : false ,
40
- clickTolerance : 0 ,
41
36
rotation : 0 ,
42
37
rotationAlignment : 'auto' ,
43
38
pitchAlignment : 'auto' ,
@@ -129,18 +124,29 @@ export default class Marker extends Evented<MarkerEvents> {
129
124
'_clearFadeTimer'
130
125
] , this ) ;
131
126
132
- options = extend ( { } , defaultOptions , options ) ;
133
-
134
- this . _anchor = options . anchor ;
135
- this . _color = options . color ;
136
- this . _scale = options . scale ;
137
- this . _draggable = options . draggable ;
138
- this . _clickTolerance = options . clickTolerance ;
139
- this . _rotation = options . rotation ;
140
- this . _rotationAlignment = options . rotationAlignment ;
141
- this . _pitchAlignment = options . pitchAlignment ;
142
- this . _occludedOpacity = options . occludedOpacity ;
143
- this . _altitude = options . altitude ;
127
+ const {
128
+ anchor = 'center' ,
129
+ color = '#3FB1CE' ,
130
+ scale = 1 ,
131
+ draggable = false ,
132
+ clickTolerance = 0 ,
133
+ rotation = defaultOptions . rotation ,
134
+ rotationAlignment = defaultOptions . rotationAlignment ,
135
+ pitchAlignment = defaultOptions . pitchAlignment ,
136
+ occludedOpacity = defaultOptions . occludedOpacity ,
137
+ altitude = defaultOptions . altitude ,
138
+ } = options || { } ;
139
+
140
+ this . _anchor = anchor ;
141
+ this . _color = color ;
142
+ this . _scale = scale ;
143
+ this . _draggable = draggable ;
144
+ this . _clickTolerance = clickTolerance ;
145
+ this . _rotation = rotation ;
146
+ this . _rotationAlignment = rotationAlignment ;
147
+ this . _pitchAlignment = pitchAlignment ;
148
+ this . _occludedOpacity = occludedOpacity ;
149
+ this . _altitude = altitude ;
144
150
145
151
this . _state = 'inactive' ;
146
152
this . _isDragging = false ;
0 commit comments