Javascript 如何在地图上显示坐标并在它们之间绘制箭头?

Javascript 如何在地图上显示坐标并在它们之间绘制箭头?,javascript,google-maps-api-3,coordinates,Javascript,Google Maps Api 3,Coordinates,我有一个实际位置的坐标列表,如下所示: index X y 1 24050.0000 123783.3333 2 24216.6667 123933.3333 3 24233.3333 123950.0000 4 24233.3333 124016.6667 ................. 这些是纬度和经度,以十进制形式给出(而不是分和秒)。取自 我想设计一个网页,在上面显示地图,在地图上显示这些

我有一个实际位置的坐标列表,如下所示:

index    X              y
1    24050.0000    123783.3333
2    24216.6667    123933.3333
3    24233.3333    123950.0000
4    24233.3333    124016.6667
       .................
这些是纬度和经度,以十进制形式给出(而不是分和秒)。取自

我想设计一个网页,在上面显示地图,在地图上显示这些地方的索引。 我还想在它们之间画箭头(1-->2),(2-->3),…,就像这样

我该怎么做

它需要太多的工作还是有一个简单的方法

如果你知道怎么做,请指出最简单的方法

我正在使用Javascript。
提前谢谢

您可以通过创建多段线,然后为其指定箭头图标来完成此操作

// Here you create the map

function initMap() {
  var map = new google.maps.Map(document.getElementById('map'), {
    zoom: 3,
    center: {lat: 0, lng: -180},
    mapTypeId: google.maps.MapTypeId.TERRAIN
  });

//Here are the coordinates of the points you are going to match

  var flightPlanCoordinates = [
    {lat: 37.772, lng: -122.214},
    {lat: 21.291, lng: -157.821},
    {lat: -18.142, lng: 178.431},
    {lat: -27.467, lng: 153.027}
  ];

//Here you create the polyline and assign the arrow icon to it

  var flightPath = new google.maps.Polyline({
    path: flightPlanCoordinates,
    icons: [{
      icon: lineSymbol,
      offset: '100%'
    }],
    geodesic: true,
    strokeColor: '#FF0000',
    strokeOpacity: 1.0,
    strokeWeight: 2
  });

      flightPath.setMap(map);
    }
资料取自和


我希望这能帮助你

你特别需要它们是箭头还是直线?这些“真实位置”在什么坐标系中?它们与Google Maps Javascript API v3要求的WGS84坐标系不兼容。@geocodezip我添加了数据源。我不知道它们是什么坐标。你知道一种转换它的方法并且可以在谷歌api中使用吗?