From 4c17b3ad1cc812b33bfe029e9f03cf0a8332f708 Mon Sep 17 00:00:00 2001 From: Mariano Iglesias Date: Fri, 16 Oct 2009 13:58:17 -0300 Subject: [PATCH] Fixing issue where content not properly matched. Adding support for custom icon / shadow icons. --- views/helpers/geomap.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/views/helpers/geomap.php b/views/helpers/geomap.php index d7b1805..9c6ec1b 100644 --- a/views/helpers/geomap.php +++ b/views/helpers/geomap.php @@ -97,7 +97,9 @@ public function map($center = null, $markers = array(), $parameters = array()) { $marker = array_merge(array( 'point' => null, 'title' => null, - 'content' => null + 'content' => null, + 'icon' => null, + 'shadow' => null ), $marker); if (empty($marker['point'])) { @@ -237,7 +239,8 @@ protected function _google($id, $center, $markers, $parameters) { $markerOptions = array( 'title' => null, 'content' => null, - 'icon' => null + 'icon' => null, + 'shadow' => null ); $markerOptions = array_filter(array_intersect_key($marker, $markerOptions)); $content = (!empty($markerOptions['content']) ? $markerOptions['content'] : null); @@ -247,8 +250,10 @@ protected function _google($id, $center, $markers, $parameters) { marker = new google.maps.Marker({ map: ' . $varName . ', position: new google.maps.LatLng(' . $latitude . ', ' . $longitude . '), - title: "' . (!empty($options['title']) ? $options['title'] : '') . '", - clickable: ' . (!empty($options['content']) ? 'false' : 'true') . ' + title: "' . (!empty($markerOptions['title']) ? $markerOptions['title'] : '') . '", + clickable: ' . (!empty($content) ? 'true' : 'false') . ', + icon: ' . (!empty($markerOptions['icon']) ? '"' . $markerOptions['icon'] . '"' : 'null') . ', + shadow: ' . (!empty($markerOptions['shadow']) ? '"' . $markerOptions['shadow'] . '"' : 'null') . ' }); ';