谷歌地图Android的API V2 - MarkerOptions拖动和可见的方法拖动、地图、方法、Android

2023-09-05 08:06:27 作者:走死在岁月里

我在和新的谷歌地图的Andr​​oid API(V2)本月初公布,我很高兴地看到一个 MarkerOptions.draggable(布尔拖动)方法,我想在传递时,将创建一个可拖动的标记的拖动 true值。然而,在尝试它(即增加一个标记为这样的图),它似乎并没有做任何事情。

I'm playing with the new Google Maps Android API (v2) released earlier this month and I was delighted to see a MarkerOptions.draggable(boolean draggable) method which I thought would create a draggable marker when passing in a draggable value of true. However, on trying it (i.e. adding a marker as such to the map), it doesn't seem to do anything.

MarkerOptions.visible(布尔可见)方法也一样,我以为会从视图中隐藏标记在可见值

The MarkerOptions.visible(boolean visible) method too, which I thought would hide the marker from view when passing in a visible value of false.

任何人都能够得到这些方法来处理?

Anyone been able to get these methods to work?

推荐答案

后一个问题已经在的谷歌Bug跟踪。

拖动办法应该工作。看看所提供的样本项目。也许经过了漫长的preSS的拖累开始,就像在示例项目?

The draggable method should work. Look at the provided Sample project. Maybe the drag starts after a longpress, like in the Sample project?

    // Creates a draggable marker. Long press to drag.
    mMelbourne = mMap.addMarker(new MarkerOptions()
            .position(MELBOURNE)
            .title("Melbourne")
            .snippet("Population: 4,137,400")
            .draggable(true));