codesite-noreply at google.com
2009-Oct-08 18:20 UTC
[Mapstraction] [mapstraction] r50 committed - minor simplification and explicitly define var
Revision: 50 Author: freyfogle Date: Thu Oct 8 11:19:37 2009 Log: minor simplification and explicitly define var http://code.google.com/p/mapstraction/source/detail?r=50 Modified: /trunk/source/mxn.googlev3.core.js ======================================--- /trunk/source/mxn.googlev3.core.js Thu Oct 8 11:03:12 2009 +++ /trunk/source/mxn.googlev3.core.js Thu Oct 8 11:19:37 2009 @@ -311,11 +311,9 @@ toProprietary: function() { var options = {}; if (this.iconUrl) { - var image = new google.maps.MarkerImage(this.iconUrl); - options.icon = image; + options.icon = new google.maps.MarkerImage(this.iconUrl); if (typeof(this.iconShadowUrl) != ''undefined'') { - var shadow = new google.maps.MarkerImage(this.iconShadowUrl); - options.shadow = shadow; + options.shadow = new google.maps.MarkerImage(this.iconShadowUrl); } } if (this.draggable){ @@ -334,20 +332,18 @@ content: this.infoBubble }); + var event_action = "click"; if(this.hover) { event_action = "mouseover"; } - else { - event_action = "click"; - } google.maps.event.addListener(marker, event_action, function() { infowindow.open(this.map,marker); }); } if (this.hoverIconUrl){ - var hicon = new google.maps.MarkerImage(this.hoverIconUrl); - google.maps.event.addListener(marker, "mouseover", function(){ marker.setIcon(hicon); }); - var icon = new google.maps.MarkerImage(this.iconUrl); - google.maps.event.addListener(marker, "mouseout", function(){ marker.setIcon(icon); }); + google.maps.event.addListener(marker, "mouseover", + function(){ marker.setIcon( new google.maps.MarkerImage(this.hoverIconUrl) ); }); + google.maps.event.addListener(marker, "mouseout", + function(){ marker.setIcon( new google.maps.MarkerImage(this.iconUrl) ); }); } google.maps.event.addListener(marker, ''click'', function() {