Google Maps Markers Class

Derek Jones edited this page Jul 5, 2012 · 13 revisions
Clone this wiki locally

Category:Contributions | Category:Contributions::Libraries | Category:Contributions::Libraries::Google Maps

The Google Maps Markers Class is a simple class made so that anyone not proficient enough in javascript and the new Google Maps V3.1 API can have access to maps and place markers.

As this is a complex issue, I have put up a demo page with help and code download which you can find : here.

All you really need to do to make this class work is to provide an array of markers and call the generation function.

Here is an example controller to it's simplest expression:

$this->load->library('google_maps_markers'); // load the class
$this->google_maps_markers->initialize();   // initialize the class

$markers = array (  // provide some markers with appropriate information
    "1"  => array ( 
            "image" => "image5",
            "title" => "Home",
            "lat" =>  46.55413079,
            "lng" => -72.12170362,
            "contentString" => "<h1>Home</h1>Where Google Maps Markers Class was written" ) );
$data['google_maps_markers'] = $this->google_maps_markers->create_map($markers);
$this->load->view('container_google_maps_markers', $data); // load the view