Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.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
php使用xml文件中的纬度和经度获取google地图全景id_Php_Xml_Google Maps - Fatal编程技术网

php使用xml文件中的纬度和经度获取google地图全景id

php使用xml文件中的纬度和经度获取google地图全景id,php,xml,google-maps,Php,Xml,Google Maps,我想使用纬度和经度获取街景全景id。我是从这个链接上得到的。 它返回xml输出,我想从中获取pano_id。如果你能得到A、B和C,所有的全景ID都会非常感激 <panorama> <data_properties image_width="13312" image_height="6656" tile_width="512" tile_height="512" image_date="2012-08" pano_id="dIT1qZK8wyNVROwryyiN8g" i

我想使用纬度和经度获取街景全景id。我是从这个链接上得到的。

它返回xml输出,我想从中获取pano_id。如果你能得到A、B和C,所有的全景ID都会非常感激

<panorama>
  <data_properties image_width="13312" image_height="6656" tile_width="512" tile_height="512" image_date="2012-08" pano_id="dIT1qZK8wyNVROwryyiN8g" imagery_type="1" num_zoom_levels="3" lat="40.714131" lng="-74.006188" original_lat="40.714096" original_lng="-74.006246" elevation_wgs84_m="-19.853310" best_view_direction_deg="120">
    <copyright>© 2013 Google</copyright>
    <text>Chambers Street</text>
    <street_range>66</street_range>
    <region>New York</region>
    <country>United States</country>
  </data_properties>
  <projection_properties projection_type="spherical" pano_yaw_deg="130.9" tilt_yaw_deg="-82.94" tilt_pitch_deg="1.15"/>
  <annotation_properties>
    <link yaw_deg="123.44" pano_id="l-oSyXcA8I9emj2IVGslvw" road_argb="0x80fffa73" scene="0">
      <link_text>Chambers Street</link_text>
    </link>
    <link yaw_deg="302.91" pano_id="TKBUYV2jeHoA7HTwX5bx7A" road_argb="0x80fffa73" scene="0">
      <link_text>Broadway / Chambers Street</link_text>
    </link>
  </annotation_properties>
</panorama>

©2013谷歌
钱伯斯街
66
纽约
美国
钱伯斯街
百老汇/钱伯斯街
您想使用PHP的


非常感谢你的朋友。它工作得很好。太好了@如果答案解决了您的问题,请接受它(单击相应答案旁边的复选标记)。我已接受…对于一般问题,请先使用搜索并查看常见问题解答,每个标签都有一个。
<?php

$xml = new SimpleXMLElement(file_get_contents('http://cbk0.google.com/cbk?output=xml&ll=40.714103,-74.006206'));

foreach ($xml->data_properties as $element) {
    echo $element->attributes()->pano_id . "<br/>";
}

foreach ($xml->annotation_properties->link as $element) {
    echo $element->attributes()->pano_id . "<br/>";
}