mirror of
https://github.com/RustyRaptor/react-leaflet-google.git
synced 2026-12-03 23:45:17 -07:00
Added channel option for Maps premium plan (https://developers.google.com/maps/premium/overview#client-id)
This commit is contained in:
1 parent
b1abb0da66
commit
e250fba1c1
2 files changed
+7
-2
No files matched your search
+3
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user