Here api 坐标高程图

Here api 坐标高程图,here-api,Here Api,我想请你们谈谈互动地图和地理服务。我需要从我的坐标点得到海拔高度,并绘制海拔图。 在谷歌地图中,它看起来像这样: 我没有找到任何这样的例子。我如何解决这个问题 多谢各位。 向Petr Tomasek致意您可以通过此处RoutingService JS API,通过指定RouterRequestParams至true的returnelevation值,构建类似的高程图,如以下代码段所示: var router = platform.getRoutingService(); var routeRe

我想请你们谈谈互动地图和地理服务。我需要从我的坐标点得到海拔高度,并绘制海拔图。 在谷歌地图中,它看起来像这样:

我没有找到任何这样的例子。我如何解决这个问题

多谢各位。
向Petr Tomasek致意

您可以通过此处RoutingService JS API,通过指定
RouterRequestParams
true
returnelevation
值,构建类似的高程图,如以下代码段所示:

var router = platform.getRoutingService();
var routeRequestParams = {
  mode: 'fastest;car',
  representation: 'display',
  waypoint0: '{lat, lng}', // Start of route
  waypoint1: '{lat, lng}', // End of route
  returnelevation: true
};
var onResult = function(result) {
  var route = result.response.route[0];
  /* Now, altitudes are the third values of the each shape point.
     Note: Shape points returned as strings.  */
  var elevation_list = route.shape.map(x => parseFloat(x.split(",")[2]));
  /* Now you can use the elevation_list as input data to 
     draw your elevation graph with any graph tool 
  */
};
var onError = function(error) {
  console.log(error);
};

router.calculateRoute(
  routeRequestParams,
  onResult,
  onError
);
通过高程值,您可以使用任何JS图形库绘制高程图。 签出路由API: