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

points in useClusterer are empty #22

Open
Vin-Xi opened this issue Oct 24, 2022 · 5 comments
Open

points in useClusterer are empty #22

Vin-Xi opened this issue Oct 24, 2022 · 5 comments

Comments

@Vin-Xi
Copy link

Vin-Xi commented Oct 24, 2022

Issue

No markers were being rendered on my map. So I logged the points returned by useClusterer hook, it returned an empty array. So I tried using getRandomData from example, even that returned an empty array.

I have tried going into the library and have figured out by logging at various places that, this.cppInstance.getCluster is returning an empty array. There seems to be an issue from there or maybe I am not meeting some requirements for data.

Code

Click to expand
const {width, height} = Dimensions.get('window');
const MAP_DIM = {width, height};


const Map = () => {
  
  const [region, setRegion] = useState({
    latitude: 25.276987,
    longitude: 55.296249,
    latitudeDelta: 0.0922,
    longitudeDelta: 0.0421,
  });

  const [points,supercluster] = useClusterer(
    gen,
    MAP_DIM,
    region
  )
  ......

//MOCKDATA


export const gen = Array.from(new Array(10), (_, index) => (
  {
    type: "Feature" as "Feature",
    properties: {
      title: `${index}`,
      id: index,
    },
    geometry: {
      type: 'Point' as "Point",
      coordinates: [baseLatitude - Math.random(), baseLongitude + Math.random()]
    },
  }
));

Environment

Click to expand

Package version:

react-native:0.70
react-native-clusterer: 1.2.2,
react-native-maps: 1.3.2,

System:
OS: Windows 10 10.0.19044
CPU: (8) x64 Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
Memory: 14.69 GB / 31.88 GB
Binaries:
Node: 16.15.1 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: AI-212.5712.43.2112.8609683
Visual Studio: Not Found
Languages:
Java: 18.0.1.1 - C:\Program Files\Common Files\Oracle\Java\javapath\javac.EXE
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.0 => 0.70.0
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found

@vytautasvargonas
Copy link

@Vin-Xi Have you figured out what the problem was?

@Vin-Xi
Copy link
Author

Vin-Xi commented Apr 9, 2023

No, seeing how this issue is stale. I would say you are better off using some other library for clustering

@endrits079
Copy link

@Vin-Xi what did you use?

@riddy6421
Copy link

Any luck?

@JiriHoffmann
Copy link
Owner

Seems like you inverted the coordinates - [lat, lng] instead of the correct [lng, lat]

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

5 participants