From 9652e0c7b231f0569c522add87034dad214a9235 Mon Sep 17 00:00:00 2001 From: David Idol Date: Thu, 14 May 2015 20:36:03 -0700 Subject: [PATCH] feat(SimpleChildComponent): Add warning text if user attempts to use componenet without corresponding library --- lib/internals/SimpleChildComponent.js | 1 + src/internals/SimpleChildComponent.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/internals/SimpleChildComponent.js b/lib/internals/SimpleChildComponent.js index cf30c897..1087d8e6 100644 --- a/lib/internals/SimpleChildComponent.js +++ b/lib/internals/SimpleChildComponent.js @@ -84,6 +84,7 @@ var SimpleChildComponent = (function (_EventComponent) { } else { var googleMapsClassName = this.constructor._GoogleMapsClassName; if (!_objectPath2["default"].has(googleMapsApi, googleMapsClassName)) { + console.warn("Warning: This react-google-maps component can't find the corresponding Google Maps API class '" + googleMapsClassName + "'. " + "You may have to include additional Google Maps libraries in your javascript src URL. " + "See: https://developers.google.com/maps/documentation/javascript/libraries"); return; } var GoogleMapsClass = _objectPath2["default"].get(googleMapsApi, googleMapsClassName); diff --git a/src/internals/SimpleChildComponent.js b/src/internals/SimpleChildComponent.js index 40a4502c..e83a5fd1 100644 --- a/src/internals/SimpleChildComponent.js +++ b/src/internals/SimpleChildComponent.js @@ -35,6 +35,11 @@ class SimpleChildComponent extends EventComponent { } else { const googleMapsClassName = this.constructor._GoogleMapsClassName; if (!objectPath.has(googleMapsApi, googleMapsClassName)) { + console.warn( + `Warning: This react-google-maps component can't find the corresponding Google Maps API class '${googleMapsClassName}'. ` + + `You may have to include additional Google Maps libraries in your javascript src URL. ` + + `See: https://developers.google.com/maps/documentation/javascript/libraries` + ); return; } const GoogleMapsClass = objectPath.get(googleMapsApi, googleMapsClassName);