@@ -13,7 +13,7 @@ var image_shadow = "http://spacenear.us/tracker/images/markers/shadow.png";
1313var image_shadow_width = 24 ;
1414var image_shadow_height = 16 ;
1515
16- function BalloonMarker ( latlng , opts ) {
16+ function BalloonMarker ( map , latlng , opts ) {
1717 this . latlng = latlng ;
1818
1919 if ( ! opts ) opts = { } ;
@@ -25,6 +25,8 @@ function BalloonMarker(latlng, opts) {
2525 this . clicked_ = 0 ;
2626 this . altitude_ = opts . altitude ? opts . altitude : 0 ;
2727 this . img_ = opts . img ;
28+
29+ this . initialize ( map ) ;
2830}
2931
3032/* BalloonMarker extends GOverlay class from the Google Maps API
@@ -36,6 +38,10 @@ BalloonMarker.prototype = new google.maps.OverlayView();
3638 */
3739BalloonMarker . prototype . initialize = function ( map ) {
3840 var me = this ;
41+ this . draw = function ( ) { } ;
42+ this . onAdd = function ( ) { } ;
43+ this . onRemove = function ( ) { } ;
44+ this . setMap ( map ) ;
3945
4046 // Create the DIV representing our BalloonMarker
4147 var div = document . createElement ( "div" ) ;
@@ -55,13 +61,16 @@ BalloonMarker.prototype.initialize = function(map) {
5561 div . style . backgroundRepeat = 'no-repeat' ;
5662 div . style . backgroundPosition = "" + ( ( image_width - image_shadow_width ) / 2 ) + "px " + ( image_height + me . altitude_ - image_shadow_height ) + "px" ;
5763 }
58-
64+ /*
5965 google.maps.Event.addDomListener(this.img_, "click", function(event) {
6066 me.clicked_ = 1;
6167 GEvent.trigger(me, "click");
6268 });
69+ */
6370
64- map . getPane ( G_MAP_MARKER_PANE ) . appendChild ( div ) ;
71+ //map.getPane(G_MAP_MARKER_PANE).appendChild(div);
72+ console . log ( this . getPanes ( ) ) ;
73+ this . getPanes ( ) . overlayImage . appendChild ( div ) ;
6574
6675 this . map_ = map ;
6776 this . div_ = div ;
@@ -84,7 +93,7 @@ BalloonMarker.prototype.copy = function() {
8493 opts . mode = this . mode_ ;
8594 opts . altitude = this . altitude_ ;
8695 opts . img = this . img_ ;
87- return new BalloonMarker ( this . latlng , opts ) ;
96+ return new BalloonMarker ( this . map_ , this . latlng , opts ) ;
8897} ;
8998
9099/* Redraw the BalloonMarker based on the current projection and zoom level
@@ -98,7 +107,7 @@ BalloonMarker.prototype.redraw = function(force) {
98107 // Calculate the DIV coordinates of two opposite corners
99108 // of our bounds to get the size and position of our BalloonMarker
100109 if ( ! this . latlng ) return ;
101- var divPixel = this . map_ . fromLatLngToDivPixel ( this . latlng ) ;
110+ var divPixel = this . getProjection ( ) . fromLatLngToDivPixel ( this . latlng ) ;
102111
103112 // Now position our DIV based on the DIV coordinates of our bounds
104113 this . div_ . style . width = this . width_ + "px" ;
0 commit comments