这是我脚本中的代码片段。我想将它更改为汽车图像或引脚标记任何想法如何更改它我试图多次更改它但我没有工作。 i want this marker
map.addControl(new mapboxgl.Navigation());
function pointOnCircle(angle) {
return {
"type": "Point",
"coordinates": [long, lat]
};
}
map.on('load', function () {
// Add a source and layer displaying a point which will be animated in a circle.
map.addSource('point', {
"type": "geojson",
"data": pointOnCircle(0)
});
map.addLayer({
"id": "point",
"source": "point",
"type": "circle",
"paint": {
"circle-radius": 10,
"circle-color": "#FF0000"
}
"icon": "../assets/blue-marker.png"
});
function animateMarker(timestamp) {
// Update the data to a new position based on the animation timestamp. The
// divisor in the expression `timestamp / 1000` controls the animation speed.
map.getSource('point').setData(pointOnCircle(timestamp /800));
// Request the next frame of the animation.
requestAnimationFrame(animateMarker);
}
// Start the animation.
animateMarker(0);