(function() {
var widget, initAddressFinder = function() {
widget = new AddressFinder.Widget(
document.getElementById(''),
'ADDRESSFINDER_DEMO_KEY',
'NZ', {
"address_params": {},
"show_locations": true
}
);
widget.on('address:select', function(fullAddress, metaData) {
document.getElementById('').value = fullAddress;
});
widget.on('location:select', function(fullLocation, metaData) {
document.getElementById('').value = metaData.a;
});
};
function downloadAddressFinder() {
var script = document.createElement('script');
script.src = 'https://api.addressfinder.io/assets/v3/widget.js';
script.async = true;
script.onload = initAddressFinder;
document.body.appendChild(script);
};
document.addEventListener('DOMContentLoaded', downloadAddressFinder);
})();