Select delivery address

In this example, an address will be selected and the fields below it will be filled with the address information.

Example: Select delivery address

Codeexample: Select delivery address

<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Example | Select delivery address</title>
	:root {
		--smartmaps-boxshadow: 0 0 0 rgba(0, 0, 0, 0);
    <div class="container">
        <div class="row">
            <div class="col">
                    <input id="ac" class="sm-search" type="search" placeholder="Adresse suchen" value="" style="width: 400px;">
                    <div class="input-group input-group-sm mb-3">
                        <span class="input-group-text">Straße</span>
                        <input id="street" class="form-control">
                        <span class="input-group-text">Hausnummer</span>
                        <input id="houseNo" class="form-control">
                    <div class="input-group input-group-sm mb-3">
                        <span class="input-group-text">PLZ</span>
                        <input id="zip" class="form-control" >
                        <span class="input-group-text">Stadt</span>
                        <input id="city" class="form-control">
                    <div class="input-group input-group-sm mb-3">
                        <span class="input-group-text">Bundesland</span>
                        <input id="state" class="form-control">
                        <span class="input-group-text">Land</span>
                        <input id="country" class="form-control">

        ym.ready({ autocomplete: 5 }, function (modules) {
            var autoComplete = modules.autoComplete('#ac', {
                isoCountries: [],
                includeFilters: {
                    street: true
                dataType: 'json'

            autoComplete.on('selected', function (geojson, address, query) {
                document.getElementById("street").value = address.street ? address.street : "" ;
                document.getElementById("houseNo").value = address.houseNo? address.houseNo: "";
                document.getElementById("zip").value = "";
                document.getElementById("city").value = "";
                document.getElementById("country").value = address.countryLongName? address.countryLongName: "";
                document.getElementById("state").value = address.state? address.state: "";