diff options
Diffstat (limited to 'test/map/map.test.cpp')
-rw-r--r-- | test/map/map.test.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp index b732741efd..f563aaa548 100644 --- a/test/map/map.test.cpp +++ b/test/map/map.test.cpp @@ -69,6 +69,18 @@ TEST(Map, LatLngBehavior) { ASSERT_DOUBLE_EQ(latLng1.longitude(), latLng2.longitude()); } +TEST(Map, LatLngBoundsToCamera) { + MapTest test; + Map map(test.backend, test.view.getSize(), 1, test.fileSource, test.threadPool, MapMode::Still); + + map.setLatLngZoom({ 40.712730, -74.005953 }, 16.0); + + LatLngBounds bounds = LatLngBounds::hull({15.68169,73.499857}, {53.560711, 134.77281}); + + CameraOptions virtualCamera = map.cameraForLatLngBounds(bounds, {}); + ASSERT_TRUE(bounds.contains(*virtualCamera.center)); +} + TEST(Map, CameraToLatLngBounds) { MapTest test; Map map(test.backend, test.view.getSize(), 1, test.fileSource, test.threadPool, MapMode::Still); |