Skip to content

Commit dde973b

Browse files
committed
Merge pull request GoogleWebComponents#117 from r2fresh/language-attribute-add
google-map-directions and google-map add language attribute("language")
2 parents 16ac9a4 + 6d194d5 commit dde973b

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

demo.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@
1717
</head>
1818
<body fullbleed unresolved>
1919

20-
<google-map latitude="37.779" longitude="-122.3892" minZoom="9" maxZoom="11" fit>
20+
<google-map latitude="37.779" longitude="-122.3892" minZoom="9" maxZoom="11" language="en" fit>
2121
<google-map-marker latitude="37.779" longitude="-122.3892"
2222
title="Go Giants!" draggable="true">
2323
<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/49/San_Francisco_Giants_Cap_Insignia.svg/200px-San_Francisco_Giants_Cap_Insignia.svg.png" />
2424
</google-map-marker>
2525
</google-map>
2626

27-
<google-map-directions startAddress="San Francisco" endAddress="Mountain View"></google-map-directions>
27+
<google-map-directions startAddress="San Francisco" endAddress="Mountain View" language=
28+
"en"></google-map-directions>
2829

2930
<button id="controlsToggle" onclick="toggleControls()">Toggle controls</button>
3031

google-map-directions.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434
@param {object} detail.response The directions service response.
3535
-->
3636

37-
<polymer-element name="google-map-directions" attributes="map startAddress endAddress travelMode response libraries">
37+
<polymer-element name="google-map-directions" attributes="map startAddress endAddress travelMode response libraries language">
3838
<template>
3939
<style>
4040
:host {
4141
display: none;
4242
}
4343
</style>
44-
<google-maps-api on-api-load="{{mapApiLoaded}}" libraries="{{libraries}}"></google-maps-api>
44+
<google-maps-api on-api-load="{{mapApiLoaded}}" libraries="{{libraries}}" language="{{language}}"></google-maps-api>
4545
</template>
4646
<script>
4747
Polymer({
@@ -97,6 +97,19 @@
9797
*/
9898
libraries: "places",
9999

100+
/**
101+
* The localized language to load the Maps API with. For more information
102+
* see https://developers.google.com/maps/documentation/javascript/basics#Language
103+
*
104+
* Note: the Maps API defaults to the preffered language setting of the browser.
105+
* Use this parameter to override that behavior.
106+
*
107+
* @attribute language
108+
* @type string
109+
* @default null
110+
*/
111+
language: null,
112+
100113
/**
101114
* The response from the directions service.
102115
*

google-map.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@
491491
- Handle removals and support .innerHTML = ''.
492492
- Use <google-maps-api>.api instead of google.maps namespace.
493493
-->
494-
<polymer-element name="google-map" attributes="apiKey clientId latitude longitude zoom noAutoTilt showCenterMarker version map mapType disableDefaultUI fitToMarkers zoomable styles maxZoom minZoom libraries signedIn clickEvents dragEvents mouseEvents">
494+
<polymer-element name="google-map" attributes="apiKey clientId latitude longitude zoom noAutoTilt showCenterMarker version map mapType disableDefaultUI fitToMarkers zoomable styles maxZoom minZoom libraries signedIn clickEvents dragEvents mouseEvents language">
495495
<template>
496496

497497
<style>
@@ -512,7 +512,7 @@
512512

513513
</style>
514514

515-
<google-maps-api apiKey="{{apiKey}}" clientId="{{clientId}}" version="{{version}}" on-api-load="{{mapApiLoaded}}" libraries="{{libraries}}" signedIn="{{signedIn}}"></google-maps-api>
515+
<google-maps-api apiKey="{{apiKey}}" clientId="{{clientId}}" version="{{version}}" on-api-load="{{mapApiLoaded}}" libraries="{{libraries}}" signedIn="{{signedIn}}" language="{{language}}"></google-maps-api>
516516

517517
<div id="map"></div>
518518

@@ -679,6 +679,19 @@
679679
*/
680680
signedIn: false,
681681

682+
/**
683+
* The localized language to load the Maps API with. For more information
684+
* see https://developers.google.com/maps/documentation/javascript/basics#Language
685+
*
686+
* Note: the Maps API defaults to the preffered language setting of the browser.
687+
* Use this parameter to override that behavior.
688+
*
689+
* @attribute language
690+
* @type string
691+
* @default null
692+
*/
693+
language: null,
694+
682695
/**
683696
* When true, map *click events are automatically registered.
684697
*

0 commit comments

Comments
 (0)