HarmonyOS web页面如何使用deeplink跳转到系统地图

HarmonyOS
2024-12-27 14:45:12
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
Heiang

使用webView onLoadIntercept拦截前端请求,目的是获取拉起应用的url,或者使用其他方式例如javaScriptProxy,获取url,再在应用侧通过context.startAbility(want)拉起系统地图

import { common, Want } from '@kit.AbilityKit';

@Entry
@Component
struct StartAblity {
  @State message: string = 'Hello World';

  build() {
    Row() {
      Column() {
        Text(this.message)
          .fontSize(50)
          .fontWeight(FontWeight.Bold)
          .onClick(()=>{
            let context = getContext(this) as common.UIAbilityContext;
            let petalMapWant: Want = {
              bundleName: 'com.huawei.hmos.maps.app',
              uri: 'maps://routes',
              parameters: {
                linkSource: 'com.other.app',
                destinationLatitude: 40.0382556,
                destinationLongitude: 116.3144536,
                destinationName: '清河站',
                originName: '香山公园',
                originLatitude: 39.9901079,
                originLongitude: 116.1887467
              },
            }
            context.startAbility(petalMapWant)
          })
      }
      .width('100%')
    }
    .height('100%')
  }
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
分享
微博
QQ
微信
回复
2024-12-27 17:48:52
相关问题
HarmonyOS 怎么跳转到系统页面
1029浏览 • 1回复 待解决
如何跳转到系统发送短信页面
3310浏览 • 1回复 待解决
HarmonyOS 跳转到系统设置页面的方法
1334浏览 • 1回复 待解决
如何实现跳转到系统设置
2841浏览 • 1回复 待解决
HarmonyOS 如何跳转到应用设置页面
1235浏览 • 1回复 待解决
HarmonyOS如何跳转到发短信页面
1656浏览 • 1回复 待解决
如何跳转到WIFI列表页面
1354浏览 • 1回复 待解决
HarmonyOS Web页面如何支持多语言
883浏览 • 1回复 待解决
HarmonyOS 如何跳转到系统发短信界面?
1130浏览 • 1回复 待解决
HarmonyOS 如何跳转到系统位置开关页
757浏览 • 1回复 待解决
如何从app跳转到系统相机
6467浏览 • 1回复 已解决