Changeset 3204 for trunk/modules
- Timestamp:
- 07/24/2008 04:36:10 AM (4 months ago)
- Files:
-
- 1 modified
-
trunk/modules/gmaps/libraries/Gmap_Marker.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/gmaps/libraries/Gmap_Marker.php
r3200 r3204 9 9 public $latitude; 10 10 public $longitude; 11 12 // Marker ID 13 protected static $id = 0; 11 14 12 15 // Marker Options … … 60 63 $tabs = empty($tabs) ? '' : str_repeat("\t", $tabs); 61 64 62 $output = array(); 63 $output[] = 'var m = new google.maps.Marker(new google.maps.LatLng('.$this->latitude.', '.$this->longitude.'), '.json_encode($this->options).');'; 65 // Marker ID 66 $marker = 'm'.++self::$id; 67 68 $output[] = 'var '.$marker.' = new google.maps.Marker(new google.maps.LatLng('.$this->latitude.', '.$this->longitude.'), '.json_encode($this->options).');'; 64 69 if ($html = $this->html) 65 70 { 66 $output[] = 'google.maps.Event.addListener( m, "click", function()';71 $output[] = 'google.maps.Event.addListener('.$marker.', "click", function()'; 67 72 $output[] = '{'; 68 $output[] = "\t". 'm.openInfoWindowHtml(';73 $output[] = "\t".$marker.'.openInfoWindowHtml('; 69 74 $output[] = "\t\t'".implode("'+\n\t\t$tabs'", explode("\n", $html))."'"; 70 75 $output[] = "\t);"; 71 76 $output[] = '});'; 72 77 } 73 $output[] = 'map.addOverlay( m);';78 $output[] = 'map.addOverlay('.$marker.');'; 74 79 75 80 return implode("\n".$tabs, $output);
