【发布时间】:2013-07-13 11:36:13
【问题描述】:
我正在开发 Cakephp 2.x .. 我已经在我的应用程序中实现了谷歌地图 ...我正在使用这个助手
https://github.com/marcferna/CakePHP-GoogleMapHelper
我想要的是根据经度和纬度获取地址.. 不知道我怎么能得到这个,因为我以前从未在谷歌地图上工作过......
这是显示地图的视图页面的代码
$map_options = array(
'id' => 'map_canvas',
'width' => '950px',
'height' => '600px',
'style' => '',
'zoom' => 16,
'type' => 'ROADMAP',
'custom' => null,
'localize' => false,
'latitude' => $latitude,
'longitude' => $longitude,
'address' => '1 Infinite Loop, Cupertino',
'marker' => true,
'markerTitle' => 'This is my position',
'markerIcon' => 'http://google-maps-icons.googlecode.com/files/home.png',
'markerShadow' => 'http://google-maps-icons.googlecode.com/files/shadow.png',
'infoWindow' => true,
'windowText' => 'My Position'
);
?>
<?php echo $this->GoogleMap->map($map_options);
【问题讨论】:
-
可能想查看此链接,了解如何从地址stackoverflow.com/a/8633623/2003890获取经度和纬度
-
好吧,我有经度和纬度...我想在这两个的基础上检索地址...在简单的 php 中,我们可以执行格式化地址之类的操作
标签: google-maps cakephp google-maps-api-3 cakephp-2.0 cakephp-2.1