X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=lib%2Ffunctions.php;fp=lib%2Ffunctions.php;h=ec0b35ade4763feb1890792972f1f01166b1e107;hb=e2ec797398326b88782988d0b9719e21c278a584;hp=f1e714582ee156e1cab828de32f854390874fc8e;hpb=fccd91bbd28b197569d44f303caf6f997413af7e;p=readifood.git diff --git a/lib/functions.php b/lib/functions.php index f1e7145..ec0b35a 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -320,7 +320,32 @@ function get_address_map_link($address) { $postcode = trim($address->getPostcode()); if ($postcode) { - return " " . get_small_link("Map", "http://maps.google.co.uk/maps?q=" . urlencode($postcode)); + # mrt=loc specifies a location search. + $map = "maps.google.co.uk/maps?q=" . urlencode($postcode) . "&mrt=loc"; + $url = "http://$map"; + # output=embed allows display in an iframe. + # iwloc=near hides the popup window for the embedded view. + $embed = $GLOBALS['http'] . "://$map&output=embed&iwloc=near"; + $html = " "; + $html .= get_small_link_with_id("map", "Map", $url); + $html .= ""; + return $html; } }