简体   繁体   中英

Plotting routes with here.com api

I'm using the Here.com "maptile" api to populate my map with map tiles. Now I want to add routes from point A to B to the map. I figured Here's routing api would provide me with a nice set of coordinates to use for plotting a line in the map, but the api only provides one coordinate pair per "maneuver" (that is, at roundabouts, exits, intersections etc). That is not detailed enough to use for plotting routes since all roads are not perfectly straight ;)

Example

This example at Here's api playground shows a red route plotted perfectly along a road using their map image api. However, if you run the start and end coordinates in the "m1" field through the routing api , you will get the following coordinates:

52.5408395,13.2626364,52.5403011,13.2630944,52.5289285,13.2687593,52.51873,13.2800306

If you enter these coordinates in the "r1" field and click Send Request, you will see that the route is plotted differently (straight line across the park, instead of along the yellow road).

Question

Is there any way to get more detailed data from Here.com's routing api (or any other Here api I may have overlooked), suitable for plotting roads?

Or is there perhaps some way to get map tiles from the maptile api with a route properly pre-rendered?

In HERE Routing API, you can ask for route shape with parameter &routeattributes=shape This will return an array of coordinates which represents the exact shape of the route on the road. You can also use pedestrian mode which will take into account the roads only accessible on foot.

Unfortunately it's not possible to get map tiles with rendered route shape using Map Tiles API. This API is just for fetching tiles.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM