Javascript 谷歌用1-2-3而不是A-B-C来绘制方向图

Javascript 谷歌用1-2-3而不是A-B-C来绘制方向图,javascript,google-maps,google-maps-api-3,Javascript,Google Maps,Google Maps Api 3,我在谷歌地图上使用谷歌地图API 问题是,它显示了路径中的几个站点,将它们标记为A-B-C-D…Z,但我需要将其更改为1-2-3-4-…99 这是我的密码 directionsService.route({ origin: $( "#input-directions-start-point" ).val(), destination: $( "#input-directions-end-point" ).val(), waypoints: waypts, //other

我在谷歌地图上使用谷歌地图API

问题是,它显示了路径中的几个站点,将它们标记为A-B-C-D…Z,但我需要将其更改为1-2-3-4-…99

这是我的密码

directionsService.route({
    origin: $( "#input-directions-start-point" ).val(),
    destination: $( "#input-directions-end-point" ).val(),
    waypoints: waypts, //other duration points
    optimizeWaypoints: true,
    travelMode: google.maps.TravelMode.DRIVING
  }, function(response, status) {
    if (status === google.maps.DirectionsStatus.OK) {
      directionsDisplay.setDirections(response);
      console.log(response);
    } else {
      vts.alertDialog( window.localization.error,
        window.localization.error_direction_calculate + ": " + status,
        BootstrapDialog.TYPE_DANGER);
    }
  });
这是屏幕截图


提前感谢

google.maps.DirectionsRendererOptions
具有属性
suppressMarkers
,当您设置为
true
时,该属性将只渲染路径而不渲染标记

然后,您可以使用例如
google.maps.Marker
来呈现标记,该标记具有
label
属性,您可以使用该属性指定标记内的标签,例如数字(您还可以通过扩展
google.maps.overlyview
类或使用来创建自己的自定义标记)。可以从
方向服务
响应
对象解析路由上标记的位置

更多

工作示例:

函数init(){
directionsService=new google.maps.directionsService();
var pos=new google.maps.LatLng(41.218624,-73.748358);
变量myOptions={
缩放:15,
中心:pos,,
mapTypeId:google.maps.mapTypeId.ROADMAP
};
map=new google.maps.map(document.getElementById('map'),myOptions);
directionsDisplay=new google.maps.DirectionsRenderer({map:map,suppressMarkers:true});
方向服务.路线({
来源:“纽约”,
目的地:“芝加哥”,
航路点:[{地点:“费城”},{地点:“波士顿”}],//其他持续时间点
航路点:对,
travelMode:google.maps.travelMode.DRIVING
},功能(响应、状态){
if(status==google.maps.directionstatus.OK){
方向显示。设置方向(响应);
var my_route=response.routes[0];
对于(var i=0;i

load(“maps”,“3”,{other_参数:“sensor=false”});

google.maps.directionsRenderOptions
具有属性
suppressMarkers
,当设置为
true
时,该属性将仅渲染路径而不渲染标记

然后,您可以使用例如
google.maps.Marker
来呈现标记,该标记具有
label
属性,您可以使用该属性指定标记内的标签,例如数字(您还可以通过扩展
google.maps.overlyview
类或使用来创建自己的自定义标记)。可以从
方向服务
响应
对象解析路由上标记的位置

更多

工作示例:

函数init(){
directionsService=new google.maps.directionsService();
var pos=new google.maps.LatLng(41.218624,-73.748358);
变量myOptions={
缩放:15,
中心:pos,,
mapTypeId:google.maps.mapTypeId.ROADMAP
};
map=new google.maps.map(document.getElementById('map'),myOptions);
directionsDisplay=new google.maps.DirectionsRenderer({map:map,suppressMarkers:true});
方向服务.路线({
来源:“纽约”,
目的地:“芝加哥”,
航路点:[{地点:“费城”},{地点:“波士顿”}],//其他持续时间点
航路点:对,
travelMode:google.maps.travelMode.DRIVING
},功能(响应、状态){
if(status==google.maps.directionstatus.OK){
方向显示。设置方向(响应);
var my_route=response.routes[0];
对于(var i=0;i

load(“maps”,“3”,{other_参数:“sensor=false”});

您尝试过什么?你的代码没有显示替换默认标记的尝试。我没有任何解决方法。API不支持此功能。此
方向渲染器选项
具有
抑制标记
属性。看见如果您有不同的航路点坐标,我想您可以放置自己的标记,而不是默认的标记。您尝试了什么?你的代码没有显示替换默认标记的尝试。我没有任何解决方法。API不支持此功能。此
方向渲染器选项
具有
抑制标记
属性。看见如果您有不同的航路点坐标,我想您可以放置自己的标记,而不是默认的标记。如果您所做的只是将我的注释转换为答案,那么至少要正确操作。@MrUpsidown我从未见过您的注释。我花了至少20分钟写下这个答案,你一定是在那个时期写的。你为什么认为你是