Bias By Geolocation
Bias search to a geospatial circle determined by an origin and radius in meters. Max radius is 50000
.
Uses the format bias_lonlat=[longitude],[latitude],[radius in metres]
. Only one geospatial bias may be provided
In the example below, a geolocation bias is set to prioritize addresses near "10 Downing St".
- JavaScript
- HTML
AddressFinder.setup({
apiKey: "ak_test",
queryOptions: {
// Set geolocation bias to 10 Downing St
bias_lonlat: "-0.1276,51.5034,100"
},
line_1: "#line_1",
line_2: "#line_2",
line_3: "#line_3",
post_town: "#post_town",
postcode: "#postcode"
}
});
<form style="max-width: 450px; padding: 10px;">
<h1>Address Form</h1>
<label for="line_1">Address First Line</label>
<input type="text" id="line_1" />
<label for="line_2">Address Second Line</label>
<input type="text" id="line_2" />
<label for="line_3">Address Third Line</label>
<input type="text" id="line_3" />
<label for="post_town">Town or City</label>
<input type="text" id="post_town" />
<label for="postcode">Postcode</label>
<input type="text" id="postcode" />
</form>
Live Demo
Loading...