function createMarkerOptions(friend) {
var lat = friend.latlng.lat();
var lng = friend.latlng.lng();
//Distribute the markers with identical locations
//Dangeours Woodoo magic- don't try this at home :)
lat += parseFloat(((Math.floor(Math.random() * 200) - 99) / 5000).toString() + friend.id);
lng += parseFloat(((Math.floor(Math.random() * 200) - 99) / 5000).toString() + friend.id);
friend.latlng = new google.maps.LatLng(lat, lng);
var image = null;
var shadow = new google.maps.MarkerImage(
'Content/images/shadow.png',
new google.maps.Size(54, 37),
new google.maps.Point(0, 0),
new google.maps.Point(16, 37)
);
shape = {
coord: [30, 0, 31, 1, 31, 2, 31, 3, 31, 4, 31, 5, 31, 6, 31, 7, 31, 8, 31, 9, 31, 10, 31, 11, 31, 12, 31, 13, 31, 14, 31, 15, 31, 16, 31, 17, 31, 18, 31, 19, 31, 20, 31, 21, 31, 22, 31, 23, 31, 24, 31, 25, 31, 26, 31, 27, 31, 28, 31, 29, 31, 30, 30, 31, 24, 32, 23, 33, 22, 34, 21, 35, 20, 36, 11, 36, 10, 35, 9, 34, 8, 33, 7, 32, 1, 31, 0, 30, 0, 29, 0, 28, 0, 27, 0, 26, 0, 25, 0, 24, 0, 23, 0, 22, 0, 21, 0, 20, 0, 19, 0, 18, 0, 17, 0, 16, 0, 15, 0, 14, 0, 13, 0, 12, 0, 11, 0, 10, 0, 9, 0, 8, 0, 7, 0, 6, 0, 5, 0, 4, 0, 3, 0, 2, 0, 1, 0, 0, 30, 0],
type: 'poly'
};
if (friend.gender == "M") {
image = new google.maps.MarkerImage(
'Content/images/male.png',
new google.maps.Size(32, 37),
new google.maps.Point(0, 0),
new google.maps.Point(16, 37)
);
}
else if (friend.gender == "F") {
image = new google.maps.MarkerImage(
'Content/images/female.png',
new google.maps.Size(32, 37),
new google.maps.Point(0, 0),
new google.maps.Point(16, 37)
);
}
else {
image = new google.maps.MarkerImage(
'Content/images/unknown.png',
new google.maps.Size(32, 37),
new google.maps.Point(0, 0),
new google.maps.Point(16, 37)
);
}
var options = {
position: friend.latlng,
icon: image,
shadow: shadow,
shape: shape,
content: friend
};
return options;
}