不是 LatLng 或 LatLngLiteral

Not a LatLng or LatLngLiteral

Uncaught ge {message: 'not a LatLng or LatLngLiteral: in property lat: not a number', name: 'InvalidValueError', stack: 'Error\n    at new ge (https://maps.googleapis.com/m…tp://localhost:3001/static/js/bundle.js:82399:27)

纬度和经度只是数字,仍然出现此错误。

最新版本在几个位置添加了验证,可以捕获一些无效的 LatLng 鸭式输入。

您可能正在传递具有 .lat().lng() 但不是 LatLng 或 LatLng 子类的对象。这是无效的。

相反,您应该传递具有 latlng 属性和数值的对象的 LatLngLiteral。