Element API calling Module that integrates with third-party plugin
You have to use full namespaces in Element API because anything within those functions is out of scope. So you need to use the full path to the Google class.

$googleMaps = new \Vendor\Module\GoogleMapsApi();


Putting a "use" directive at the top of the file will not work.

I had the exact same problem and that resolved my issues immediately.