Skip to content

Commit

Permalink
Fixing issue where content not properly matched. Adding support for c…
Browse files Browse the repository at this point in the history
…ustom icon / shadow icons.
  • Loading branch information
mariano committed Oct 16, 2009
1 parent 1add366 commit 4c17b3a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions views/helpers/geomap.php
Expand Up @@ -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'])) {
Expand Down Expand Up @@ -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);
Expand All @@ -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') . '
});
';

Expand Down

0 comments on commit 4c17b3a

Please sign in to comment.