EmbedGoogleMapHtmlBuilder

The Embed Google Map EmbedGoogleMapHtmlBuilder class.

Defined (1)

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

/embed_google_map.php  
  1. abstract class EmbedGoogleMapHtmlBuilder { 
  2. abstract public function buildHtml(&$params); 
  3.  
  4. protected function getUrl(&$params, $baseUrl) { 
  5. $url = ""; 
  6. if($params->isLink() == 1 && $params->isGoogleMapsEngine() == 0) { 
  7. $url = $params->getAddress(); 
  8. } else if($params->isGoogleMapsEngine() == 1) { 
  9. $url = $params->getAddress(); 
  10. $alternatives = array("/edit", "/viewer"); 
  11. $url = str_replace($alternatives, '/embed', $url); 
  12. } else { 
  13. $url = $baseUrl; 
  14. if($params->getHttps() == 1) { 
  15. $url = str_replace('http://', 'https://', $url); 
  16. return $url; 
  17.  
  18. protected function getIFrameBegin(&$params) { 
  19. $width="width='".$params->getWidth()."'"; 
  20. $height="height='".$params->getHeight()."'"; 
  21. $style="style='border: ".$params->getBorder()."px ".$params->getBorderStyle()." ".$params->getBorderColor()."'"; 
  22. return "\n<iframe $width $height $style "; 
  23.  
  24. protected function getLinkHtml($url, $label) { 
  25. return "<div><a href='$url' target='new'>$label</a></div>\n";