Skip to content

Commit

Permalink
feat(GoogleMap): add warning for undefined google object
Browse files Browse the repository at this point in the history
* Closes #142
  • Loading branch information
tomchentw committed Dec 3, 2015
1 parent 0ec1e60 commit 2e0c60b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/creators/GoogleMapHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import {
Children,
} from "react";

import {
default as warning,
} from "warning";

import {default as GoogleMapEventList} from "../eventLists/GoogleMapEventList";
import {default as eventHandlerCreator} from "../utils/eventHandlerCreator";
import {default as defaultPropsCreator} from "../utils/defaultPropsCreator";
Expand Down Expand Up @@ -56,6 +60,11 @@ export default class GoogleMapHolder extends Component {
}

static _createMap (domEl, mapProps) {
warning(`undefined` !== typeof google,
`Make sure you've put a <script> tag in your <head> element to load Google Maps JavaScript API v3.
If you're looking for built-in support to load it for you, use the "async/ScriptjsLoader" instead.
See https://github.com/tomchentw/react-google-maps/pull/168`
);
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#Map
return new google.maps.Map(domEl, composeOptions(mapProps, mapControlledPropTypes));
}
Expand Down

0 comments on commit 2e0c60b

Please sign in to comment.