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 @@ -130,6 +130,7 @@ export class GeoFireCollectionRef<T> {
130130 opts = defaultOpts
131131 ) : Observable < ( GeoQueryDocument & T ) [ ] > {
132132 const precision = setPrecsion ( radius ) ;
133+ const radiusBuffer = radius * 1.02 ; // buffer for edge distances
133134 const centerHash = center . hash . substr ( 0 , precision ) ;
134135 const area = GeoFirePoint . neighbors ( centerHash ) . concat ( centerHash ) ;
135136
@@ -145,7 +146,7 @@ export class GeoFireCollectionRef<T> {
145146 . filter ( val => {
146147 const lat = val [ field ] . geopoint . latitude ;
147148 const lng = val [ field ] . geopoint . longitude ;
148- return center . distance ( lat , lng ) <= radius * 1.02 ; // buffer for edge distances ;
149+ return center . distance ( lat , lng ) <= radiusBuffer ;
149150 } )
150151
151152 . map ( val => {
You can’t perform that action at this time.
0 commit comments