i want to drop multiple pin in google map with dynamic value so below is my code .
VIEW
<html>
<head><?php echo $map['js']; ?></head>
<body><?php echo $map['html']; ?></body>
Controller
function index(){
$address ="Gondal Road, Dr. Yagnik Road Corner, Near Malaviya Petrol Pump, Rajkot, Gujarat 360001";// Google HQ
$prepAddr = str_replace(' ','+',$address);
$geocode=file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$prepAddr.'&sensor=false');
$output= json_decode($geocode);
$lat = $output->results[0]->geometry->location->lat;
$long = $output->results[0]->geometry->location->lng;
$this->load->library('googlemaps');
$config['center'] = '37.4419, -122.1419';
$config['zoom'] = 'auto';
$this->googlemaps->initialize($config);
$marker = array();
$marker['position'] = $lat.','.$long;
$marker['infowindow_content'] = $address;
$marker['icon'] = 'http://chart.apis.google.com/chart? chst=d_map_pin_letter&chld=A|9999FF|000000';
$this->googlemaps->add_marker($marker);
$marker = array();
$marker['position'] = '37.409, -122.1319';
$marker['draggable'] = TRUE;
$marker['animation'] = 'DROP';
$this->googlemaps->add_marker($marker);
$marker = array();
$marker['position'] = '37.449, -122.1419';
$marker['onclick'] = 'alert("You just clicked me!!")';
$this->googlemaps->add_marker($marker);
$data['map'] = $this->googlemaps->create_map();
$this->load->view('test',$data);
}
When i run above code only single pin is drop but i want multiple pins with dynamic value so how can i make it possible ? your all suggestion will be appreciable .