Skip to content

clusterMaxZoom, clusterMinPoints not working on all versions  #1955

Closed

Description

@Florentn

I manage getting clustering to work but the clusterMaxZoom and clusterMinPoints attributes do not seem to function at all. I tried with pre v10, v10 and maplibre versions.
Here is the react-native code for v10

    <MapboxGL.MapView
           ref={(c) => (this._map = c)} style={sheet.matchParent} 
           zoomEnabled={true} 
           styleURL={(darkMode ? VECTOR_SOURCE_URL_DARK : VECTOR_SOURCE_URL_LIGHT)}
           onRegionDidChange={(e)=>{this.updateCenter()}} 
           logoEnabled={false} 
           rotateEnabled={false} 
           pitchEnabled={false} >
          <MapboxGL.UserLocation visible={true} onUpdate={this.onUserLocationUpdate} />

          <MapboxGL.Camera 
            zoomLevel={this.zoomLevel} 
            minZoomLevel={8} 
            maxZoomLevel={18} 
            centerCoordinate={this.allData.region[0]} 
            animationMode={'none'}
          />
          
          <MapboxGL.ShapeSource 
            id="businesses" 
            shape={this.allData.dataBusinesses} 
            tolerance={5}
            clusterRadius={30} 
            clusterMinPoints={4}
            clusterMaxZoom={1} 
            cluster={true}
           >
            
            <MapboxGL.SymbolLayer id="ico" style={this.styles.icon} />
            <MapboxGL.SymbolLayer id="pointCount" style={this.styles.clusterCount} />
            <MapboxGL.CircleLayer 
              id="clusteredPoints" 
              belowLayerID="pointCount" 
              filter={['has', 'point_count']} 
              style={this.styles.clusteredPoints} />
          </MapboxGL.ShapeSource>

      </MapboxGL.MapView>

My build.gradle

buildscript {
    ext {
          buildToolsVersion = "30.0.2"
          minSdkVersion = 29
          compileSdkVersion = 31
          targetSdkVersion = 31
          googlePlayServicesAuthVersion = "16.0.1"
          androidMapsUtilsVersion = "0.5+"
          supportLibVersion = "30.0.0"
          RNMapboxMapsImpl = "mapbox"
          RNMapboxMapsLibs = { // optional - only required if you want to customize it
          implementation 'com.mapbox.maps:android:10.5.0'
          implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:5.4.1'
     }
}

repositories {
    google()
    mavenCentral()
    jcenter()
}

dependencies {
    classpath("com.android.tools.build:gradle:7.1.1")
    classpath 'com.google.gms:google-services:4.1.0'
}

}

Are these attribute and associated functionalities actually implemented and working?
Thanks in advance!

Activity

  1. added
    enhancement
    on Jun 7, 2022
  2. mfazekas commented on Jun 7, 2022

    @mfazekas
    Contributor

    We have clusterMaxZoomLevel but no clusterMinPoints

  3. mfazekas commented on Sep 30, 2022

    @mfazekas
    Contributor

    clusterMinPoints seems to be not supported on native

    maplibre/maplibre-native#261

  4. added
    upstream
    on Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementupstream

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions