GeoFlutterFire icon indicating copy to clipboard operation
GeoFlutterFire copied to clipboard

Wrong distance radius

Open stoppiNeobiz opened this issue 5 years ago • 1 comments

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

stoppiNeobiz avatar Jan 08 '20 09:01 stoppiNeobiz

Please use STRICT MODE = TRUE

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

Dabugger avatar Jun 03 '21 01:06 Dabugger