Jump to content

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!

Edited by ShoeLace1291
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.