Skip to content

Commit

Permalink
fixup initialization issues
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiefu committed Apr 8, 2014
1 parent 42464b0 commit 803857a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion google-map-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<script>
Polymer('google-map-search', {
observe: {
query: 'search'
query: 'search',
map: 'search'
},
search: function() {
if (this.query && this.map) {
Expand Down
9 changes: 6 additions & 3 deletions google-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
longitude: '-122.41942',
zoom: 10,
showCenterMarker: false,
mapType: '', // roadmap, satellite, hybrid, terrain
mapType: 'roadmap', // roadmap, satellite, hybrid, terrain
version: '3.exp',
sensor: false,
observe: {
Expand All @@ -81,14 +81,17 @@
ready: function() {
loadMapApi(this.mapReady.bind(this), this.version, this.sensor);
},
enteredView: function() {
attached: function() {
this.resize();
},
mapReady: function() {
this.map = new google.maps.Map(this.$.map, {
zoom: this.zoom,
center: new google.maps.LatLng(this.latitude, this.longitude)
mapTypeId: this.mapType
});
if (this.latitude && this.longitude) {
this.updateCenter();
}
this.showCenterMarkerChanged();
this.fire('google-map-ready');
},
Expand Down

0 comments on commit 803857a

Please sign in to comment.