I am currently working with javascript and the v3 version of the maps API to retrieve data from a Fusion Table. I have been able to add custom markers to specific points successfully, but now I am attempting to set default icons for the markers I create based on the 'Icon' column in my table. Instead of using a fusion tables layer, I am generating markers in a loop using the data. The 'Icon' column in my table contains entries like 'poi', 'star', etc...
Is there a way to use a string name to access those default icons similar to how it is done with a fusion table layer? Alternatively, does anyone know where I can locate the absolute paths for the default fusion table icons (such as POI and Star) so that I can define them in my script?
Below is some example code. If anybody knows the exact URLs for the icons on Google, I could write a function to dynamically insert them based on the string from the 'Icon' column.
// Check if there is an image available for the marker, otherwise use default
if(row[3] != ''){
// Create the marker
var marker = new google.maps.Marker({
map: map,
position: coordinate,
icon: new google.maps.MarkerImage(row[3])
});
} else {
// Create the marker
var marker = new google.maps.Marker({
map: map,
position: coordinate
//icon: row[2] (row[2] represents the Icon column)
// I assume I need to implement a conditional statement to check for the name (e.g. 'poi') and then insert the absolute URL accordingly.
// However, I lack information on the absolute URLs of these icons. Thank you.
});
}