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
jQuery.each({// collect the options from either the highlight.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] can give us a setting
highlight.opts[key]=highlight[config.target];
}
elseif (config.behavior&&highlight.behavior&&highlight.behavior[config.behavior]){// value is a behaviour, should it be enabled?
varradial=projection.fromDivPixelToLatLng(newgoogle.maps.Point(center.x,center.y+radius),mapZoom);// find a point that is the radius distance away in pixels from the ccenter point.
varradial=projection.fromDivPixelToLatLng(newgoogle.maps.Point(center.x,center.y+radius),mapZoom);// find a point that is the radius distance away in pixels
highlight.shape=Drupal.gmap.factory.highlight(jQuery.extend({},highlight.opts,{radius:highlight.opts.radiusInMeters}));// only pass radiusinmeters to g.m.circle. We keep the pixel radius in case we need to calculate again after a zoom
varhighlightedMarkers=[];// remember markers that have been highlighted. so that we can un-highlight them all at one. The default behaviour is to allow only 1 marker highlighted at any time.
obj.bind('markerHighlight',function (marker){
highlightedMarkers.push(marker);
// If the highlight arg option is used in views highlight the marker.
if (!marker.highlight){marker.highlight={}}
if (!marker.highlight.color&&obj.vars.styles.highlight_color){marker.highlight.color='#'+obj.vars.styles.highlight_color;}