【发布时间】:2014-01-15 14:57:40
【问题描述】:
在我的应用程序中使用了 Google Maps V2。 这是描述地图片段的代码片段。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<fragment
android:id="@+id/g_map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
<ImageView
android:id="@+id/center_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="@drawable/btn_centering"
android:clickable="true" />
</RelativeLayout>
如何限制用户可以导航的地图矩形区域?我尝试使用 OnCameraChangeListener 来执行此操作,但它看起来丑陋且不稳定。 (也许这是我的错)))
【问题讨论】:
-
您的意思是用户只能在某些地理区域内导航吗?
-
@El_Mochiq,是的,只能在矩形范围内导航。
标签: android google-maps