Skip to content

Commit

Permalink
observe 'query' property changes and call search()
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiefu committed Apr 7, 2014
1 parent 99cd57d commit f1826f5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions google-map-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<polymer-element name="google-map-search" attributes="query result map">
<script>
Polymer('google-map-search', {
result: {
latitude: '37.77493',
longitude: '-122.41942',
show: false
observe: {
query: 'search'
},
search: function() {
var places = new google.maps.places.PlacesService(this.map);
places.textSearch({query: this.query}, this.gotResults.bind(this));
if (this.query && this.map) {
var places = new google.maps.places.PlacesService(this.map);
places.textSearch({query: this.query}, this.gotResults.bind(this));
}
},
gotResults: function(results, status) {
this.result = {
Expand Down

0 comments on commit f1826f5

Please sign in to comment.