Skip to content

Added an isochrone example.#211

Merged
cafesilencio merged 1 commit intomainfrom
sb-NAVAND-3735-isochrone-example
Oct 23, 2024
Merged

Added an isochrone example.#211
cafesilencio merged 1 commit intomainfrom
sb-NAVAND-3735-isochrone-example

Conversation

@cafesilencio
Copy link
Copy Markdown

Add an example demonstrating the use of the isochrone API.

@cafesilencio cafesilencio requested a review from a team as a code owner October 23, 2024 16:02
@cafesilencio cafesilencio force-pushed the sb-NAVAND-3735-isochrone-example branch from 230fd8a to 8c2c4fb Compare October 23, 2024 20:15
Comment on lines +41 to +43
private val mapboxMap: MapboxMap by lazy {
binding.mapView.getMapboxMap()
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private val mapboxMap: MapboxMap by lazy {
binding.mapView.getMapboxMap()
}
private var mapboxMap: MapboxMap? = null

onDestroy should still null out this object. "loadStyle" is technically async and could return after the Activity is destroyed.

}

val cameraOptions = CameraOptions.Builder().center(Point.fromLngLat(-73.990593, 40.740121)).zoom(12.0).build()
binding.mapView.getMapboxMap().setCamera(cameraOptions)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
binding.mapView.getMapboxMap().setCamera(cameraOptions)
mapboxMap?.setCamera(cameraOptions)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe the MapView lifecycle handles this case though and it's not really a problem.

@cafesilencio cafesilencio force-pushed the sb-NAVAND-3735-isochrone-example branch from 8c2c4fb to 1b7a3f7 Compare October 23, 2024 22:38
@cafesilencio cafesilencio enabled auto-merge (squash) October 23, 2024 22:39
@cafesilencio cafesilencio merged commit 3382b0a into main Oct 23, 2024
@cafesilencio cafesilencio deleted the sb-NAVAND-3735-isochrone-example branch October 23, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants