智能客服
你问我答,随时在线为你解决问题
Petal 地图提供了通过AppLinking拉起应用的能力。 当前可以通过AppLinking拉起地图应用到首页、路径规划、导航、地点详情、地点搜索页面。
该功能支持的Petal 地图应用版本大于等于1.7.0.300。
接口名称 | 接口调用方向 | 接口描述 |
|---|---|---|
拉起Petal 地图 APP | Map Kit或三方应用 -> Petal 地图 APP | HarmonyOS系统openLink接口。 |
通过openLink接口拉起。将appLinkingOnly参数设为true,若有匹配的应用,则直接打开目标应用。若无App Linking匹配的应用, 目前openLink接口会抛异常给开发者进行处理。鸿蒙将会支持,在没有安装应用时候,牵引用户到应用市场进行下载。
在国内站点,中国大陆、中国香港和中国澳门使用GCJ02坐标系,中国台湾使用WGS84坐标系。
在海外站点,统一使用WGS84坐标系。坐标系转换参考:地图坐标系说明及转换。
- import { common } from '@kit.AbilityKit';
- const uri = 'https://www.petalmaps.com/?utm_source=fb';
- let context = getContext(this) as common.UIAbilityContext;
- context.openLink(uri, {
- appLinkingOnly: true
- })
参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
uri | string | 是 | 拉起页面地址,https://www.petalmaps.com。 |
参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
utm_source | string | 是 | 接入方业务名或包名,Link请求来源。 |


- import { common } from '@kit.AbilityKit';
- const uri = 'https://www.petalmaps.com/place/?z=16&marker=48.2944863308775,4.07333135604859&placeId=653905656638747008&utm_source=fb';
- let context = getContext(this) as common.UIAbilityContext;
- context.openLink(uri, {
- appLinkingOnly: true
- })
参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
uri | string | 是 | 拉起页面地址,https://www.petalmaps.com/place。 |
参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
utm_source | string | 是 | 接入方业务名或包名,Link请求来源。 |
marker | string | 是 | 位置纬经度。 |
placeId | string | 否 | 位置ID,如果有,优先使用。如果没有填写placeId,则调用逆地理接口,展示位置及其对应的纬经度。 |
z | string | 否 | z取层级范围3~20的整数,不符合或不填则按照默认层级展示。 |
coordinateType | string | 否 | 传入的纬经度的坐标系类型。0-WGS84,1-GCJ02,默认GCJ02。 |


- import { common } from '@kit.AbilityKit';
- const uri = 'https://www.petalmaps.com/routes/?saddr=25.102916,55.165363&daddr=25.164610000000,55.228869000000&type=walk&utm_source=fb';
- let context = getContext(this) as common.UIAbilityContext;
- context.openLink(uri, {
- appLinkingOnly: true
- });
参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
uri | string | 是 | 拉起页面地址,https://www.petalmaps.com/routes。 |
参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
utm_source | string | 是 | Link请求来源,接入方业务名或包名。 |
saddr | string | 否 | 起点纬经度(纬度在前,经度在后),默认取当前位置。支持纬经度+名称, 名称括号为英文格式,中间可以有空格。例:48.883653,2.311279(中 软国际),名称括号为英文格式,中间可以有空格,拉起地图后起终点显示中软国际。支持家或公司, 家对应参数值为home公司的参数值为company,没有设置家或公司则拉起设置页。 |
daddr | string | 是 | 终点纬经度(纬度在前,经度在后), 支持纬经度+名称, 名称括号为英文格式,中间可以有空格。例:48.883653,2.311279(中 软国际),名称括号为英文格式,中间可以有空格,拉起地图后起终点显示中软国际。支持家或公司, 家对应参数值为home公司的参数值为company,没有设置家或公司则拉起设置页。 |
type | string | 否 | 交通出行工具。drive(驾车)、bus(公交)、walk(步行)、bicycle(骑行), 不填或者错误格式会默认是驾车。 |
coordinateType | string | 否 | 传入的纬经度的坐标系类型。0-WGS84,1-GCJ02,默认GCJ02。 |


- import { common } from '@kit.AbilityKit';
- const uri = 'https://www.petalmaps.com/navigation/?saddr=31.97655,118.568523(测试1)&daddr=31.8888,118.6584722(测试2)&type=drive&utm_source=ft';
- let context = getContext(this) as common.UIAbilityContext;
- context.openLink(uri, {
- appLinkingOnly: true
- })
参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
uri | string | 是 | 拉起页面地址, https://www.petalmaps.com/navigation。 |
参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
utm_source | string | 是 | Link请求来源,接入方业务名或包名。 |
saddr | string | 否 | 起点纬经度(纬度在前,经度在后),默认取当前位置。支持纬经度+名称。支持家或公司。 |
daddr | string | 是 | 终点纬经度(纬度在前,经度在后),支持纬经度+名称。支持家或公司。 |
type | string | 否 | 交通出行工具。drive(驾车)、bus(公交)、walk(步行)、bicycle(骑行), 不填或者错误格式会默认是驾车。如果填bus拉起地图后会停留在路线规划页面,不会发起导航。 |
coordinateType | string | 否 | 传入的纬经度的坐标系类型。0-WGS84,1-GCJ02,默认GCJ02 。 |


- import { common } from '@kit.AbilityKit';
- const uri = 'https://www.petalmaps.com/search/?q=coffee&utm_source=fb';
- let context = getContext(this) as common.UIAbilityContext;
- context.openLink(uri, {
- appLinkingOnly: true
- })
参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
uri | string | 是 | 拉起页面地址,https://www.petalmaps.com/search。 |
参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
utm_source | string | 是 | Link请求来源,接入方业务名或包名。 |
q | string | 是 | 位置名称。 |

