Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clusterMaxZoom, clusterMinPoints not working on all versions #1955

Closed
Florentn opened this issue Jun 5, 2022 · 2 comments
Closed

clusterMaxZoom, clusterMinPoints not working on all versions #1955

Florentn opened this issue Jun 5, 2022 · 2 comments
Labels
enhancement New feature or request upstream the bug source is a bug in native mapbox gl

Comments

@Florentn
Copy link

Florentn commented Jun 5, 2022

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!

@mfazekas mfazekas added the enhancement New feature or request label Jun 7, 2022
@mfazekas
Copy link
Contributor

mfazekas commented Jun 7, 2022

We have clusterMaxZoomLevel but no clusterMinPoints

@mfazekas
Copy link
Contributor

clusterMinPoints seems to be not supported on native

maplibre/maplibre-native#261

@mfazekas mfazekas added the upstream the bug source is a bug in native mapbox gl label Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request upstream the bug source is a bug in native mapbox gl
Projects
None yet
Development

No branches or pull requests

2 participants