Class: SuperMapService

SuperMapService

接入超图常用的服务,比如路劲分析服务。

  SuperMapService.findMTSPPaths(
    "/superMapPathUrl/iserver/services/transportationAnalyst-zhonghua/rest/networkanalyst/BuildNetwork@zhonghua_path",
    {
      nodes: [
        { x: 122.135621, y: 29.953183 },
        { x: 122.142123, y: 29.951187 },
        { x: 122.135326, y: 29.950152 },
        { x: 122.138239, y: 29.947926 }
      ]
    }).then(res => {
      const polyline1 = new Polyline({
        path: res.path,
        stroke: {
          color: "yellow",
          opacity: 0.9,
          width: 4
        }
      });
      const layer = new VectorLayer({ name: "路径测试" });
      layer.addFeature(polyline1)
      this.$map.addLayer(layer);
    })

new SuperMapService()

app/pathAnalysis/supermap/SuperMapService.js, line 37

Classes

SuperMapService

Methods

staticSuperMapService.findMTSPPaths(url, params){Promise}

app/pathAnalysis/supermap/SuperMapService.js, line 49

添加多个途经点完成路径分析,一般用于旅行分析,无节点先后顺序,实现的效果就是规划一条经过所有点的最短路线

Name Type Description
url String

超图服务url,如:"/superMapPathUrl/iserver/services /transportationAnalyst-zhonghua/rest/networkanalyst/BuildNetwork@zhonghua_path"

params Object

一些服务参数

Name Type Description
nodes Array

节点坐标

parameter Object

一些设置返回结果的参数,有默认值

Returns:
Type Description
Promise 返回的值包含,路径节点坐标以及路径总长

staticSuperMapService.findPaths(url, params){Promise}

app/pathAnalysis/supermap/SuperMapService.js, line 88

添加多个途经点完成最短路径分析

Name Type Description
url String

超图服务url,如:"/superMapPathUrl/iserver/services /transportationAnalyst-zhonghua/rest/networkanalyst/BuildNetwork@zhonghua_path"

params Object

一些服务参数

Name Type Description
nodes Array

节点坐标

parameter Object

一些设置返回结果的参数,有默认值

Returns:
Type Description
Promise 返回的值包含,路径节点坐标以及路径总长