Changeset 1513 for g-map/files/lib/data/gmap/GmapApi.class.php
- Timestamp:
- 02/26/12 10:28:14 (15 months ago)
- Files:
-
- 1 modified
-
g-map/files/lib/data/gmap/GmapApi.class.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
g-map/files/lib/data/gmap/GmapApi.class.php
r1494 r1513 8 8 */ 9 9 class GmapApi extends DatabaseObject { 10 protected $apikey = null;11 10 protected $cache_search = array(); 12 11 13 12 /** 14 * creates new instance15 */16 public function __construct() {17 $apikey = GMAP_API_KEY;18 $apikey = explode("\n", StringUtil::unifyNewlines($apikey));19 $apikey = $apikey[0];20 $apikey = explode(":", $apikey);21 22 // this is the way, woltlab wants the users to enter their api key23 if(count($apikey) == 2) {24 $this->apikey = $apikey[1];25 }26 27 // this is the way, almost all of the woltlab users really enter their api key28 else if(!empty($apikey)) {29 $this->apikey = $apikey[0];30 }31 }32 33 /**34 13 * is active? api key existent? 35 * 14 * @deprecated no api key needed any longer 36 15 * @return boolean 37 16 */ 38 17 public function isActive() { 39 return !empty($this->apikey);18 return true; 40 19 } 41 20 … … 84 63 */ 85 64 public function search($location) { 86 if(!$this->isActive()) {87 return;88 }89 90 65 if (CHARSET != 'UTF-8') { 91 66 $location = StringUtil::convertEncoding(CHARSET, 'UTF-8', $location); … … 97 72 } 98 73 99 $url = "http://maps.google.com/maps/geo?q=".$lookupstring."& key=".$this->apikey."&output=csv";74 $url = "http://maps.google.com/maps/geo?q=".$lookupstring."&output=csv"; 100 75 101 76 require_once(WCF_DIR.'lib/util/FileUtil.class.php');
