0
    import com.google.maps.android.MarkerManager;
    import com.google.maps.android.clustering.algo.Algorithm;
    import com.google.maps.android.clustering.algo.NonHierarchicalDistanceBasedAlgorithm;
    import com.google.maps.android.clustering.algo.PreCachingAlgorithmDecorator;
    import com.google.maps.android.clustering.view.ClusterRenderer;
    import com.google.maps.android.clustering.view.DefaultClusterRenderer;

i am getting a error that maps is undefined. i am following the google guide to set up marker clustering. https://developers.google.com/maps/documentation/android-api/utility/marker-clustering

6
  • 2
    You need to add the dependency compile 'com.google.maps.android:android-maps-utils:0.4+' to your build.gradle Commented Mar 21, 2016 at 11:51
  • Can you post the whole code which deals with the marker clustering? Commented Mar 21, 2016 at 11:53
  • i have included com.google.android.gms:play-services-maps:8.4.0 in gradle file Commented Mar 21, 2016 at 12:03
  • Yes, you need com.google.android.gms:play-services-maps:8.4.0 but compile 'com.google.maps.android:android-maps-utils:0.4+' is also needed as marker clustering is a funcionality of the Google Maps API Utility Library (developers.google.com/maps/documentation/android-api/utility) Commented Mar 21, 2016 at 12:05
  • @antonio thanks :) Commented Mar 21, 2016 at 12:09

1 Answer 1

2

As marker clustering is a funcionality of the Google Maps API Utility Library, you need to add the following dependency to your build.gradle

compile 'com.google.maps.android:android-maps-utils:0.4+'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.