【问题标题】:Is it possible to put a marker after some "km" from the start point in a DirectionsService's route?是否可以在 DirectionsService 路线中距离起点的“公里”后放置一个标记?
【发布时间】:2012-10-02 14:57:45
【问题描述】:

这是我的代码:

var request = {
    origin: start,
    destination: end,
    travelMode: google.maps.DirectionsTravelMode.DRIVING
};

directionsService.route(request, function (response, status) {
    if (status == google.maps.DirectionsStatus.OK) {
        directionsDisplay.setDirections(response);
    }
});

现在,我想在距离origin: start 点 200 公里后放置一个标记:可以吗?

【问题讨论】:

    标签: google-maps google-maps-api-3


    【解决方案1】:

    这是一个在路线上放置两个标记的示例(一个在 9.5 公里,一个在 64.8 公里):

    http://www.geocodezip.com/v3_GoogleEx_directions-waypoints_kmmarkersC.html

    (所以,是的,有可能)

    此示例是在 geometry library 发布之前创建的,并且可以重写以使用它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-27
      • 2014-07-01
      • 2015-05-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多