SearchLocations
Locations
The locations array tells search where people are. Use one location or many, as coordinates or place names, with optional weighting.
locations is a required array of one or more objects. What InBe does with them depends on the mode:
POINT: InBe works out a weighted midpoint of all the locations and searches around it.PATH: InBe draws a route through the locations, in the order you send them, and searches along it. This needs at least two locations.
Location object
Prop
Type
Each location needs either lat + lon or locationName.
Examples
{
"locations": [{ "lat": 51.5081, "lon": -0.1278 }],
"mode": { "mode": "POINT", "maxDistance": 500 }
}{
"locations": [
{ "lat": 51.5072, "lon": -0.1276 },
{ "lat": 51.5154, "lon": -0.1419 }
],
"mode": { "mode": "POINT", "maxDistance": 750 }
}{
"locations": [
{ "lat": 51.5072, "lon": -0.1276, "weight": 50 },
{ "lat": 51.5154, "lon": -0.1419, "weight": 30 },
{ "lat": 51.5034, "lon": -0.1195 }
],
"mode": { "mode": "POINT", "maxDistance": 1000 }
}{
"locations": [
{ "locationName": "King's Cross Station, London" },
{ "locationName": "Clapham Common, London" }
],
"mode": { "mode": "POINT", "maxDistance": 1000 }
}{
"locations": [
{ "lat": 51.5007, "lon": -0.1246 },
{ "lat": 51.5045, "lon": -0.0865 },
{ "lat": 51.5081, "lon": -0.0759 }
],
"mode": { "mode": "PATH", "maxDistance": 150 }
}In the weighted group example, the first two people have 80% of the influence between them, so the third person gets the remaining 20%. See Weights for the full rules.
Choosing a meeting point yourself
To search around a specific place, such as a venue a group has already chosen, send it as the only location. Alternatively, give it a weight of 100 alongside everyone else's location.
{
"locations": [
{ "lat": 51.5072, "lon": -0.1276 },
{ "lat": 51.5154, "lon": -0.1419 },
{ "locationName": "Leicester Square, London", "weight": 100 }
],
"mode": { "mode": "POINT", "maxDistance": 400 }
}Things to know
- Coordinates are WGS84 decimal degrees, the same as GPS and most map SDKs. Five decimal places (about 1 m) is plenty.
0, 0counts as no location. A location withlat: 0andlon: 0is ignored when working out the midpoint.- The midpoint is returned as
centerPointin the response, so you can show it on a map. - Order matters only in
PATHmode, where it sets the route.