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

No cluster with the specified id #52

Closed
craigcoles opened this issue Oct 18, 2018 · 6 comments
Closed

No cluster with the specified id #52

craigcoles opened this issue Oct 18, 2018 · 6 comments

Comments

@craigcoles
Copy link

Environment

"react": "16.4.1",
"react-native": "0.56.0",
"react-native-maps": "react-community/react-native-maps",
"react-native-maps-super-cluster": "^1.5.0"

Steps to Reproduce

  • Using the example provided in the Readme.
  • Install the application [either iOS or Android] from fresh.
  • Open the application.
  • When the clusters are loaded, click on a cluster.

Expected Behaviour

Upon loading the application and clicking on a cluster, to display the children of the cluster.

Actual Behaviour

After installing the application from fresh and loading the app, if you click on a cluster its throws the following error:

If you reload the application and try again, no error is encountered and everything works as expected.

Notes

  • We are using are own onClusterPress method to do some do different things depending on the number of children in the cluster:
onClusterPress={this.onClusterPress}
preserveClusterPressBehavior={false}
  • Inside the onClusterPress we are getting the children to see how many there are:
onClusterPress = (id: string) => {
    const children = this.map.index
      .getLeaves(id, 100)
      .map(c => c.properties.item);
@ollieh-m
Copy link

The issue seems to be related to having multiple points with exactly the same coordinates. We've explained in this issue on the Supercluster library: mapbox/supercluster#103

But it isn't clear why this error happens on first load of the app, but not if the app is reloaded.

@craigcoles
Copy link
Author

Turns out, this was down to poor data.

@bclinkinbeard
Copy link

@craigcoles Can you elaborate? I'm seeing the same behavior with supercluster.

@craigcoles
Copy link
Author

@bclinkinbeard With the poor data that we had, on first load of the application after install, locations that were null were actually being returned as NaN. On closing the application and re-opening again, the locations were then being returned as null instead.

@bclinkinbeard
Copy link

@craigcoles Like you were giving supercluster features with properties.coordinates = [NaN, NaN]?

@craigcoles
Copy link
Author

@bclinkinbeard Yeah, I believe that was the issue. For some reason, it was only happening on first load after a fresh install of the application.

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