加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php使用google地图应用实例

发布时间:2020-12-12 20:36:17 所属栏目:PHP教程 来源:网络整理
导读:本篇章节讲解php使用google地图应用方法。供大家参考研究。具体如下: php代码如下: 代码如下: Collect any form data to control the display $scale = 10 ; $maptype = "G_NORMAL_MAP" ; if ( $_REQUEST [ scale ]) $scale = $_REQUEST [ scale ]

本篇章节讲解php使用google地图应用方法。分享给大家供大家参考。具体如下:

php代码如下:

代码如下:
Collect any form data to control the display

$scale = 10 ;
$maptype = "G_NORMAL_MAP" ;
if ( $_REQUEST [ scale ]) $scale = $_REQUEST [ scale ];
if ( $_REQUEST [ maptype ]) $maptype = $_REQUEST [ maptype ];

Geocoding your location

Note - you would cache this in a file

The key is domain specific - your google maps教程 key

/
$location = file("http://maps.google.com/maps/geo?q=48+Spa+Road,+Melksham,+UK&
output=csv&key=ABQIAAAAvp3__HwvT3VkixIIbsW0axQuKI_6t1bH2P0vCI_Q8jfpn8qdNBQMnnelj
xh9czilkau_bYSCXteS_A");
/

Following line is hard coded for demo

$location [ 0 ]= "200,8,51.369318,-2.133457" ;
list ( $stat,$acc,$north,$east ) = explode ( ",",$location [ 0 ]);

html页面如下:

代码如下:
Well House Manor,Melksham Well House Manor,Melksham
• Business Hotel in Melksham
• All rooms fitted to superior standard
• Internet Access throughout
• Plenty of parking and close to town centre

Well House Manor website
Change to
This is a sample PHP page with Google Maps
teach you how to write pages like this
Date -

</td><td>
<div id="map" style="width: 450px; height: 550px"


</td></tr></table>

希望本文所述对大家的php程序设计有所帮助。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读