I did my searching but unfortunately didnt find relevant solution. I want to do it by using codeigniter google map library. i am following this link But it is just showing starting and ending point, it's not creating multiple pins like
This is making multiple pins with polyline but i want routing like:
with multiple pins as shown in polyline map picture.. Is it posible to get multiple directions with multiple pins ??
I tried it but my trick couldn't work. i tried it by using while loop and i incremented the variable before ending point to make my direction like
- 1st lat, long : starting point
- 2nd lat, long : ending point
- 2nd lat, long : starting point
- 3rd lat, long : ending point
- 3rd lat, long : starting point
- 4th lat, long : ending point
But it's only making 1st and last ending point for start and end direction
Here is my controller function
##Load library
$this->load->library('googlemaps');
## Getting data from db
$final_data['final_data'] = $this->Main_manager->getAllEmailLogsById($id);
$email = $final_data['final_data'][0]['email'];
$date = $final_data['final_data'][0]['date'];
$file = 'assets/email_logs/'.$email.'-'.str_replace(' ','-',$date).'.txt';
## Getting lat long data from txt file
$logData = file_get_contents($file);
$logData = json_decode($logData, true);
$marker = array();
$logs = count($logData['logs']);
$config['center'] = $final_data['final_data'][0]['lat'].','. $final_data['final_data'][0]['long'];
$config['zoom'] = 'auto';
$i=0;
while($i<$logs-1):
$config['position'] = $logData['logs'][$i]['lat'].','. $logData['logs'][$i]['long'];
$config['infowindow_content'] = $logs['email'];
$config['animation'] = 'DROP';
$config['draggable'] = FALSE;
$config['directions'] = TRUE;
$config['directionsStart'] = $logData['logs'][$i]['lat'].','. $logData['logs'][$i]['long'];
$i++;
$config['directionsEnd'] = $logData['logs'][$i]['lat'].','. $logData['logs'][$i]['long'];
$config['directionsDivID'] = 'directionsDiv';
endwhile;
## initialize the map
$this->googlemaps->initialize($config);
##create map
$final_data['map'] = $this->googlemaps->create_map();
$this->load->view('administrator/header');
$this->load->view('administrator/view_logs_detail', $final_data);