Cannot read properties of undefined (reading ‘addressComponent’) 使用高德地图 map.getCity 获取坐标省市区报错 解决 使用这个 map.getCity api 的时候需要添加安全密钥才行,只配置了 key 无法使用添加安全密钥即可 window._AMapSecurityConfig = { securityJsCode: 'xxxxxxxxxxxxxxxxxxxxxxxx' } 官方文档地址