6

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.

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?

4

1 に答える 1

23

後者の問題はすでにGoogleバグトラッカーにあります。

draggableメソッドは機能するはずです。提供されているサンプルプロジェクトを見てください。サンプルプロジェクトのように、長押しした後にドラッグが始まるのではないでしょうか。

    // Creates a draggable marker. Long press to drag.
    mMelbourne = mMap.addMarker(new MarkerOptions()
            .position(MELBOURNE)
            .title("Melbourne")
            .snippet("Population: 4,137,400")
            .draggable(true));
于 2012-12-11T13:09:28.083 に答える