Skip to content

Commit

Permalink
Merge pull request #256 from mmm2a/master
Browse files Browse the repository at this point in the history
Minor code fixes to make the javascript compile correctly in Google Closure environments.
  • Loading branch information
ebidel committed Feb 3, 2016
2 parents 5180181 + 0716f1b commit 99c72bb
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 11 deletions.
8 changes: 6 additions & 2 deletions google-map-directions.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@
Fired whenever the directions service returns a result.
@event google-map-response
@param {{response: Object}}} detail
@param {{response: Object}} detail
*/

/**
* Polymer properties for the google-map-directions custom element.
*/
properties: {
/**
* A Maps API key. To obtain an API key, see developers.google.com/maps/documentation/javascript/tutorial#api_key.
Expand Down Expand Up @@ -100,7 +104,7 @@
* plus the origin, and destination.
* Waypoints are not supported for transit directions. Optional.
*
* @type google.maps.DirectionsWaypoint
* @type Array<google.maps.DirectionsWaypoint>
*/
waypoints: {
type: Array,
Expand Down
1 change: 0 additions & 1 deletion google-map-elements.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<link rel="import" href="google-map.html">
<link rel="import" href="google-map-marker.html">
<link rel="import" href="google-map-marker.html">
<link rel="import" href="google-map-directions.html">
<link rel="import" href="google-map-search.html">
<link rel="import" href="google-map-point.html">
Expand Down
9 changes: 4 additions & 5 deletions google-map-marker.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@

/**
* A Google Map Infowindow object.
* @type {?Object}
*/
info: {
type: Object,
Expand Down Expand Up @@ -274,10 +275,8 @@

_updatePosition: function() {
if (this.marker && this.latitude != null && this.longitude != null) {
this.marker.setPosition({
lat: parseFloat(this.latitude),
lng: parseFloat(this.longitude)
});
this.marker.setPosition(new google.maps.LatLng(
parseFloat(this.latitude), parseFloat(this.longitude)));
}
},

Expand Down Expand Up @@ -439,7 +438,7 @@
}.bind(this));
},

attributeChanged: function(attrName, oldVal, newVal) {
attributeChanged: function(attrName) {
if (!this.marker) {
return;
}
Expand Down
10 changes: 8 additions & 2 deletions google-map-poly.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
</dom-module>

<script>
(function() {
Polymer({
is: 'google-map-poly',

Expand Down Expand Up @@ -116,10 +117,14 @@
* @event google-map-poly-rightclick
* @param {google.maps.PolyMouseEvent} event The poly event.
*/

/**
* Polymer properties for the google-map-poly element.
*/
properties: {
/**
* A Google Maps polyline or polygon object (depending on value of "closed" attribute).
* @type google.maps.Polyline|google.maps.Polygon
* @type {google.maps.Polyline|google.maps.Polygon}
*/
poly: {
type: Object,
Expand Down Expand Up @@ -324,7 +329,7 @@

// Attribute/property change watchers.

attributeChanged: function(attrName, oldVal, newVal) {
attributeChanged: function(attrName) {
if (!this.poly) {
return;
}
Expand Down Expand Up @@ -558,4 +563,5 @@
this._points[index].longitude = vertex.lng();
}
});
})();
</script>
1 change: 1 addition & 0 deletions google-map-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ <h2>{{marker.name}}</h2>

/**
* The Google map object.
* @type google.maps.Map
*/
map: {
type: Object,
Expand Down
6 changes: 5 additions & 1 deletion google-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@
* @event google-map-rightclick
* @param {google.maps.MouseEvent} event The mouse event.
*/

/**
* Polymer properties for the google-map custom element.
*/
properties: {
/**
* A Maps API key. To obtain an API key, see developers.google.com/maps/documentation/javascript/tutorial#api_key.
Expand Down Expand Up @@ -688,7 +692,7 @@
});
},

attributeChanged: function(attrName, oldVal, newVal) {
attributeChanged: function(attrName) {
if (!this.map) {
return;
}
Expand Down

0 comments on commit 99c72bb

Please sign in to comment.