Advertisement
Guest User

GMAPS CONTROLLER

a guest
Apr 24th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3.  
  4. class Welcome extends CI_Controller {
  5.    
  6.     function __construct(){
  7.         parent::__construct();
  8.     }
  9.    
  10.     public function index(){
  11.         $this->load->library('googlemaps');
  12.         $config['apiKey']       = 'isi api keynya'; // isi api key
  13.         $config['center']       = "0.8513527, 104.6020902";
  14.         $config['zoom']         = "auto";              
  15.         $config['places']       = TRUE;
  16.         $this->googlemaps->initialize($config);
  17.         $marker = array();
  18.         $marker['position'] = "0.8513527, 104.6020902";
  19.         $marker['infowindow_content'] = 'Contoh Marker';
  20.         $this->googlemaps->add_marker($marker);
  21.         $data['map'] = $this->googlemaps->create_map();
  22.         $this->load->view('welcome_message', $data);
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement