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

Wrong distance radius #71

Open stoppiNeobiz opened 4 years ago

stoppiNeobiz commented 4 years ago

Hi, ive a problem with the plugin, ive this code:

geo = Geoflutterfire();
    GeoFirePoint center = geo.point(
        latitude:45.5797169, longitude: 9.2408815);

    stream = radius.switchMap((rad) {
      print(rad);
      var collectionReference = _firestore
          .collection('locations'); 
      return geo
          .collection(collectionRef: collectionReference)
          .within(center: center, radius: rad, field: 'position');

the center is Milan, i've create other two point near Milan, the problem is that I have to increase the radius to 200km to get the marker out, when in reality they are at 2km and the other at 10km at most

Dabugger commented 3 years ago

Please use STRICT MODE = TRUE

geo.collection(collectionRef: collectionReference).within( center: center, radius: rad, field: 'position', strictMode: true);