提交 a8b7312a 编写于 作者: Q qiang

fix(web): 更新腾讯地图使用的坐标转换接口

上级 4f0fd78d
......@@ -95,17 +95,13 @@ export function translateCoordinateSystem(
if (mapInfo.type === MapType.QQ) {
return new Promise((resolve: GeolocationCoordinates | any) => {
getJSONP(
`https://apis.map.qq.com/jsapi?qt=translate&type=1&points=${coords.longitude},${coords.latitude}&key=${mapInfo.key}&output=jsonp&pf=jsapi&ref=jsapi`,
`https://apis.map.qq.com/ws/coord/v1/translate?type=1&locations=${coords.latitude},${coords.longitude}&key=${mapInfo.key}&output=jsonp`,
{
callback: 'cb',
callback: 'callback',
},
(res: any) => {
if (
'detail' in res &&
'points' in res.detail &&
res.detail.points.length
) {
const { lng, lat } = res.detail.points[0]
if ('locations' in res && res.locations.length) {
const { lng, lat } = res.locations[0]
resolve({
longitude: lng,
latitude: lat,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册