提交 45f88e51 编写于 作者: L liu-binjun

bugfix:文档更新

Signed-off-by: Nliu-xinbing <liuxinbing4@huawei.com>
上级 d126aaca
......@@ -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('该设备不支持位置信息');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册