Javascript 错误与“;新的google.maps.directionService();关于谷歌地图api

Javascript 错误与“;新的google.maps.directionService();关于谷歌地图api,javascript,jquery,google-maps,jquery-mobile,google-maps-api-3,Javascript,Jquery,Google Maps,Jquery Mobile,Google Maps Api 3,我正在尝试用谷歌地图api和jquery手机制作地图,我想做的地图是方向图。我有两个GPS坐标,我想在地图初始化时显示两点之间的路径。代码如下: <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script> <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script&g

我正在尝试用谷歌地图api和jquery手机制作地图,我想做的地图是方向图。我有两个GPS坐标,我想在地图初始化时显示两点之间的路径。代码如下:

<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script> 

<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script> 

<script src="http://maps.google.com/maps/api/js?sensor=false"></script>

<script type="text/javascript" src="../js/jquery.ui.map.js"></script>

<script type="text/javascript" src="../js/jquery.ui.map.extensions.js"></script> 
排队

dirService = new google.maps.directionService();
我不明白为什么脚本返回错误。。。。有人能帮我吗? 对不起,我的英语不好

您的拼写不正确

应该是:

dirService = new google.maps.directionsService();
不是:


我调用directionRenderer right调用directionRenderer抱歉,我还有一个关于这个脚本的问题,现在一切正常,但是脚本返回零结果,GPS坐标是正确的,并且在google maps中进行了测试,为什么我会收到这个返回值?不知道。你是如何测试坐标的?我是从你发布的代码中获取的。是不是不对
var myOrigin=new google.maps.LatLng(46.448327,12.37707);var myDestination=new google.maps.LatLng(46.443993,12.388498)
dirService = new google.maps.directionService();
dirService = new google.maps.directionsService();
dirService = new google.maps.directionService();