错误:GoogleMapsAPI没有为node-googlemaps定义
我正在使用node-googlemaps从Node js查询Google Maps API
。 我已经创build了我的服务器API密钥作为开发人员。 根据这个文档,我必须使用我的API密钥和某些其他参数来创build一个publicConfig
variables。 我的publicConfigvariables如下所示:
var gm = require('googlemaps'); var publicConfig = { key: 'myKey', stagger_time:1000, // for elevationPath encode_polylines:false, secure:true // use https }; var gmAPI = new GoogleMapsAPI(publicConfig);
当我运行代码时,出现以下错误
ReferenceError: GoogleMapsAPI is not defined
有人可以帮我解决这个问题吗?
要解决这个问题,我已经包含了下面这行代码
var GoogleMapsAPI = require('googlemaps');
- 通过节点客户端调用Google API时出现“套接字挂起”错误
- 如何授权访问Google云端函数中的目录API
- 如何将经过authentication的RESTful oAuth 2后端请求发送到Google API
- 使用Google Contacts API版本3.0和NodeJS的“护照”同步联系人
- 从passportjs中的刷新令牌获取oauth访问令牌
- nodejs googleapis,authClient.request不是一个函数
- Google API服务帐户和nodejs
- 使用Google API访问公共日历,无需用户login
- Node.js:Google AnalyticsAPI:如何使用“服务帐户”进行授权的只读pipe理API请求?