Welcome Guest, Not a member yet? Register   Sign In
Google Map
#6

[eluser]RobertB.[/eluser]
Go here to get the class Class

cigooglemapi.php
Code:
require('GoogleMapAPI.class.php');

class CiGoogleMapAPI extends GoogleMapAPI{
function CiGoogleMapAPI(){

        parent::GoogleMapAPI();
        }
}

Put both the class and the cigoogleapi.php in the application/library folder
I'm using includes so..

<head>
Code:
<?php $this->cigooglemapapi->printHeaderJS(); ?>
<?php $this->cigooglemapapi->printMapJS(); ?>

listing (Controller)
Code:
function __construct()
    {
        parent::Controller();
        $this->load->model('listings_model');
        $this->load->library('Cigooglemapapi');
        $this->cigooglemapapi->setAPIKey('Your API');
    }

function entry()
    {        
        $data['entry'] = $this->listings_model->getEntryDetail();
        
        $address = $data['entry']->address.' '.$data['entry']->city.' '.$data['entry']->state.' '.$data['entry']->zip;
        $business = $data['entry']->business;
        
        $this->cigooglemapapi->addMarkerByAddress($address, $business, '<strong>'.$business.'</strong>');
        
        $data['main_content'] = 'detail_view';    
        $this->load->view('templates/template', $data);


listing_view (view)
Code:
&lt;?php $this->cigooglemapapi->printMap(); ?&gt;

Let me know if this helped.


Messages In This Thread
Google Map - by El Forum - 03-10-2010, 09:20 AM
Google Map - by El Forum - 03-11-2010, 12:09 AM
Google Map - by El Forum - 03-11-2010, 01:55 AM
Google Map - by El Forum - 03-11-2010, 05:05 PM
Google Map - by El Forum - 03-11-2010, 05:33 PM
Google Map - by El Forum - 03-11-2010, 06:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB