File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ export class GeoFireCollectionRef {
122122 opts = defaultOpts
123123 ) : Observable < GeoQueryDocument [ ] > {
124124 const precision = setPrecsion ( radius ) ;
125+ const radiusBuffer = radius * 1.02 ; // buffer for edge distances
125126 const centerHash = center . hash . substr ( 0 , precision ) ;
126127 const area = GeoFirePoint . neighbors ( centerHash ) . concat ( centerHash ) ;
127128
@@ -137,7 +138,7 @@ export class GeoFireCollectionRef {
137138 . filter ( val => {
138139 const lat = val [ field ] . geopoint . latitude ;
139140 const lng = val [ field ] . geopoint . longitude ;
140- return center . distance ( lat , lng ) <= radius * 1.02 ; // buffer for edge distances ;
141+ return center . distance ( lat , lng ) <= radiusBuffer ;
141142 } )
142143
143144 . map ( val => {
You can’t perform that action at this time.
0 commit comments