2011-04-20 41 views
1

我想根据缩放级别在地图上放置不同的绘图。这可以做到吗?有没有办法在发生变化时检测缩放变化?Google地图是否有onZoomLevelChange()或类似的?

Android应用

+0

我最终找到了答案。 这里是'MapView'的扩展,名为'mapview-overlay-manager' http://code.google.com/p/mapview-overlay-manager/ – 2011-04-20 21:06:05

回答

1

如果您在使用Google Maps API你可以调用 “getZoomLevel()” 的MapView

int getMaxZoomLevel() 
      Returns the maximum zoom level for the point currently at the center. 
int getZoomLevel() 
      Returns the current zoom level of the map 

处理它的最简单方法是覆盖“OnTouchEvent”以检查和分配与缩放级别相关联的后台任务。

boolean onTouchEvent(android.view.MotionEvent ev) 
      Passes trackball events to the overlays first, and if they don't handle them, feed it to a gesture detector, and dispatch the detected gestures 

确保您提供“super.OnTouchEvent”如果你没有做什么特别的吧。

+0

这似乎是一个有用的但圆的方式做一个。万分感谢 – 2011-04-21 06:13:07

相关问题