У меня есть набор местоположений GPS, которые я помещаю на карту с помощью mapbox, а затем рисую линию между точками.
Есть ли способ нарисовать плавную/интеллектуальную линию, которая следует за дорогами? вместо того, что у меня получилось на чертеже?
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Single marker</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.0.0/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.0.0/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<div id='map'></div>
<script>
L.mapbox.accessToken = '<TOKEN_HERE>';
var map = L.mapbox.map('map', 'examples.map-i86nkdio')
.setView([40.763656, -73.980603], 15);
L.mapbox.featureLayer({
// this feature is in the GeoJSON format: see geojson.org
// for the full specification
type: 'Feature',
geometry: {
type: 'LineString',
// coordinates here are in longitude, latitude order because
// x, y is the standard for GeoJSON and many formats
coordinates: [
[ -73.979552 , 40.766119 ],
[ -73.982556 , 40.761991 ],
[ -73.980399 , 40.759858 ],
[ -73.978575 , 40.756607 ]
]
},
properties: {
title: 'test',
description: 'Test',
}
}).addTo(map);
</script>
</body>
</html>
Изображение: http://postimg.org/image/x1syq28o5/