Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions google-map-marker.html
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
},

_clickEventsChanged: function() {
if (this.map) {
if (this.marker) {
if (this.clickEvents) {
this._forwardEvent('click');
this._forwardEvent('dblclick');
Expand All @@ -320,7 +320,7 @@
},

_dragEventsChanged: function() {
if (this.map) {
if (this.marker) {
if (this.dragEvents) {
this._forwardEvent('drag');
this._forwardEvent('dragend');
Expand All @@ -334,7 +334,7 @@
},

_mouseEventsChanged: function() {
if (this.map) {
if (this.marker) {
if (this.mouseEvents) {
this._forwardEvent('mousedown');
this._forwardEvent('mousemove');
Expand Down
52 changes: 52 additions & 0 deletions google-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,15 @@
},

/**
* Bounds of the map
*/
bounds: {
type: Object,
notify: true,
value: null
},

/**
* A kml file to load.
*/
kml: {
Expand Down Expand Up @@ -306,6 +315,15 @@
observer: '_disableStreetViewControlChanged'
},

/**
* If set, removes the map's 'fullscreen' UI controls.
*/
disableFullscreenControl: {
type: Boolean,
value: false,
observer: '_disableFullscreenControlChanged'
},

/**
* If set, the zoom level is set such that all markers (google-map-marker children) are brought into view.
*/
Expand Down Expand Up @@ -499,6 +517,7 @@
disableDefaultUI: this.disableDefaultUi,
mapTypeControl: !this.disableDefaultUi && !this.disableMapTypeControl,
streetViewControl: !this.disableDefaultUi && !this.disableStreetViewControl,
fullscreenControl: !this.disableDefaultUi && !this.disableFullscreenControl,
disableDoubleClickZoom: this.disableZoom,
scrollwheel: !this.disableZoom,
styles: this.styles,
Expand Down Expand Up @@ -625,9 +644,30 @@
if (this.fitToMarkers) { // we might not have a center if we are doing fit-to-markers
this._fitToMarkersChanged();
}

this.calcBounds();
}
},

calcBounds: function() {
var bounds = this.map.getBounds();
if (bounds) {
var ne = bounds.getNorthEast();
var sw = bounds.getSouthWest();
this.bounds = {
ne: {
lat: ne.lat(),
lng: ne.lng()
},
sw: {
lat: sw.lat(),
lng: sw.lng()
}
}
}
},


_loadKml: function() {
if (this.map && this.kml) {
var kmlfile = new google.maps.KmlLayer({
Expand Down Expand Up @@ -670,12 +710,14 @@
this.map.panTo(newCenter);
}
}
this.calcBounds();
}
},

_zoomChanged: function() {
if (this.map) {
this.map.setZoom(Number(this.zoom));
this.calcBounds();
}
},

Expand Down Expand Up @@ -768,6 +810,13 @@
this.map.setOptions({streetViewControl: !this.disableStreetViewControl});
},

_disableFullscreenControlChanged: function() {
if (!this.map) {
return;
}
this.map.setOptions({fullscreenControl: !this.disableFullscreenControl});
},

_disableZoomChanged: function() {
if (!this.map) {
return;
Expand Down Expand Up @@ -806,6 +855,7 @@
}

this.map.setCenter(latLngBounds.getCenter());
this.calcBounds();
}
},

Expand All @@ -814,10 +864,12 @@
var center = this.map.getCenter();
this.latitude = center.lat();
this.longitude = center.lng();
this.calcBounds();
}.bind(this));

google.maps.event.addListener(this.map, 'zoom_changed', function() {
this.zoom = this.map.getZoom();
this.calcBounds();
}.bind(this));

google.maps.event.addListener(this.map, 'maptypeid_changed', function() {
Expand Down