body, true); if (count($place['results']) > 0) { $name = $place['results'][0]['formatted_address']; } } catch (Exception $e) { debug_event('gmaps', 'Error getting location name: ' . $e->getMessage(), 1); } return $name; } public function display_map($pts) { if (!$this->api_key) { debug_event('gmaps', 'Missing api key, display map plugin skipped.', 3); return false; } echo '' . "\n"; echo '
' . "\n"; return true; } /** * load * This loads up the data we need into this object, this stuff comes * from the preferences. */ public function load($user) { $user->set_preferences(); $data = $user->prefs; if (strlen(trim($data['gmaps_api_key']))) { $this->api_key = trim($data['gmaps_api_key']); } return true; } // load }