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

ShapeSourceRef.current.getClusterExpansionZoom is not a function #1349

Closed
natedx opened this issue May 15, 2021 · 2 comments
Closed

ShapeSourceRef.current.getClusterExpansionZoom is not a function #1349

natedx opened this issue May 15, 2021 · 2 comments

Comments

@natedx
Copy link

natedx commented May 15, 2021

Describe the bug
getClusterExpansionZoom method on ShapeSource doesn't seem to exist.

To Reproduce
Steps to reproduce the behavior.

const source = React.useRef(null);

...

<MapboxGL.ShapeSource
  ref={source}
  onPress={async (e) => {
    const feature = e.features[0];
    if (feature.properties?.cluster) {
      const zoom = await source.current.getClusterExpansionZoom(
        feature.properties.cluster_id,
      );
      // use zoom
    }
  }}
  cluster
  clusterMaxZoomLevel={13}
  clusterRadius={40}
/>

Expected behavior
The method should return the zoom value.

Actual behavior
Error message : ShapeSourceRef.current.getClusterExpansionZoom is not a function.

Versions (please complete the following information):

  • Platform: Android, iOS
  • Platform OS: Android 10, iOS 14
  • Device: OnePlus6T, iPhoneX
  • Emulator/ Simulator: no
  • Dev OS: OSX 11.3
  • react-native-mapbox-gl Version : 8.0.1
  • mapbox/mapbox-sdk Version : 0.11.0
  • React Native Version : 0.63.4
@LukeLaScala
Copy link

LukeLaScala commented May 16, 2021

Hey I figured this one out. The issue is more of a documentation error. The getClusterExpansionZoom method is only on the current beta build, not on 8.0.1. After upgrading to beta it was working fine.

In short, the issue lies in the documentation. Installing with the installation guides yields a version RNMGL that doesn’t include getClusterExpansionZoom while it’s included in the current documentation.

@ferdicus
Copy link
Member

Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants