From e250fba1c1b7ceb2cf3c7d1bdce38ef1735dcd26 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Achterbergh Date: Fri, 15 Jun 2018 14:15:05 +0200 Subject: [PATCH] Added channel option for Maps premium plan (https://developers.google.com/maps/premium/overview#client-id) --- src/Google.js | 5 +++-- src/leaflet.google.js | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Google.js b/src/Google.js index ce0ce66..8d320d8 100644 --- a/src/Google.js +++ b/src/Google.js @@ -8,7 +8,8 @@ export default class GoogleLayer extends GridLayer { static propTypes = { googlekey: PropTypes.string.isRequired, maptype: PropTypes.string, - asclientid: PropTypes.bool + asclientid: PropTypes.bool, + channel: PropTypes.string }; @@ -20,7 +21,7 @@ export default class GoogleLayer extends GridLayer { componentWillMount() { super.componentWillMount(); - const {map: _map, googlekey, maptype, asclientid, ...props} = this.props; + const {map: _map, googlekey, maptype, asclientid, channel, ...props} = this.props; this.leafletElement = new L.gridLayer.googleMutant(this.props); } diff --git a/src/leaflet.google.js b/src/leaflet.google.js index fcff843..6b05a81 100644 --- a/src/leaflet.google.js +++ b/src/leaflet.google.js @@ -37,6 +37,10 @@ L.GridLayer.GoogleMutant = L.GridLayer.extend({ GoogleMapsLoader.LIBRARIES = options.libraries || []; + if (options.channel) { + GoogleMapsLoader.CHANNEL = options.channel; + } + self._type = options.maptype || 'SATELLITE'; GoogleMapsLoader.load(function (_google) {