Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Zoom to bounds not working properly when map is tilt or rotated #10133

Closed
johanneslaubermoovel opened this issue Oct 5, 2017 · 1 comment
Closed
Labels
Android Mapbox Maps SDK for Android Core The cross-platform C++ core, aka mbgl

Comments

@johanneslaubermoovel
Copy link

In the video you see when the map is not tilt, zoom to bounds works. But after tilting it, it zooms somewhere else, only after pressing zoom to bounds a second time it works correctly again.

https://youtu.be/v8jU3GUqQtU

zoomto.setOnClickListener {
            val latLng1 = LatLng(48.764183, 9.1668824)
            val latLng2 = LatLng(48.7648268, 9.1751567)
            val latLng3 = LatLng(48.7696245, 9.1717453)

            val latLngs = LatLngBounds.Builder()
                    .include(latLng1)
                    .include(latLng2)
                    .include(latLng3)


            val polylineOptions = PolylineOptions().apply {
                color(Color.GREEN)
                width(10f)
                add(latLng1)
                add(latLng2)
                add(latLng3)
            }

            (activity as MainActivity).map_view.getMapAsync { map ->
                map.animateCamera(CameraUpdateFactory.newLatLngBounds(latLngs.build(), 0))
                map.addPolyline(polylineOptions)
            }
        }

Platform: android
Mapbox SDK version: 5.1.3

Steps to trigger behavior

  1. tilt the map
  2. zoom to bounds

Expected behavior

Zooms to bounds

Actual behavior

Zooms somewhere else

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Oct 5, 2017
@asheemmamoowala asheemmamoowala added the Core The cross-platform C++ core, aka mbgl label Oct 5, 2017
@asheemmamoowala
Copy link
Contributor

Duplicate of #2259.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

No branches or pull requests

3 participants