DarshanGowda0 / GeoFlutterFire

:fire:GeoFlutterFire:fire: is an open-source library that allows you to store and query firestore documents based on their geographic location.
https://youtu.be/MYHVyl-juUk
MIT License
305 stars 261 forks source link

No Data #106

Closed dupiesdupreez closed 4 years ago

dupiesdupreez commented 4 years ago

The query does not yield any results.

 GeoFirePoint center =
        _geo.point(latitude: -26.015461, longitude: 20);

    double radius = 5; //KM
    String field = 'pickupLocation';

    Stream<List<DocumentSnapshot>> stream = _geo
        .collection(collectionRef: Firestore.instance.collection('workers'))
        .within(center: center, radius: radius, field: field);

    stream.listen((List<DocumentSnapshot> documentList) {
      var x = documentList; --> (0 elements)
    })

image

webertim commented 4 years ago

Not sure if this will change anything, but in my Firestore the field names are 'geohash' and 'geopoint' instead of 'geoHash' and 'geoPoint'

dupiesdupreez commented 4 years ago

@webertim YOU Tim, saved me after wasting 3 HOURS of my life.

Just wanted to thank you for taking the time out of your day to help me out. That was Exactly the problem!

Thanks Tim

webertim commented 4 years ago

@dupiesdupreez Very happy to hear that :) Have a nice day!