if (!highlight.behavior){highlight.behavior={};}// sanity
if (!highlight.position){highlight.position=newgoogle.maps.LatLng(highlight.latitude,highlight.longitude);}// if you have a pos already then use it, otherwise gimme a lat/lon
$.each({// collect the options from either the highligh.opts object, from the passed target value, as a behavior or a default value
radius:{target:'radius',default:10},// radius in pixels
strokeColor:{target:'border',default:'#777777'},
strokeWeight:{target:'weight',default:2},
strokeOpacity:{target:'opacity',default:0.7},
fillColor:{target:'color',default:'#777777'},
fillOpacity:{target:'opacity',default:0.7},
draggable:{behavior:'draggable',default:false},
editable:{behavior:'editable',default:false},
},function(key,config){
if (highlight.opts[key]){// options was passed in
returntrue;
}
elseif (config.target&&highlight[config.target]){// highight.target should have a value
highlight.opts[key]=highlight[config.target];
}
elseif (config.behavior&&highlight.behavior&&highlight.behavior[config.behavior]){// value is a behaviour
varradial=projection.fromDivPixelToLatLng(newgoogle.maps.Point(center.x,center.y+radius),mapZoom);// find a point that is the radius distance away in pixels
// If the highlight arg option is used in views highlight the marker.
if (marker.opts.highlight==1){
obj.change('markerHighlight',-1,marker);
}
});
});
\ No newline at end of file
// Originally I moved mouse highlights to the extra event binds before I realized that there is likely a usecase for highlights without enabling extra events