All default values of Jawg Places library
Estimated reading time: 1 minuteThis example shows default values of JawgPlaces.Input
and initialize a Jawg Places Input inside an HTML element on a webpage. It will transform the <input>
with the id my-input
into a geocoding search bar using Jawg Places API.
Checkout all common options available on Jawg Places JS: JawgPlaces.JawgPlacesInputOptions.
The value <YOUR_ACCESS_TOKEN>
in the <script>
tag must be replaced by your own access token from the Jawg Lab.
In this sample, you will see all default values of the library.
<html>
<head>
<script src="https://api.jawg.io/libraries/jawg-places@latest/jawg-places.js?access-token=<YOUR_ACCESS_TOKEN>"></script>
</head>
<body>
<input id="my-input" type="text" placeholder="Search" />
<script>
new JawgPlaces.Input({
input: '#my-input',
language: undefined,
searchOnTyping: false,
debounceDealy: 350,
minLength: 0,
layers: undefined,
sources: undefined,
// deprecated
focusPoint: undefined,
focus: {
countries: undefined,
gids: undefined,
point: undefined,
},
boundary: {
countries: undefined,
circle: undefined,
gids: undefined,
rectangle: undefined,
},
showResultIcons: false,
clearCross: false,
size: 10,
reverse: false,
onFeatures: (features) => {},
onClose: () => {},
onClick: (feature) => {},
onError: (error) => {},
onClear: () => {},
});
</script>
</body>
</html>