Tag: google direction

根据路径方向更改Google地图标记方向

我想知道是否可以根据地图上绘制的路径更改标记方向。 这是一个例子: 正如您所看到的那样,标记是一辆汽车(带前保险杠和尾灯)。 我想让汽车朝着路径的方向前进(在这个例子中,汽车将向右转45度)。 我正在使用DirectionsService绘制路径,我有一个随机数点。 有时只有一个,有时10点。 我在绘制路径之前添加标记。 以下是我绘制路径的方法: // Intialize the Path Array var path = new google.maps.MVCArray(); // Intialise the Direction Service var service = new google.maps.DirectionsService(); // Set the Path Stroke Color var poly = new google.maps.Polyline({ map: gmap, strokeColor: ‘#dd0000’ }); // #4986E7 // Draw the path for this vehicle for (var […]