ShoeLace1291 Posted September 25, 2012 Share Posted September 25, 2012 (edited) 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 September 25, 2012 by ShoeLace1291 Quote Link to comment https://forums.phpfreaks.com/topic/268767-codeigniter-and-google-map-api-blank-map/ Share on other sites More sharing options...
Mahngiel Posted September 25, 2012 Share Posted September 25, 2012 have you done any debugging like checking your property values ensuring there's actual data there, or checking the logs to see if there are any errors? Quote Link to comment https://forums.phpfreaks.com/topic/268767-codeigniter-and-google-map-api-blank-map/#findComment-1380931 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.