【发布时间】:2014-07-22 14:22:33
【问题描述】:
我每 15 分钟保存一次纬度和经度。我需要在codeigniter中用谷歌地图上保存的数据标记绘制一条路线。一些例子给出了起点和终点,但我需要在地图上显示我的数据库值。请就该主题提出一些解决方案。
控制器方法:
public function geoLocation(){
$this->load->library('googlemaps');
$config['center'] = '37.4419, -122.1419';
$config['zoom'] = 'auto';
$config['directions'] = TRUE;
$config['directionsStart'] = 'Hadapsar, Pune, India';
//$config['directionsDivID'] = 'swargate, Pune, India';
$config['directionsEnd'] = 'swargate, Pune, India';
$config['directionsStart'] = 'swargate, Pune, India';
//$config['directionsDivID'] = 'swargate, Pune, India';
$config['directionsEnd'] = 'Bavdhan, Pune, India';
$this->googlemaps->initialize($config);
$data['map'] = $this->googlemaps->create_map();
$this->load->view('google-map', $data);
}
我的看法:
<html>
<head><?php echo $map['js']; ?></head>
<body><?php echo $map['html']; ?></body>
<div id="directionsDiv"></div>
</html>
检查上面我有三点:Hadapsar、swargate、Bavdhan。我想画三个车站的路线。
【问题讨论】:
-
到目前为止你尝试了什么,你能展示一些你已经写的代码吗?
-
我在codeigniter框架(PHP)中尝试过。看一下代码并找到好的解决方案。
标签: codeigniter google-maps gps