From 45f88e5153390139b7031ebc0a64d8c6e7671cf7 Mon Sep 17 00:00:00 2001 From: liu-binjun Date: Tue, 1 Aug 2023 11:35:18 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=E6=96=87=E6=A1=A3=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liu-xinbing --- zh-cn/application-dev/reference/syscap.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zh-cn/application-dev/reference/syscap.md b/zh-cn/application-dev/reference/syscap.md index 2eeaed9a4c..9bee315d94 100644 --- a/zh-cn/application-dev/reference/syscap.md +++ b/zh-cn/application-dev/reference/syscap.md @@ -110,11 +110,11 @@ DevEco Studio会根据创建的工程所支持的设置自动配置联想能力 - 方法2:开发者可通过import的方式将模块导入,若当前设备不支持该模块,import的结果为undefined,开发者在使用其API时,需要判断其是否存在。 ```ts - import geolocation from '@ohos.geolocation'; + import geolocationManager from '@ohos.geoLocationManager'; - if (geolocation) { - geolocation.getCurrentLocation((location) => { - console.log(location.latitude, location.longitude); + if (geolocationManager) { + geolocationManager.getCurrentLocation((location) => { + console.log('current location: ' + JSON.stringify(location)); }); } else { console.log('该设备不支持位置信息'); -- GitLab