EmbedGoogleMapClassicHtmlBuilder

The Embed Google Map EmbedGoogleMapClassicHtmlBuilder class.

Defined (1)

The class is defined in the following location(s).

/embed_google_map.php  
  1. class EmbedGoogleMapClassicHtmlBuilder extends EmbedGoogleMapHtmlBuilder { 
  2.  
  3. private $baseUrl = "http://maps.google.com/"; 
  4.  
  5. public function buildHtml(&$params) { 
  6. $url = parent::getUrl($params, $this->baseUrl); 
  7.  
  8. $html = parent::getIFrameBegin($params); 
  9.  
  10. if($params->isLink() == 0) { 
  11. $url .= "?q=".$params->getAddress(); 
  12. if(strlen($params->getInfoLabel()) > 0) { 
  13. $url .= "(".$params->getInfoLabel().")"; 
  14.  
  15. if($params->isGoogleMapsEngine() == 0) { 
  16. $url .= "&z=".$params->getZoomLevel(); 
  17. $url .= "&t=".$params->getMapType(); 
  18.  
  19. if(strcmp($params->getLanguage(), '-') != 0) { 
  20. $url .= "&hl=".$params->getLanguage(); 
  21.  
  22. $info = ($params->getShowInfo() == 1) ? "" : "&iwloc=near";  
  23.  
  24. // Unicode properties are available only if PCRE is compiled with "--enable-unicode-properties"  
  25. // '\pL' = any Unicode letter 
  26. if (preg_match('/^[^\pL]+$/u', $params->getAddress())) { 
  27. $info = ($params->getShowInfo() == 1) ? "&iwloc=near" : ""; 
  28.  
  29. $url .= $info; 
  30. $html .= "src='$url&output=svembed'></iframe>\n"; 
  31.  
  32. if($params->getAddLink() == 1) { 
  33. $output = ($params->getLinkFull() == 1) ? "&output=svembed" : "&output=classic"; 
  34. if($params->isGoogleMapsEngine() == 1) { 
  35. $url = str_replace('/embed', '/viewer', $url); 
  36. } else { 
  37. $url .= $output; 
  38. $html .= parent::getLinkHtml($url, $params->getLinkLabel()); 
  39. return $html;