Skip to content

Commit

Permalink
feat(GoogleMap): Add defaultExtraMapTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
danbovey authored and tomchentw committed Oct 12, 2017
1 parent 33c24fa commit 6ee4734
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/macros/GoogleMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export class Map extends React.PureComponent {

static propTypes = {
__jscodeshiftPlaceholder__: null,

/**
* @url https://developers.google.com/maps/documentation/javascript/3.exp/reference#MapTypeRegistry
* @type Array<[id:string, mapType:MapType|*]>
*/
defaultExtraMapTypes: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.any)),
}

static contextTypes = {
Expand Down Expand Up @@ -108,4 +114,8 @@ export default Map

const eventMap = {}

const updaterMap = {}
const updaterMap = {
extraMapTypes(instance, extra) {
extra.forEach(it => instance.mapTypes.set(...it))
},
}

0 comments on commit 6ee4734

Please sign in to comment.