Skip to content

Commit

Permalink
Merge pull request #17 from PolymerLabs/updatemarkeloc
Browse files Browse the repository at this point in the history
Update marker position when lat/lng change
  • Loading branch information
ebidel committed Jun 5, 2014
2 parents 77e31c7 + b16e558 commit c4a3a8f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions google-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@
latitude: {value: null, reflect: true}
},

observe: {
latitude: 'updatePosition',
longitude: 'updatePosition',
},

updatePosition: function() {
if (this.marker && this.latitude != null && this.longitude != null) {
this.marker.setPosition({lat: this.latitude, lng: this.longitude});
}
},

iconChanged: function() {
if (this.marker) {
this.marker.setIcon(this.icon);
Expand Down

0 comments on commit c4a3a8f

Please sign in to comment.