0

The class NonHierarchicalViewBasedAlgorithm from googlemaps/android-maps-utils have a constructor:

 public NonHierarchicalViewBasedAlgorithm(int screenWidth, int screenHeight) {
        mViewWidth = screenWidth;
        mViewHeight = screenHeight;
    }

But Im not sure if I should send the width in pixels or in dp.

Any ideas?

Daniel Gomez Rico
  • 15,026
  • 20
  • 92
  • 162

2 Answers2

1

Pretty sure all of the Google android map parts work in raw pixels, not dip.

Scott Corscadden
  • 2,831
  • 1
  • 25
  • 43
0

From the source code of NonHierarchicalViewBasedAlgorithm class (https://github.com/googlemaps/android-maps-utils/blob/main/library/src/main/java/com/google/maps/android/clustering/algo/NonHierarchicalViewBasedAlgorithm.java):

/**
 * @param screenWidth  map width in dp
 * @param screenHeight map height in dp
 */
public NonHierarchicalViewBasedAlgorithm(int screenWidth, int screenHeight) {
    mViewWidth = screenWidth;
    mViewHeight = screenHeight;
}
vostojin
  • 1
  • 2