*/ /** * patTemplate modfifier GeoURI * * Geo URI for Firefox. This is sort of a hack * * @package patTemplate * @package Modifiers * @author gERD Schaufelberger */ class patTemplate_Modifier_Geouri extends patTemplate_Modifier { /** * Modify the Value * * @param string value * @param array $params * @return string modified value */ public function modify($value, $params = array()) { $params = array_merge(array( 'lat' => '', 'lon' => '' ), $params); if (!empty($_SERVER['HTTP_USER_AGENT']) && stristr($_SERVER['HTTP_USER_AGENT'], 'firefox')) { // return sprintf('https://www.openstreetmap.org/directions/?to=%s,%s', $params['lat'], $params['lon']); return sprintf('https://www.google.com/maps/dir/?api=1&destination=%s,%s', $params['lat'], $params['lon']); } return sprintf('geo:%s,%s', $params['lat'], $params['lon']); } }