From 1fb7460a871d2342eca8a99d5e6a4af26c019372 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Mon, 13 May 2013 06:21:01 -0400 Subject: [PATCH] Added get_address_map_link(). Function to return a Google Maps URL for an address. --- lib/functions.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/functions.php b/lib/functions.php index 7a02b2a..73ea464 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -317,6 +317,13 @@ return $q->findOneById($address->getAreaId()); } + 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)); + } + } + function get_contact_address($contact) { $q = new AddressQuery; return $q->findOneById($contact->getAddressId()); -- 2.20.1