如何捕捉地图平移|缩放,完成事件与Android SDK? [英] How to catch a map panning | zooming finished event with Android SDK?

查看:360
本文介绍了如何捕捉地图平移|缩放,完成事件与Android SDK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找一种方式,当一个地图的完成平移或缩放或平移和缩放来接收事件。这些事件没有在SDK为Android 2.3.3,我用解雇,据我所知,从 MapActivity 。我试过 MapChange 图书馆,然而,它强迫你使​​用处理程序 MapActivity ,以确保该UI更新UI线程上进行处理; 更多信息

I am looking for a way to receive events when a map finished panning or zooming or panning and zooming. Those events are not fired, afaik, from MapActivity in the SDK for Android 2.3.3 which I use. I tried the MapChange library, however, it forces you to use Handler in your MapActivity to ensure to that UI updates are processed on the UI thread; more information.

问:你知道了的 Android的支持库如通过使用 FragmentActivity 而不是 MapActivity - 我不能现在找到一个替代的解决方案。

Question: Do you know of any support for such events by the Android Support Library e.g. by using FragmentActivity instead of MapActivity - I could not find an alternative solution by now.

类似的问题可以在这里找到:

Similar questions can be found here:

  • Android MapActivity on map movement
  • How to catch that map panning and zoom are really finished?

编辑:
该MapChange库是<一个href=\"https://github.com/bricolsoftconsulting/MapChange/tree/75cf1b2f7f94410939db70b2e6e80b9042f0a608/src/com/bricolsoftconsulting/mapchange\"相对=nofollow>更新了一些天前。我查了一下得到了提高。

The MapChange library was updated some hours ago. I will check out what has been improved.

编辑:
该MapChange库已经改善,工作更可靠现在是一个很好的选择!请结帐了解更多信息GitHub的项目。但是,我没有解决这一问题,因为我仍然有兴趣一个人是否可以做同样的与现有的组件。

The MapChange library has been improved and works much more reliable now and is a good option! Please checkout the GitHub project for further information. However, I leave the question open since I am still interested whether one can do the same with existing components.

推荐答案

为什么要使用一个处理程序有问题?您可以随时发表您的用户界面的变化为主线,为什么不这样做呢?

Why is it a problem to use a Handler ? You can always post your UI changes to the main thread, why not do that ?

这是所以有人找到一种方式来获得一个片段活动通过改变支持库code包含一个MapView类,但它变得过于繁琐,我使用,我恢复到一个完全成熟的地图活动。

Someone on SO found a way to get a Fragment activity to contain a MapView by changing the support library code but it became too cumbersome for me to use and I reverted to a full-blown Map activity.

这篇关于如何捕捉地图平移|缩放,完成事件与Android SDK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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