2015-11-10 48 views
0

我想通过这里的地图REST API从地图的waypoint0到waypoint1的图像。获取地图图像从这里地图Rest API

这是请求URL:

http://image.maps.cit.api.here.com/mia/1.6/routing?waypoint0=:waypoint0lat%2C:waypoint0lng&waypoint1=:waypoint1lat%2C:waypoint1lng&mode=fastest%3Bcar%3Btraffic%3Adisabled&app_id=:app_id&app_code=:app_code&lc=1652B4&lw=6&t=0&ppi=320&w=400&h=600 

waypoint0lat: "40.7369182", 
waypoint0lng: "-73.9885248", 
waypoint1lat: "40.7051079", 
waypoint1lng: "-74.0157525" 

我得到的是数字和字符未知的大型对象的响应。我怎样才能解读这个反应到图像中?

谢谢!

+0

你能提供的链接,API文档。在图像api.https://developer.here.com/api-explorer/rest/map-image/basic-map-image无法找到路由 – UglyCode

+0

是的。以下是链接:https://developer.here.com/rest-apis/documentation/enterprise-map-image/topics/examples-routing-chicago-pois.html – PBandJen

+0

我检查了api,它会返回带有路线的图像在绘制的航点之间。 – UglyCode

回答

0

我能够通过使用例如请求从 https://developer.here.com/rest-apis/documentation/enterprise-map-image/topics/examples-routing-chicago-pois.html

检索地图图像使用你的坐标,同样的例子和图像标签应该能够使其在网页上为您服务。

<html> 
<head></head> 
<body> 
    <img src="http://image.maps.cit.api.here.com/mia/1.6/routing 
?app_id={YOURAPPID} 
&app_code={YOURAPPCODE} 
&waypoint0=40.7369182,-73.9885248 
&waypoint1=40.7051079,-74.0157525 
&poix0=40.7499714,-73.9979574;00a3f2;00a3f2;11;. 
&poix1=40.7456827,-73.9954344;white;white;11;. 
&lc=1652B4 
&lw=6 
&t=0 
&ppi=320 
&w=400 
&h=600 
"/> 
</body> 

</html> 

使用演示应用程序ID渲染,应用程序代码

enter image description here