Weights
Use weights when getting a middleground to bias one location over another
Location weights give you fine control over where the search centre is placed when multiple users are involved. Think of weights as "voting power" - higher weights pull the search centre closer to that location.
How weights work
Weights range from 0 to 100 and represent the relative importance of each location:
- Default weight: 50 (equal influence)
- Higher weight: More influence on search centre placement
- Lower weight: Less influence on search centre placement
Basic examples
Equal weighting (default)
When all locations have the same weight, the search centre is the geometric midpoint.
Unequal weighting
When one location has higher weight, the search centre moves closer to it.
In this case, the second location has more influence, so venues will be found closer to it.
Real-world scenarios
Flexible vs. inflexible users
Some users may be more willing to travel further than others.
The first location gets a weight of 25 (more flexible), while the second gets 75 (prefers convenience). The search centre will be much closer to the second location.
Group dynamics
Consider travel preferences, time constraints, or seniority in group decisions.
The first and second locations have equal weight (40), while the third has less influence (20).
Accessibility considerations
Users with mobility challenges may need venues closer to them.
Let's say the first location is a wheelchair user and the second is an able-bodied user. The first location gets a weight of 80, while the second gets 20. The search centre will be much closer to the first location. In this case, you would also want to set the maxDistance
to a lower value to ensure the search centre is within an accessible distance and that accessibility options are provided in preferences
.
Weight calculation examples
Two locations
- Location 1: weight 30
- Location 2: weight 70
- Total weight: 100
- Location 1's influence: 30/100 = 30%
- Location 2's influence: 70/100 = 70%
Three locations
- Location 1: weight 20
- Location 2: weight 30
- Location 3: weight 50
- Total weight: 100
- Location 1's influence: 20/100 = 20%
- Location 2's influence: 30/100 = 30%
- Location 3's influence: 50/100 = 50%
Forcing a location
- Location 1: weight 50
- Location 2: weight 50
- Location 3: weight 100
- Total weight: 200
- Location 1's influence: 50/100 = 50%
- Location 2's influence: 50/100 = 50%
- Location 3's influence: 100/100 = 100% -
overriding the other two locations
Best practice
- Start with equal weights (50) and adjust based on needs
- Use meaningful weight differences - small differences (45 vs 55) have minimal impact
- Consider user experience - extreme weights (10 vs 90) can make one user feel ignored
- Test with real scenarios - weights affect travel times and user satisfaction
- Document your weighting logic - explain to users why certain locations have more influence