Example #1
0
 /**
  * Get a link to open a poi and optionally zoom in on it
  *
  * $args:
  *   text - text to print for the link, default is poi title
  *   zoom - false (default) = no zoom | true = zoom in to viewport (ignored for lat/lng pois with no viewport) | number = set zoom (0-15)
  *
  * @param mixed $map - map on which the poi should be opened
  * @param mixed $args
  * @return mixed
  */
 function get_open_link($args = '')
 {
     $map = $this->map();
     extract(wp_parse_args($args, array('title' => $this->get_title(), 'zoom' => null)));
     $i = array_search($this, $map->pois);
     $zoom = Mappress::boolean_to_string($zoom);
     return "<a href='#' onclick='{$map->name}.getPoi({$i}).open({$zoom}); return false;' >{$title}</a>";
 }