Skip to content

Commit 24b8660

Browse files
authored
fix followZoomLevel flicker (rnmapbox#3841) (rnmapbox#3842)
Co-authored-by: David Barth <76754802+barthdavid@users.noreply.github.com>
1 parent 10a2b19 commit 24b8660

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

ios/RNMBX/RNMBXCamera.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,29 +319,26 @@ open class RNMBXCamera : RNMBXMapComponentBase {
319319
}
320320
}
321321

322-
var _camera = CameraOptions()
323-
324322
if let zoom = self.followZoomLevel as? CGFloat {
325323
if (zoom >= 0.0) {
326-
_camera.zoom = zoom
327324
followOptions.zoom = zoom
328325
}
329326
}
330327

331328
if let followPitch = self.followPitch as? CGFloat {
332329
if (followPitch >= 0.0) {
333-
_camera.pitch = followPitch
334330
followOptions.pitch = followPitch
335331
}
336332
} else if let stopPitch = self.stop?["pitch"] as? CGFloat {
337333
if (stopPitch >= 0.0) {
338-
_camera.pitch = stopPitch
339334
followOptions.pitch = stopPitch
340335
}
341336
} else {
342337
followOptions.pitch = nil
343338
}
344339

340+
var _camera = CameraOptions()
341+
345342
if let followHeading = self.followHeading as? CGFloat {
346343
if (followHeading >= 0.0) {
347344
_camera.bearing = followHeading

0 commit comments

Comments
 (0)