Code Monkey home page Code Monkey logo

Comments (7)

JiriHoffmann avatar JiriHoffmann commented on July 27, 2024
  • On an expo app the library is not working well because the native module is not getting installed, and it's impossible to run pod install (because it's managed).

I don't have a lot of experience with expo, but I was able to get it working by running expo run:ios which should generate an ios folder and automatically install all pods

This causes this error to be displayed,react-native-cryptopp is not the best message since didn't know that this error came from this library. Probably we could change it to react-native-clusterer

Oops, forgot to change the name. Fixed.

  • TypeScript definitions are not correctly set.

Should be fixed as well.

  • Also noticed, that cluster.getChildren doesn't work in the same way as JS does. I can put a reproduce example later.

This needs some further investigation. For me, it crashes on both iOS and Android at

const auto zoom_iter = zooms.find(origin_zoom);

but using https://github.com/mapbox/supercluster.hpp seems to work just fine.

from react-native-clusterer.

semoal avatar semoal commented on July 27, 2024

I don't know shit about c++ haha but couldn't it be that

 const auto origin_zoom = cluster_id % 32;

The cluster_id expects an int, but here: https://github.com/JiriHoffmann/react-native-clusterer/blob/main/cpp/react-native-clusterer.cpp#L76 is not correctly passing the args?

from react-native-clusterer.

JiriHoffmann avatar JiriHoffmann commented on July 27, 2024

return cluster_getChildren(rt, args[0].asString(rt).utf8(rt), (int)args[1].asNumber());

It's casted into an int at line 90, I'll check it out later this week

from react-native-clusterer.

semoal avatar semoal commented on July 27, 2024

Hi @JiriHoffmann could you take a look to the getChildren issue? I've tried to fix it but I'm so bad at C++. I noticed that the biggest difference between MapBox supercluster and yours it's the "dependencies" (not sure how is it called on c++) are inlined.

Is not possible to install dependencies of c++ like package.json on js does?

from react-native-clusterer.

JiriHoffmann avatar JiriHoffmann commented on July 27, 2024

@semoal Sorry for the delay, other projects ate up too much of my time. Should be fixed in 0.2.3. Let me know if you have any issues

Is not possible to install dependencies of c++ like package.json on js does?

Yes, it would be possible, but then each dependency would have to be linked separately in CMakeLists and the podspec file, so I just created an amalgamation of Supercluster with its dependencies since it seemed like the cleanest solution with one file, but I'm open to any other ideas.

from react-native-clusterer.

semoal avatar semoal commented on July 27, 2024

Still not working properly at all Jiri.

  • One thing I didn't saw previously, it's the geometry of the returned cluster as double array, shouldn't be an object? The typings are failing a lot because is not returning the expected return.

Return of cluster.getChildren(clusterId):

Array [
  Object {
    "geometry": Array [
      Array [
        longitude,
        latitude,
      ],
    ],
    "tags": Object {

    },
    "type": 1,
  },
  Object {
    "geometry": Array [
      Array [
        longitude,
        latitude,
      ],
    ],
    "id": 462,
    "tags": Object {
      "cluster": true,
      "cluster_id": 462,
      "point_count": 7,
      "point_count_abbreviated": "7",
    },
    "type": 1,
  },
]

Hope this debugging it's useful for you, feel free to request anything to help this scenario.

from react-native-clusterer.

JiriHoffmann avatar JiriHoffmann commented on July 27, 2024

How about now? The data was parsed with the wrong function

from react-native-clusterer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.