﻿<link rel="import" href="../../polymer/polymer.html" />

<dom-module id="address-lookup-field">
    <template>
        <paper-input label="Search for an address" name="alfField" id="alfField" type="text" value="" required>
        <label>Search for an address</label>
    </template>
    <style>
    :host {
        
    }
    label {
        z-index: 1;
        width: 100%;
        pointer-events: none;
    }
    

    </style>

    <script>

        Polymer({
            is: "address-lookup-field",

            properties: {
                googleMapsKey: {
                    type: String
                },
                autoComplete: {
                    type: Object
                }
            },
            observers: [
  
            ],

            ready: function()
            {
                this.initAutoComplete();
            },

            initAutoComplete() {
                // Create the autocomplete object, restricting the search to geographical location types.
                var input = this.$.alfField.querySelector('input');
                this.autoComplete = new google.maps.places.Autocomplete(
                    input,
                    {
                        types: ['geocode']
                    }
                );

                this.autoComplete.addListener('place_changed', this.selectAddress.bind(this));
            },

            selectAddress: function () {
                var place = this.autoComplete.getPlace();
                this.dataHost.addressLookupLocation = place.geometry.location;
                this.fire('foundplace', place);
            }
        });
    </script>

</dom-module>
﻿<link rel="import" href="../../polymer/polymer.html" />

<dom-module id="address-lookup-field">
    <template>
        <paper-input label="Enter an address" name="alfField" id="alfField" type="text" value="" required>
        <label>Enter an address</label>
    </template>
    <style>
    :host {
        
    }
    label {
        z-index: 1;
        width: 100%;
        pointer-events: none;
    }
    

    </style>

    <script>

        Polymer({
            is: "address-lookup-field",

            properties: {
                googleMapsKey: {
                    type: String
                },
                autoComplete: {
                    type: Object
                }
            },
            observers: [
  
            ],

            ready: function()
            {
                this.initAutoComplete();
            },

            initAutoComplete() {
                // Create the autocomplete object, restricting the search to geographical location types.
                var input = this.$.alfField.querySelector('input');
                this.autoComplete = new google.maps.places.Autocomplete(
                    input,
                    {
                        types: ['geocode']
                    }
                );

                this.autoComplete.addListener('place_changed', this.selectAddress.bind(this));
            },

            selectAddress: function () {
                var place = this.autoComplete.getPlace();
                this.dataHost.addressLookupLocation = place.geometry.location;
                this.fire('foundplace', place);
            }
        });
    </script>

</dom-module>
Change map lookup address label
Change map lookup address label
