public
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
function highlightCorrelations(currentMarker){
// first make all the airports small
$.each(airports, function(id, marker) {
marker.setIcon(getIcon(2, 'black'));
});
// for each airport correlated to the selected airport, set it's icon to red
$.each(currentMarker.correlations, function(i, correlation) {
var marker = airports[correlation[0]];
marker.setIcon(getIcon(correlation[1], 'red')); //getIcon returns a circle symbol
});
}
 
 
function getIcon(scale, color) {
return {
path: google.maps.SymbolPath.CIRCLE,
fillColor: color || 'black',
fillOpacity: .6,
strokeColor: 'white',
strokeWeight: .5,
scale: scale * Math.pow(1.4, map.getZoom()) // Bigger circles as you zoom in
};
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.