【发布时间】:2022-02-11 15:33:44
【问题描述】:
我需要帮助
我使用这里的地图 api 我尝试显示城市周围的轮廓,但这是一个错误
const shape = res.response.isoline[0].component[0].shape.map(z => z.split(','));
这是完整的代码
const requestIsolineShape = 选项 => {
常量参数 = {
'模式':fastest;${options.mode};traffic:enabled,
“开始”:geo!${options.center.lat},${options.center.lng},
“范围”:options.range,
“范围类型”:options.rangeType,
“出发”:${options.date}T${options.time}:00,
};
return new Promise((resolve, reject) => { router.calculateIsoline( 参数, 水库=> { const shape = res.response.isoline[0].component[0].shape.map(z => z.split(',')); 解决(形状); }, 错误 => 拒绝(错误) ); }); } ;
【问题讨论】:
-
res.response.isoline 或 res.response.isoline[0].component 未定义
-
谢谢@GoldenretriverYT,我刚看到(未捕获的类型错误:res.response.isoline 未定义)我该如何修复它
标签: javascript syntax-error here-api