Skip to content

Commit 37456de

Browse files
committed
Merge pull request #30 from GoogleWebComponents/addlang
Add langugage param
2 parents 971d5c6 + 8bba0dd commit 37456de

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

google-maps-api.html

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
@event api-load
3737
-->
3838

39-
<polymer-element name="google-maps-api" extends="core-shared-lib" attributes="version apiKey clientId libraries">
39+
<polymer-element name="google-maps-api" extends="core-shared-lib" attributes="version apiKey clientId libraries language">
4040
<script>
4141

4242
Polymer({
@@ -79,17 +79,37 @@
7979
*/
8080
version: '3.exp',
8181

82+
/**
83+
* The localized language to load the Maps API with. For more information
84+
* see https://developers.google.com/maps/documentation/javascript/basics#Language
85+
*
86+
* Note: the Maps API defaults to the preffered language setting of the browser.
87+
* Use this parameter to override that behavior.
88+
*
89+
* @attribute language
90+
* @type string
91+
* @default null
92+
*/
93+
language: null,
94+
8295
notifyEvent: 'api-load',
8396

8497
ready: function() {
8598
var url = this.defaultUrl + '&v=' + this.version;
8699
url += "&libraries=" + this.libraries;
100+
87101
if (this.apiKey && !this.clientId) {
88102
url += '&key=' + this.apiKey;
89103
}
104+
90105
if (this.clientId) {
91106
url += '&client=' + this.clientId;
92107
}
108+
109+
if (this.language) {
110+
url += '&language=' + this.language;
111+
}
112+
93113
this.url = url;
94114
},
95115

0 commit comments

Comments
 (0)