removeLocation method

Future removeLocation(
  1. String documentID,
  2. GeoPoint location
)

Removes the location of a document for the given documentID.

Implementation

Future<dynamic> removeLocation(String documentID, GeoPoint location) async {
  //Get the DocumentReference for this documentID
  var docRef = this.collectionReference.doc(documentID);
  //Create a Map with the fields to add
  var updates = Map<String, dynamic>();
  updates['g'] = null;
  updates['l'] = null;
  //Update the DocumentReference with the location data
  await docRef.set(updates, SetOptions(merge: true));
}