dhirunand
dhirunand

Reputation: 41

Firebase Firestore geopoint range issue: Must be between -180 and 180

i'm using firebase firestore database and trying to insert geopoint of any place in india the problem is while inserting the longitude console gives red warning: Must be between -180 and 180 enter image description here

Upvotes: 0

Views: 363

Answers (1)

Emmanuel
Emmanuel

Reputation: 1494

According to the documentation the GeoPoint requires:

Latitude values in the range of [-90, 90]. Longitude values in the range of [-180, 180].

Which according to the Wikipedia entry matches the values:

Longitude is given as an angular measurement ranging from 0° at the Prime Meridian to +180° eastward and −180° westward.

With that said the documentation actually suggests to avoid this type and go for separate numeric fields due to limitations on queries, and suggests Geo queries for simple distance-based apps.

Upvotes: 0

Related Questions