如何在Google地图上获取图像的中心坐标

问题描述 投票:0回答:1

我在Google地图上有一个图像作为覆盖图,并且由于我只有左上角的坐标,所以我将图像的左上角放在该坐标上,现在我想使其焦点集中在应用程序中,因此我必须将CameraUpdetFactory.newLatLngZoom(centerilizedLatLng,zoomLevel)中的中心坐标这种方法,那么我该如何计算此图像的中心坐标?

android google-maps coordinates overlay
1个回答
0
投票

要获取LatLng作为Google地图的中心,只需使用:

mMap.getProjection().getVisibleRegion().latLngBounds.getCenter();

mMap.getCameraPosition().target

快乐编码:)

© www.soinside.com 2019 - 2024. All rights reserved.