Cherry pick latlngbounds to release branch (#8788)

* [android] - move calculation of LatLngBounds to core

* [core] Ignore shortest path in Map::pixelForLatLng

* [android] - convert camera position values coming from core (#8794)
This commit is contained in:
Tobrun
2017-04-21 23:07:08 +02:00
committed by GitHub
parent 4d0605a004
commit 03f26cb508
19 changed files with 228 additions and 193 deletions

View File

@@ -48,6 +48,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, Offline) {
MapTest test;
DefaultFileSource fileSource(":memory:", ".");