Reputation: 272
I am trying to use Google Maps Extension in my app. But when i try to use setClustering method to my Google Map object its showing not resolving error, that means google map class does not have this method.
mMap.setClustering(new ClusteringSettings().enabled(false).addMarkersDynamically(true));
However, according to library documentation i have to use like this. Also the available Stackoverflow answers also did like this answer way.
this is my dependency
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:27.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:cardview-v7:27.+'
compile 'com.android.support:design:27.+'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.code.gson:gson:2.7'
compile 'com.google.android.gms:play-services-location:12.0.1'
compile 'com.google.android.gms:play-services-maps:12.0.1'
compile 'com.google.android.gms:play-services-places:12.0.1'
compile 'com.androidmapsextensions:android-maps-extensions:2.4.0'
testCompile 'junit:junit:4.12'
}
How to solve this issue?
Upvotes: 1
Views: 366
Reputation: 21033
GoogleMap
should be com.androidmapsextensions.GoogleMap
not com.google.android.gms.maps.GoogleMap
check your import.
com.androidmapsextensions.GoogleMap map;
map.setClustering(new ClusteringSettings().enabled(false).addMarkersDynamically(true));
Upvotes: 1