欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php使用google地图接口开发应用的例子

程序员文章站 2022-05-07 20:35:51
...
  1. function selected ( $param , $value ) {
  2. if ( $param == $value ) print "SELECTED" ;
  3. }
  4. # Collect any form data to control the display
  5. $scale = 10 ;
  6. $maptype = "G_NORMAL_MAP" ;
  7. if ( $_REQUEST [ scale ]) $scale = $_REQUEST [ scale ];
  8. if ( $_REQUEST [ maptype ]) $maptype = $_REQUEST [ maptype ];
  9. # Geocoding your location
  10. # Note - you would cache this in a file
  11. # The key is domain specific - your google maps教程 key
  12. /*
  13. $location = file("http://maps.google.com/maps/geo?q=48+Spa+Road,+Melksham,+UK&
  14. output=csv&key=ABQIAAAAvp3__HwvT3VkixIIbsW0axQuKI_6t1bH2P0vCI_Q8jfpn8qdNBQMnnelj
  15. xh9czilkau_bYSCXteS_A");
  16. */
  17. # Following line is hard coded for demo
  18. $location [ 0 ]= "200,8,51.369318,-2.133457" ;
  19. list ( $stat , $acc , $north , $east ) = explode ( "," , $location [ 0 ]);
复制代码

html页面:

  1. php调用谷歌地图接口 - www.plcxue.com
  2. Well House Manor, Melksham

  3. php使用google地图接口开发应用的例子
  4. ? Business Hotel in Melksham
  5. ? All rooms fitted to superior standard
  6. ? Internet Access throughout
  7. ? Plenty of parking and close to town centre

  8. Well House
  9. Manor website

  10. Change to

  11. This is a sample PHP page with Google Maps
  12. teach you how to write pages like this
  13. Date - = date ( "F, jS l Y" ) ?>
复制代码