【问题标题】:How to set the latitude and longitude of the VisibleRegion programmatically when the GoogleMap loads?加载 GoogleMap 时如何以编程方式设置 VisibleRegion 的纬度和经度?
【发布时间】:2013-05-20 10:23:37
【问题描述】:

我正在研究 GoogleMap。我需要设置与当前在我的 android 设备屏幕上可见的 GoogleMap 的四个角相对应的纬度和经度。

我们可以使用这些值, map.getProjection().getVisibleRegion().farLeft;

用于当前缩放级别。

但我想知道是否有任何方法可以设置 farLeft、nearRight 等的值以编程方式保持缩放级别不变。

感谢任何帮助。

【问题讨论】:

    标签: android google-maps zooming latitude-longitude


    【解决方案1】:

    如果你画一个不可见的矩形,它的大小是map.getProjection().getVisibleRegion(),然后将相机设置为矩形的大小,它可以工作。

    保持相同的缩放级别真的那么重要吗?它可以通过以某种方式调整缩放级别来工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-27
      • 1970-01-01
      相关资源
      最近更新 更多