[Fixed]-Google Polymer: google-map-search doesn't work

1👍

There are a couple of issues here:

  1. Yes, the [[]] brackets are the problem here because they enforce one-way binding. That means that the results from the google-map-search can’t propagate upwards and the labels are empty. You need to change the results=[[results]] to results={{results}} to enable two-way binding
  2. For declerative event handlers, you don’t need any brackets. So this line <paper-button on-tap="[[upload]]">Accept</paper-button> should be ?<paper-button on-tap="upload">Accept</paper-button>
  3. To access sub-properties of an data bound object you need to use dot notation (.). This line <label>coords:[[ results::lat ]], [[ results::lon ]]</label> should be changed to <label>coords:[[ results.lat ]], [[ results.lon ]]</label>
  4. I would also change lat and lon to computed properties which either return default values (alternatively just use attributes on your google-map element for that) or the values from your search result.

Leave a comment