Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.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上查找商业页面的CID和LRD_Javascript_Google Maps_Google Places Api_Google My Business Api - Fatal编程技术网

Javascript 在Google上查找商业页面的CID和LRD

Javascript 在Google上查找商业页面的CID和LRD,javascript,google-maps,google-places-api,google-my-business-api,Javascript,Google Maps,Google Places Api,Google My Business Api,我想知道如何在Google上找到特定商业页面的LRD和CID 我试图构建的示例URL如下 https://www.google.com/#q=takeout+banani&lucid="CID"&lrd=0x3755c7120ec9e20f:0x8889d4d79e711995,3 到目前为止,我发现没有任何直接的方法可以同时找到CID和LRD 我必须进行两次API调用才能得到CID,如下所示 "url": "https://maps.google.com/?cid=48390

我想知道如何在Google上找到特定商业页面的LRD和CID

我试图构建的示例URL如下

https://www.google.com/#q=takeout+banani&lucid="CID"&lrd=0x3755c7120ec9e20f:0x8889d4d79e711995,3
到目前为止,我发现没有任何直接的方法可以同时找到CID和LRD

我必须进行两次API调用才能得到CID,如下所示

"url": "https://maps.google.com/?cid=4839020573042712727",
但是,有没有其他方法可以像下面的place_id那样直接访问api中的字段

"place_id": "ChIJrQFQG6PHVTcRl6AErZKnJ0M"
现在谈到LRD部分,我如何才能找到它?在这个细节API中

https://maps.googleapis.com/maps/api/place/details/json?reference="Referense key from place request api"&sensor=true&key="Your API Key"
LRD也没有直接字段

因此,我如何在这些格式中获取或找到LRD0x[HEX\u CODE1]:0x[HEX\u CODE2]

我将下面的问题链接起来作为参考


阅读此答案以获得CID:

两个API请求,您将以编程方式获得业务的CID

编辑----------

LRD是十六进制的CID。您可以使用此功能来:

function dec2hex($number)
{
    $hexvalues = array('0','1','2','3','4','5','6','7',
               '8','9','A','B','C','D','E','F');
    $hexval = '';
     while($number != '0')
     {
        $hexval = $hexvalues[bcmod($number,'16')].$hexval;
        $number = bcdiv($number,'16',0);
    }
    return $hexval;
}
因此,您可以像这样构建Google Review Url:

$business_url = "https://www.google.com/search?q=NAMEOFBUSINESS&ludocid=YOURCID#lrd=0x0:0xYOURHEXCID,1";