Google Map V2 API:如何显示特定的地图区域 [英] Google map v2 api: how to show a specific map area

查看:78
本文介绍了Google Map V2 API:如何显示特定的地图区域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用google map api v2.我想根据地图边界(东北和西南坐标)显示特定的地图区域.但是,google map api v2仅支持setCenter()方法.是否有任何公式可以根据地图区域计算中心位置?

I am using google map api v2. I'd like to show a specific map area based on map bound (northeast and southwest coordinates). However, google map api v2 only supports setCenter() method. Is there any formula to calculate center position based on map area?

推荐答案

使用地图的GetBounds()方法,从中可以获取中心以及其他信息.

Use the map's GetBounds() method from which you can get the center along with other information.

这篇关于Google Map V2 API:如何显示特定的地图区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆