Giter Site home page Giter Site logo

koada-os / paper-input-location Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 3.0 11 KB

A Material Design input with location autocomplete (Polymer 1.x)

Home Page: https://www.webcomponents.org/element/MacTheZazou/paper-input-location

License: Apache License 2.0

HTML 100.00%
polymer material polymer-element paper location-autocomplete

paper-input-location's Introduction

Published on webcomponents.org

##<paper-input-location>

Material design: Text fields with location autocomplete

<paper-input-location> is a single-line text field with Material Design styling and location autocomplete based on the Google Maps API.

Example:

<paper-input-location maps-api-key="AIzaSyD3E1D9b-Z7ekrT3tbhl_dy8DCXuIuDDRc" label="Place"></paper-input-location>

paper-input-location's People

Contributors

macthezazou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

paper-input-location's Issues

paper-input is created disabled

After adding the paper-input-location element, the internal paper-input appears with the disabled attribute by default. If I remove that attribute using the dev tools, the paper-input is enabled and the autocomplete works normally with google api.

Paper input is not a HTMLElement

For some reason this component is not working and shows in the console that it needs a html element.

_onApiLoad: function() {
var rawInput;

        if (this.$.inputPaper.querySelector('input')) {
            rawInput = this.$.inputPaper.querySelector('input');
        } else {
            rawInput = this.$.inputPaper.root.querySelector('input');
        }

        this.autocomplete = new google.maps.places.Autocomplete(rawInput, this.options);
        google.maps.event.addListener(this.autocomplete, 'place_changed', this._onChangePlace.bind(this));
    },

Changing the query selector to select the input element works.

PS: Sorry my explanation is terrible.

locationName not working

locationName was not working for me. I managed to solve it by handling the event 'place-changed'. However I've had also to change your code. Just put the line "this.fire('place-changed');" from the function "_onChangePlace"at the bottom of the function, and bum! working!

Nice element, good job!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.