Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/10.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 maps islocationonedge?_Javascript_Google Maps - Fatal编程技术网

Javascript 如何在服务器上使用google maps islocationonedge?

Javascript 如何在服务器上使用google maps islocationonedge?,javascript,google-maps,Javascript,Google Maps,我正在尝试从服务器端使用GoogleMapsAPI中的函数(使用node.js) 我想看看谷歌地图上是否有一个点,指示从a点到B点的路线 isLocationOnEdge(point:LatLng, poly:Polygon|Polyline, tolerance?:number) 我使用了GoogleMaps文档中的示例代码,并添加了一个console.log语句。但是,它不会向控制台输出任何内容 function initialize() { var mapOptions = {

我正在尝试从服务器端使用GoogleMapsAPI中的函数(使用node.js) 我想看看谷歌地图上是否有一个点,指示从a点到B点的路线

isLocationOnEdge(point:LatLng, poly:Polygon|Polyline, tolerance?:number)
我使用了GoogleMaps文档中的示例代码,并添加了一个console.log语句。但是,它不会向控制台输出任何内容

function initialize() {
   var mapOptions = {
   zoom: 5,
   center: new google.maps.LatLng(24.886, -70.269),
   mapTypeId: google.maps.MapTypeId.TERRAIN
};

var map = new google.maps.Map(document.getElementById('map-canvas'),
  mapOptions);

var cascadiaFault = new google.maps.Polyline({
   paths: [
     new google.maps.LatLng(49.95, -128.1),
     new google.maps.LatLng(46.26, -126.3),
     new google.maps.LatLng(40.3, -125.4)
   ]
 });

 var myPosition = new google.maps.LatLng(43.0, -125.9, 10e-7);
   console.log('google.maps.geometry.poly.isLocationOnEdge(myPosition, cascadiaFault))');
}

另一个堆栈溢出问题是在http请求中包含此url 但我知道我实际上需要以某种方式包括islocationonedge参数。 我应该请求吗 ,多段线:[adfasd,SDF,adfasdf,adfasd],0.0001)

非常感谢您的帮助

我想这样做:

  • 检查(moshen/node谷歌地图)
  • 阅读此代码
  • f、 有一个函数createEncodedPolyline(points){..}
  • 逐步尝试重新创建对Google Geometry库的请求

你能让它在客户端工作吗?我不能,它说google没有定义。那么你没有包含库。但是我如何创建对google geometry库的请求?