I have an android app with Android Maps V2. Adding markers to it is no problem but I can't seem to make the marker flat. When I use this piece of example code

Marker marker = map.addMarker(new MarkerOptions()
                    .position(new LatLng(50, 50))
                    .flat(true));

it gives me the error The method flat(boolean) is undefined for the type MarkerOptions.

I have the following in my manifest

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />

and

    <meta-data
    android:name="com.google.android.maps.v2.API_KEY"
    android:value="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" />

I can't seem to find why it behaves like flat markers don't exist. Any help would be appreciated. Thanks in advance.

有帮助吗?

解决方案

You must be using an older version of the Play Services SDK. Download the latest from the SDK Manager, then make sure that your project is using this latest version.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top