diff --git a/packages/uni-h5/src/helpers/location.ts b/packages/uni-h5/src/helpers/location.ts index 62ee3fd9aeb788b3e56d3390e5e08dc302054067..2e24f0b0966dd583a5a09128ff6fbf3de83da20d 100644 --- a/packages/uni-h5/src/helpers/location.ts +++ b/packages/uni-h5/src/helpers/location.ts @@ -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,