Jump to content

Codeigniter And Google Map Api... Blank Map


ShoeLace1291

Recommended Posts

I am using CodeIgniter to develop my website, so I downloaded a Google Map API class for it. I think I have everything set up correctly, however, I still get a blank map... just a square, grey box. I have no idea what is causing this. It won't work in both firefox and IE.

 

Here is my controller:

<?php

class Maps extends CI_Controller {

function index(){

	$this->load->library('GMap');
	$this->gmap->GoogleMapAPI();

	$extraJS = '
	'.$this->gmap->getHeaderJS().'
	'.$this->gmap->getMapJS().'
	';

	$this->_global->overall_header('Outbreak Map', $extraJS);

	$this->gmap->setMapType('map');
	$this->gmap->setWidth('800px');
	$this->gmap->setHeight('600px');

	$data = array(
		'MAP_onload' => $this->gmap->printonload(),
		'MAP_DISPLAY' => $this->gmap->printMap(),
		'MAP_SIDEBAR' => $this->gmap->printSidebar()			
	);

	$this->parser->parse('map_index.tpl', $data);
}
}

 

The header view:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>MySitek</title>
 <link rel="stylesheet" href="{CSS_DIR}/style.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript" src="{JS_DIR}/jkoutlinemenu.js"></script>

{EXTRA_JS}
</head>

<body>

 

The map_index.tpl file:

{MAP_onload}
 <div id="content">

	 <div class="widget full">

		 <div class="pad">

			 {MAP_DISPLAY}
			 {MAP_SIDEBAR}

		 </div>

	 </div>

 </div>

 

The class I am using can be found here:

http://codeigniter.c...wthread/164367/

 

This is getting really frustrating because I can't figure out what the problem is and I know it will be something smple causing it... Any help is appreciated!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.