Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/444.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript google map api错误:属性中有错误<;航路点>;:_Javascript_Google Maps Api 3 - Fatal编程技术网

Javascript google map api错误:属性中有错误<;航路点>;:

Javascript google map api错误:属性中有错误<;航路点>;:,javascript,google-maps-api-3,Javascript,Google Maps Api 3,我试图在GoogleMapsAPI上设置一些航路点,但出现以下错误。我知道这和设置一个对象有关,但我似乎做不好。我也找不到关于它的确切文章 Error: Error in property <waypoints>: (Invalid value: Ballybricken, Waterford, Ireland,The Glen, Waterford (Error in element at position 0: (Unknown property <0>))) 航路

我试图在GoogleMapsAPI上设置一些航路点,但出现以下错误。我知道这和设置一个对象有关,但我似乎做不好。我也找不到关于它的确切文章

Error: Error in property <waypoints>: (Invalid value: Ballybricken, Waterford, Ireland,The Glen, Waterford (Error in element at position 0: (Unknown property <0>)))

航路点不是地址或latLng,它是由(必需的)
位置
-成员和(可选的)
中途站
-成员组成的对象,因此您的阵列应如下所示:

var waypts = [{location:"Ballybricken"},
              {location:"Waterford"},
              {location:"Ireland"},
              {location:"The Glen"},
              {location:"Waterford"}];
var waypts = [{location:"Ballybricken"},
              {location:"Waterford"},
              {location:"Ireland"},
              {location:"The Glen"},
              {location:"Waterford"}];