You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何向React Native的Mappls Direction Widget传入硬编码位置数组?

MapmyIndia Direction Widget 途经点配置方法

你可以通过waypoints属性传入途经点数组来实现多路径规划,每个途经点的结构和source、destination完全一致,都是包含longitude、latitude、name、address的对象。

修改后的代码示例如下:

const data = await MapplsDirectionWidget.openDirectionWidget({
  source: {
    longitude:73.7228769,
    latitude:18.5248904,
    name:"Pune",
    address:"Pune,Maharashtra"
  },
  destination: {
    longitude:76.576184,
    latitude:10.850516,
    name:"Kerala",
    address:"Kerala"
  },
  waypoints: [
    {
      longitude:77.594562,
      latitude:12.971599,
      name:"Bengaluru",
      address:"Bengaluru,Karnataka"
    }
  ]
})

说明:waypoints数组支持添加多个途经点,数组内的顺序就是路径的行驶顺序。

内容的提问来源于stack exchange,提问作者Darshan Patil

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 00:15:34