Android谷歌地图-显示半个地球

Android谷歌地图-显示半个地球,android,map,Android,Map,我想在我的应用程序中显示一个谷歌地图,显示地球的一半,在同一视图中包含两个彼此相距约20000公里的标记 我尝试使用属性getMinZoomLevel(),但这还不够——它显示了第一个标记,它被一个只有半个大陆大小的区域包围。有没有什么方法可以让我得到我想要的开阔视野 最后一个已知用户位置(标记之一)的代码示例,其中zoomLevel为getMinZoomLevel() 试试类似的东西 private LatLngBounds bounds; LatLngBounds.Builder build

我想在我的应用程序中显示一个谷歌地图,显示地球的一半,在同一视图中包含两个彼此相距约20000公里的标记

我尝试使用属性getMinZoomLevel(),但这还不够——它显示了第一个标记,它被一个只有半个大陆大小的区域包围。有没有什么方法可以让我得到我想要的开阔视野

最后一个已知用户位置(标记之一)的代码示例,其中zoomLevel为getMinZoomLevel()


试试类似的东西

private LatLngBounds bounds;
LatLngBounds.Builder builder = new LatLngBounds.Builder();

        builder.include(pointA);
        builder.include(pointB);
        //and other latlng points as you like...
        bounds = builder.build();

map.animateCamera(CameraUpdateFactory.newLatLngBounds(
                            bounds, 20));
animateCamera将摄影机设置为特定点位置的动画。如果有多个点(LatLngBounds),则会将贴图展开,使所有点都可见

希望能有所帮助

private LatLngBounds bounds;
LatLngBounds.Builder builder = new LatLngBounds.Builder();

        builder.include(pointA);
        builder.include(pointB);
        //and other latlng points as you like...
        bounds = builder.build();

map.animateCamera(CameraUpdateFactory.newLatLngBounds(
                            bounds, 20));