Skip to content

Commit

Permalink
Adds a libraries attr to directions.
Browse files Browse the repository at this point in the history
This is so the map and directions elements can share the same API library load
  • Loading branch information
ebidel committed Sep 26, 2014
1 parent 8c161f9 commit c31fcb0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
20 changes: 17 additions & 3 deletions google-map-directions.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
@param {object} detail.response The directions service response.
-->

<polymer-element name="google-map-directions" attributes="map startAddress endAddress travelMode response">
<polymer-element name="google-map-directions" attributes="map startAddress endAddress travelMode response libraries">
<template>
<style>
:host {
display: none;
}
</style>
<google-maps-api on-api-load="{{mapApiLoaded}}"></google-maps-api>
<google-maps-api on-api-load="{{mapApiLoaded}}" libraries="{{libraries}}"></google-maps-api>
</template>
<script>
Polymer('google-map-directions', {
Polymer({

/**
* The Google map object.
Expand Down Expand Up @@ -82,6 +82,20 @@
*/
travelMode: 'DRIVING',

/**
* The libraries to load with this map. Defaults to "places". For more information
* see https://developers.google.com/maps/documentation/javascript/libraries.
*
* Note, this needs to be set to the same value as the one used on <google-map>.
* If you're overriding that element's `libraries` property, this one also
* needs to be set to the Maps API loads the library code.

This comment has been minimized.

Copy link
@addyosmani

addyosmani Sep 27, 2014

Member

Include an example of specifying more than one library in case folks don't remember to check out the library docs page (e.g 'should that be a comma-separated list? space separated?'). Here we should be fine with just places,geometry

This comment has been minimized.

Copy link
@ebidel

ebidel Sep 27, 2014

Author Contributor

Done

*
* @attribute libraries
* @type string
* @default "places"
*/
libraries: "places",

/**
* The response from the directions service.
*
Expand Down
2 changes: 1 addition & 1 deletion google-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@

/**
* The libraries to load with this map. Defaults to "places". For more information
* https://developers.google.com/maps/documentation/javascript/libraries
* see https://developers.google.com/maps/documentation/javascript/libraries.
*
* @attribute libraries
* @type string
Expand Down

0 comments on commit c31fcb0

Please sign in to comment.