latitude:43.766017913818374, longitude: 87.6289749145508, 小数点后超过6位的部分删掉就行 latitude:43.766017, longitude: 87.628974, 这样就ok了 我给提供代码 truncateDecimal(num, decimalPlaces) { let numStr = num.toString(); let decimalPos = numStr.indexOf('.'); if (decimalPos === -1) { return num; } let integerPart = numStr.substring(0, decimalPos); let decimalPart = numStr.substring(decimalPos + 1, decimalPos + 1 + decimalPlaces); while (decimalPart.length < decimalPlaces) { decimalPart += '0'; } return parseFloat(integerPart + '.' + decimalPart); } // 使用示例 wx.openLocation({ latitude: this.truncateDecimal(43.766017913818374, 6), longitude: this.truncateDecimal(87.6289749145508, 6), name: '边疆宾馆', address: '天山区延安路662号', scale: 16, });
wx.openLocation 页面在ios大家打开 高德、百度、苹果地图都无法正确导航[图片]同一个地点的坐标,用ios端测试地点无法导航,用安卓的则正常导航 ios如图[图片] 安卓如图[图片]
2024-09-29