import { AppLauncher } from "@capacitor/app-launcher";
import { Capacitor } from "@capacitor/core";

// 打开高德地图 OPEN_GAODE
// dlon:    终点经度
// &dlat=  终点纬度
// &dname= 终点名字
export const openGaoDe = async (lat, lng, name) => {
  const scheme =
    Capacitor.getPlatform() === "ios"
      ? `iosamap://path?sourceApplication=LocalBlock&dlat=${lat}&dlon=${lng}&dname=${name}&dev=0&t=0`
      : `androidamap://route?sourceApplication=acc&dlat=${lat}&dlon=${lng}&dname=${name}&dev=0&t=0`;

  await AppLauncher.openUrl({ url: scheme });
};
 
