function index() { $this->pageTitle = 'Party Map'; $this->set('current', 'map'); if (!empty($this->data)) { $gcoder = new webServices(array('type' => 'geocode')); $loc = $gcoder->geocode($this->data['Party']['mloc']); if ($loc) { $this->set('map', 'initMashUp(' . $loc['lat'] . ', ' . $loc['lng'] . ');'); } else { $this->set('map', 'initMashUp();'); } } else { $this->set('map', 'initMashUp();'); } }