Created
April 19, 2016 14:11
-
-
Save virbo/1cd9fd901863f4307a2856ae0851c510 to your computer and use it in GitHub Desktop.
Modifikasi fungsi maps yang ada di file controllers Welcome.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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