On zoom event for google maps on android

前端 未结 11 2041
清酒与你
清酒与你 2020-11-30 00:04

We\'re building an application which is using the google maps api for android.

I have my MapController and MapView, and I enable the built-in zoom controls using:

11条回答
  •  心在旅途
    2020-11-30 00:32

    I used a mixture of the above. I found that using the timmer to start a thread every half a second cause the map to be really jenky. Probably because I was using a couple of If statments everytime. So I started the thread on a post delay of 500ms from the onUserInteraction. This gives enough time for the zoomLevel to update before the thread starts to run thus getting the correct zoomlevel without running a thread every 500ms.

    public void onUserInteraction() {
        handler.postDelayed(zoomChecker, zoomCheckingDelay);
    }
    

提交回复
热议问题