File tree Expand file tree Collapse file tree
app/src/main/java/com/mapbox/maps/testapp/examples Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,9 +3,11 @@ package com.mapbox.maps.testapp.examples.camera
33import android.os.Bundle
44import android.view.animation.AccelerateDecelerateInterpolator
55import androidx.appcompat.app.AppCompatActivity
6+ import com.mapbox.geojson.Point
67import com.mapbox.maps.MapView
78import com.mapbox.maps.MapboxMap
89import com.mapbox.maps.Style
10+ import com.mapbox.maps.dsl.cameraOptions
911import com.mapbox.maps.plugin.animation.CameraAnimatorOptions.Companion.cameraAnimatorOptions
1012import com.mapbox.maps.plugin.animation.camera
1113
@@ -18,6 +20,7 @@ class LowLevelCameraAnimatorActivity : AppCompatActivity() {
1820 val mapView = MapView (this )
1921 setContentView(mapView)
2022 mapboxMap = mapView.getMapboxMap()
23+ mapboxMap.setCamera(CAMERA_TARGET )
2124 mapboxMap.loadStyleUri(
2225 Style .MAPBOX_STREETS
2326 ) {
@@ -46,4 +49,11 @@ class LowLevelCameraAnimatorActivity : AppCompatActivity() {
4649 }
4750 }
4851 }
52+
53+ private companion object {
54+ private val CAMERA_TARGET = cameraOptions {
55+ center(Point .fromLngLat(- 74.0060 , 40.7128 ))
56+ zoom(3.0 )
57+ }
58+ }
4959}
Original file line number Diff line number Diff line change @@ -23,19 +23,18 @@ class GlobeActivity : AppCompatActivity() {
2323 setContentView(mapView)
2424
2525 mapView.getMapboxMap().apply {
26+ setCamera(
27+ cameraOptions {
28+ center(CENTER )
29+ zoom(ZOOM )
30+ }
31+ )
2632 loadStyle(
2733 style(Style .SATELLITE_STREETS ) {
2834 + atmosphere { }
2935 + projection(ProjectionName .GLOBE )
3036 }
31- ) {
32- setCamera(
33- cameraOptions {
34- center(CENTER )
35- zoom(ZOOM )
36- }
37- )
38- }
37+ )
3938 }
4039 }
4140
You can’t perform that action at this time.
0 commit comments