InBe Docs

Locations

This object enables you to define one to many locations. Depending on the properties you provide, you can find locations at a single point, along a path, or between points

The locations array is the foundation of every search request. It defines where to search from and can represent anything from a single user's location to complex multi-user scenarios with custom weighting. Locations don't always have to be a person, they can be places like locations along an itinerary.

Basic structure

Single location search
const :  = {
  locations: [{ : 51.5072, : -0.1276 }],
locations: {
    lat: number;
    lon: number;
    label?: string;
    weight?: number;
}[]
};

Mode

Mode should always be provided. It allows you to specify the type of search you want to perform and the distance you want to search. See Mode for more information.

Properties

lat (required)

Latitude coordinate between -90 and 90. Use decimal degrees (e.g., 51.5072 for London).

lon (required)

Longitude coordinate between -180 and 180. Use decimal degrees (e.g., -0.1276 for London).

weight (optional)

Relative importance of this location (0-100). Defaults to 50. Higher weights pull the search centre closer.

user (optional)

Human-readable identifier for this location. Useful for multi-user scenarios and result interpretation.

Search scenarios

The simplest case - find venues near one person.

Single user
  : [{ : 51.5072, : -0.1276 }],
  : { : "POINT", : 500 },
 

Two-person meetup

Find the perfect spot between two people. InBe automatically calculates the midpoint.

Two-person meetup
  : [
    { : 51.5072, : -0.1276 },
    { : 51.5154, : -0.1419 },
  ],
  : { : "POINT", : 500 },
 

Group meeting with weighting

When some people are more flexible about travel distance, use weights to bias the search centre.

Group with weighting
  : [
    { : 51.5072, : -0.1276, : 30 },
    { : 51.5154, : -0.1419, : 40 }, 
    { : 51.5034, : -0.1195, : 30 },
  ],
  : { : "POINT", : 500 },
 

In this example, the second user's location has higher weight (40), so the search centre will be closer to them.

Defining a meeting point yourself

When you want to define a meeting point yourself, set the location weight you want to meet to 100.

Meeting point
  : [
    { : 51.5072, : -0.1276, : 30 },
    { : 51.5154, : -0.1419, : 40 },
    { : 51.5034, : -0.1195, : 30 },
    { : 51.5034, : -0.1195, : 100 }, 
  ],
  : { : "POINT", : 500 },
 

For travel apps, provide multiple waypoints to find venues along a route.

Path search
  : [
    { : 51.5072, : -0.1276 },
    { : 51.5154, : -0.1419 },
    { : 51.5034, : -0.1195 },
  ],
  : { : "PATH", : 500 },
 

Weighting explained

Weights control how much influence each location has on the search centre:

  • Equal weights (default): Search centre is the geometric midpoint
  • Higher weight: Pulls the search centre closer to that location
  • Lower weight: Reduces that location's influence
Weighting examples
  : [
    { : 51.5072, : -0.1276, : 20 }, // Less Influence
    { : 51.5154, : -0.1419, : 80 }, // More Influence
  ],
  : { : "POINT", : 500 },
 

Best practice

  • Always provide at least one location - we require this
  • Consider weights carefully - they affect user experience significantly
  • Validate coordinates - ensure lat/lon are within valid ranges

Coordinate precision

InBe accepts coordinates with up to 18 decimal places, providing metre-level precision:

High precision coordinates
  : [{ : 51.47388445543705, : -0.05767436098651599 }], // High precision
 

Next steps

On this page