Drawing route on map, with multiple markers, CodeIgniter
<p>I did my searching but unfortunately didnt find relevant solution. I want to do it by using <strong>codeigniter google map library</strong>. i am following this
<a href="http://biostall.com/demos/google-maps-v3-api-codeigniter-library/directions" rel="nofollow">link</a>
But it is just showing <strong>starting and ending point</strong>, it's not creating <strong>multiple pins</strong> like </p>

<p><a href="https://i.stack.imgur.com/Fb775.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/Fb775.jpg" alt="enter image description here"></a></p>

<p>This is making multiple pins with polyline but i want routing like: </p>

<p><a href="https://i.stack.imgur.com/sji5L.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/sji5L.jpg" alt="enter image description here"></a></p>

<p>with multiple pins as shown in <strong>polyline</strong> map picture.. Is it posible to get <strong>multiple directions with multiple pins</strong> ??</p>

<p>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</p>

<ol>
<li>1st lat, long : starting point</li>
<li>2nd lat, long : ending point</li>
<li>2nd lat, long : starting point</li>
<li>3rd lat, long : ending point</li>
<li>3rd lat, long : starting point</li>
<li>4th lat, long : ending point</li>
</ol>

<p>But it's only making 1st and last ending point for start and end direction</p>

<p>Here is my <strong>controller</strong> function </p>

<pre><code>##Load library
$this-&gt;load-&gt;library('googlemaps');

## Getting data from db
     $final_data['final_data'] = $this-&gt;Main_manager-&gt;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&lt;$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-&gt;googlemaps-&gt;initialize($config);

    ##create map
    $final_data['map'] = $this-&gt;googlemaps-&gt;create_map();

    $this-&gt;load-&gt;view('administrator/header');
    $this-&gt;load-&gt;view('administrator/view_logs_detail', $final_data);
</code></pre>