| @@ -6,8 +6,15 @@ | ||
| 6 | 6 | ($scope) => { |
| 7 | 7 | elementorFrontend.elementsHandler.addHandler( |
| 8 | 8 | elementorModules.frontend.handlers.Base.extend({ |
| 9 | 9 | onInit() { |
| 10 | + // No API key means the Maps script was never enqueued. | |
| 11 | + // The widget already prints a notice for editors; bailing | |
| 12 | + // out here keeps it from throwing on every page view. | |
| 13 | + if (typeof google === "undefined" || !google.maps) { | |
| 14 | + return; | |
| 15 | + } | |
| 16 | + | |
| 10 | 17 | const $element = this.$element; |
| 11 | 18 | const googleMap = $element.find(".king-addons-google-map"); |
| 12 | 19 | const settings = googleMap.data("settings"); |
| 13 | 20 | const controls = googleMap.data("controls"); |