and my data is stored in a database and pulled in using the contollers and models:
if ($query->num_rows()>0) {
foreach ($query->result() as $row) {
array_push($return, $row);
}
}
return $return;
}
$this->load->library('googlemaps');
$this->load->model('home_model', '', TRUE);
$this->googlemaps->initialize();
$coords = $this->home_model->get_coordinates();
foreach ($coords as $coordinate) {
if($coordinate->type == "restaurant"){
$image = 'http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=A|FF0000|000000';
}
if($coordinate->type == "bar"){
$image = 'http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=B|FFFFFF|000000';
}
$marker = array('id'=> $coordinate->type, 'position' => $coordinate->lat.','.$coordinate->lng, 'icon' => $image, 'infowindow_content' =>$coordinate->address);
$this->googlemaps->add_marker($marker);
}
$data = array();
$data['map'] = $this->googlemaps->create_map();
$data['page_title'] = "Home";
$data['content'] = "home";
$this->load->view('template', $data);
Does anyone have any idea with this library to add a toggle feature in as i cant even do a click event and alert anything out!
Just unsure of where and how to edit and keep what i write as the js variable keeps changing it!