Skip to content

Commit e7ae646

Browse files
committed
minor updates for publish
1 parent ec78ee9 commit e7ae646

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+865
-17499
lines changed

README.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
# GeoFireX
1010

11-
Realtime Geolocation with Firestore & RxJS. Runs on the Web and Node.js.
11+
Realtime Geolocation with Firestore & RxJS. Query geographic points within a radius on the web or Node.js.
1212

13-
:point_right: [Live Demo](https://geo-test-c92e4.firebaseapp.com)
14-
:tv: [Video Tutorial](https://angularfirebase.com/lessons/geolocation-query-in-firestore-realtime/)
13+
- :point_right: [Live Demo](https://geo-test-c92e4.firebaseapp.com)
14+
- :tv: [Video Tutorial](https://angularfirebase.com/lessons/geolocation-query-in-firestore-realtime/)
1515

1616
## :zap: QuickStart
1717

@@ -21,7 +21,7 @@ npm install geofirex rxjs firebase
2121

2222
### Initialize
2323

24-
The library is a lightweight client for the Firebase Web SDK that provides tools for wrangling geolocation data in Firestore. You need a [Firebase project](https://firebase.google.com/docs/storage/web/start) to get started.
24+
The library is a lightweight extension for the Firebase Web and Admin JavaScript SDKs to provide tools for wrangling geolocation data in Firestore.
2525

2626
Web:
2727

@@ -78,11 +78,11 @@ const field = 'position';
7878
const query = cities.within(center, radius, field);
7979
```
8080

81-
The query returns a realtime Observable of the document data, plus some useful metadata like _distance_ and _bearing_ from the query centerpoint.
81+
Each hit returns a realtime Observable of the document data, plus some useful `hitMetadata` like _distance_ and _bearing_ from the query centerpoint.
8282

8383
```ts
8484
query.subscribe(console.log);
85-
// [{ ...documentData, queryMetadata: { distance: 1.23232, bearing: 230.23 } }]
85+
// [{ ...documentData, hitMetadata: { distance: 1.23232, bearing: 230.23 } }]
8686
```
8787

8888
You now have a realtime stream of data to visualize on a map.
@@ -98,26 +98,29 @@ Creates reference to a Firestore collection or query that can be used to make ge
9898
Example:
9999

100100
```ts
101-
const ref = geo.query('cities');
101+
const geoQuery = geo.query('cities');
102102

103103
// OR make a geoquery on top of a firestore query
104104

105105
const query = firestore().collection('cities').where('name', '==', 'Phoenix');
106-
const geoRef = geo.query(query);
106+
const geoQuery = geo.query(query);
107107
```
108108

109-
#### Performing Geo-Queries
109+
#### Perform Geo-Queries
110110

111-
`collection.within(center: GeoFirePoint, radius: number, field: string)`
111+
```js
112+
geoQuery.within(center: FirePoint, radius: number, field: string)
113+
.subscribe((hits) => console.log((hits)))
114+
```
112115

113116
Query the parent Firestore collection by geographic distance. It will return documents that exist within X kilometers of the centerpoint.
114117

115-
Each doc also contains returns _distance_ and _bearing_ calculated on the query on the `queryMetadata` property.
118+
Each doc also contains returns _distance_ and _bearing_ calculated on the query on the `hitMetadata` property.
116119

117-
**Returns:** `Observable<object[]>`
120+
**Returns:** `Observable<T[]>`
118121

119122

120-
### `point(latitude: number, longitude: number)`
123+
### `point(latitude: number, longitude: number): FirePoint`
121124

122125
Returns an object with the required geohash format to save to Firestore.
123126

@@ -129,7 +132,7 @@ A point is a plain JS object with two properties.
129132
- `point.geopoint` Returns a Firestore GeoPoint
130133

131134

132-
## :pizza: Additional Features
135+
## Additional Features
133136

134137
The goal of this package is to facilitate rapid feature development with tools like MapBox, Google Maps, and D3.js. If you have an idea for a useful feature, open an issue.
135138

@@ -147,7 +150,7 @@ ref.within(center, radius, field, { log: true })
147150

148151
Convenience methods for calculating distance and bearing.
149152

150-
- `geo.distance(to, from)` Haversine distance
153+
- `geo.distance(geo.point(38, -118), geo.point(40, -115))` Haversine distance
151154
- `geo.bearing(to, from)` Haversine bearing
152155

153156
### `toGeoJSON` Operator
@@ -179,7 +182,7 @@ async function getCars {
179182
}
180183
```
181184

182-
## :zap: Tips
185+
## Tips
183186

184187
### Compound Queries
185188

integration/.editorconfig

Lines changed: 0 additions & 13 deletions
This file was deleted.

integration/.firebaserc

Lines changed: 0 additions & 5 deletions
This file was deleted.

integration/.gitignore

Lines changed: 0 additions & 39 deletions
This file was deleted.

integration/README.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

integration/angular.json

Lines changed: 0 additions & 129 deletions
This file was deleted.

integration/firebase.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)