Skip to content

Instantly share code, notes, and snippets.

@virbo
Created April 19, 2016 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save virbo/1cd9fd901863f4307a2856ae0851c510 to your computer and use it in GitHub Desktop.
Save virbo/1cd9fd901863f4307a2856ae0851c510 to your computer and use it in GitHub Desktop.
Modifikasi fungsi maps yang ada di file controllers Welcome.php
public function maps()
{
$this->load->model('alumni_model','alumni');
$config = array();
$config['center'] = 'jakarta';
$config['zoom'] = 'auto';
$this->googlemaps->initialize($config);
$temp_result = $this->alumni->get_location()->result();
$marker = array();
foreach ($temp_result as $value) {
$marker['position'] = $value->desa.', '.$value->prop;
// parameter onclick digunakan untuk mennampilkan popuo windows dalam bentuk modals
$marker['onclick'] = 'javascript:showModal(\''.$value->id_wil.'\')';
//$marker['infowindow_content'] = ''.$value->nm_alumni.'<br>Lokasi: '.$value->desa.', '.$value->prop.'';
//$marker['title'] = ''.$value->nm_alumni.'\n'.$value->desa.', '.$value->prop.'';
$this->googlemaps->add_marker($marker);
}
$data['map'] = $this->googlemaps->create_map();
$this->load->view('maps_view', $data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment