是否可以在某个“公里"之后放置标记?从DirectionsService路线的起点开始? [英] Is it possible to put a marker after some "km" from the start point in a DirectionsService's route?

查看:75
本文介绍了是否可以在某个“公里"之后放置标记?从DirectionsService路线的起点开始?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码:

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公里后放置一个标记:可能吗?

now, I'd like to put a marker after 200km from the point origin: start : is it possible?

推荐答案

在此示例中,在路线上放置了两个标记(一个标记位于9.5公里处,另一个标记位于64.8公里处):

Here is an example that puts two markers on a route (one at 9.5km and one at 64.8km):

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

(所以,是的,有可能)

(so, yes, it is possible)

此示例是在几何库发布之前创建的,并且可能是可以重写以使用它.

This example was created before the geometry library was released, and might be able to be re-written to use that.

这篇关于是否可以在某个“公里"之后放置标记?从DirectionsService路线的起点开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆