function getMapImageUrl(tripInfo $tripInfo) { $location = $tripInfo->getLatitude() . "," . $tripInfo->getLongitude(); $location = rawurlencode(mb_convert_encoding($location, "UTF-8")); $poly = "45.504448,-73.614204"; return "http://maps.googleapis.com/maps/api/staticmap?center={$location}&zoom=10&size=375x200&markers=color:red%7Clabel:P%7C" . $poly . "&markers=color:blue%7Clabel:S%7C" . $location . "&maptype=roadmap&sensor=false"; }