3maps?callback=___onAPILoaded&v=2.0&key=b6cfcb9321a64e81331f10bdb1b08343&plugin=:1 Uncaught Error: Invalid Object: LngLat(NaN, NaN)
时间: 2023-11-25 08:38:56 浏览: 163
根据提供的引用内容,可以看出这是一个关于使用高德地图API的代码片段。在引用[1]和引用中,变量url被定义为一个包含API版本号、密钥和回调函数的URL字符串。而在引用[2]中,我们可以看到两个js文件的来源链接。
至于你提到的错误信息"3maps?callback=___onAPILoaded&v=2.0&key=b6cfcb9321a64e81331f10bdb1b08343&plugin=:1 Uncaught Error: Invalid Object: LngLat(NaN, NaN)",它可能是由于某个地理坐标的无效性导致的。具体原因需要进一步调试代码才能确定。你可以仔细检查代码中涉及到坐标的部分,确保坐标值的有效性。
相关问题
maps?callback=___onAPILoaded&v=2.0&key=0fee554d55df696f82d379e39d94951c&plugin=:1 Uncaught Error: Invalid Object: LngLat(NaN, NaN) at new r (maps?callback=___onAPILoaded&v=2.0&key=0fee554d55df696f82d379e39d94951c&plugin=:1:93388) at new f (maps?callback=___onAPILoaded&v=2.0&key=0fee554d55df696f82d379e39d94951c&plugin=:1:556776) at Vt.getData (maps?callback=___onAPILoaded&v=2.0&key=0fee554d55df696f82d379e39d94951c&plugin=:1:572228) at Gi.getData (maps?callback=___onAPILoaded&v=2.0&key=0fee554d55df696f82d379e39d94951c&plugin=:1:610975) at e.renderFrame (eval at nS (maps?callback=___onAPILoaded&v=2.0&key=0fee554d55df696f82d379e39d94951c&plugin=:1:188836), <anonymous>:1:419021) at x.Yf (maps?callback=___onAPILoaded&v=2.0&key=0fee554d55df696f82d379e39d94951c&plugin=:1:731601) at maps?callback=___onAPILoaded&v=2.0&key=0fee554d55df696f82d379e39d94951c&plugin=:1:115404
这个错误看起来是在使用地图API时出现的问题。根据错误信息,它指出了一个无效的对象,其中包含了一个经度(Lng)和纬度(Lat)的值为NaN(不是一个数字)。
这可能是由于传递给地图API的坐标参数无效或不存在的原因导致的。你可以检查一下传递给地图API的参数,确保经纬度的值是有效的数字。
如果你能提供更多关于如何使用地图API的上下文信息,我可以给出更具体的建议。
链接为https://wkrtcs.bdimg.com/rtcs/webapp?callback=sf_edu_wenku_jsonp1&md5sum=017fe7d24f326b6a11429c21b9fc0313&sign=ceaf6551e4&rtcs_flag=2&rtcs_ver=4&range=0-11670_11671-&bucketNum=1001&rsign=p_3-r_0-s_b438b&pn=1&rn=2,使用php取出所有c字段 t字段 r字段到二维数组
可以使用 PHP 中的 cURL 库来获取这个链接的内容,并且使用正则表达式来提取所需的字段。以下是一个示例代码:
```php
<?php
$url = "https://wkrtcs.bdimg.com/rtcs/webapp?callback=sf_edu_wenku_jsonp1&md5sum=017fe7d24f326b6a11429c21b9fc0313&sign=ceaf6551e4&rtcs_flag=2&rtcs_ver=4&range=0-11670_11671-&bucketNum=1001&rsign=p_3-r_0-s_b438b&pn=1&rn=2";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
// 使用正则表达式提取所需字段
preg_match_all("/\"c\":\"(.*?)\",\"t\":\"(.*?)\",\"r\":\"(.*?)\"/", $output, $matches);
$data = array();
for ($i = 0; $i < count($matches[0]); $i++) {
$data[$i]['c'] = $matches[1][$i];
$data[$i]['t'] = $matches[2][$i];
$data[$i]['r'] = $matches[3][$i];
}
print_r($data);
?>
```
上述代码中,我们首先使用 cURL 库获取了链接中的内容,然后使用正则表达式提取了所有的 c 字段、t 字段和 r 字段,并将它们存储在一个二维数组中。最后使用 print_r 函数打印出这个数组。
阅读全文
相关推荐
















