I want to style my fusion table markers based on a field in the fusion table. If I use default Google markers, the following code works:
layer = new google.maps.FusionTablesLayer({
query: {
select: 'bizCity',
from: '1yfyijoeC3GwDnnLutBI8IFOH8y2mfZ8LJGUDly4'
},
styles: [
{where: "'bizCatSub' = 'Antique & Classic Motorcycle Dealers'", markerOptions:{ iconName:"star"}}, // other landmarks
{where: "'bizCatSub' = 'Other moto business'", markerOptions:{ iconName:"wht_pushpin"}}, //businesses
{where: "'bizCatSub' = 'Shop'", markerOptions:{iconName:"red_blank"}}, //town houses
{where: "'bizCatSub' = '12'", markerOptions:{ iconName:"orange_blank"}}, //country homes
{where: "'bizCatSub' = '15'", markerOptions:{ iconName:"target"}},
]
});
layer.setMap(map);
You can see the jsfiddle here.
However, I want to use my own custom markers. To this end, I tried something like this:
layer = new google.maps.FusionTablesLayer({
query: {
select: 'bizCity',
from: '1yfyijoeC3GwDnnLutBI8IFOH8y2mfZ8LJGUDly4'
},
styles: [
{where: "'bizCatSub' = 'Antique & Classic Motorcycle Dealers'", markerOptions:{ url: "http://pollster.net/test/icons/dealer.png" }},
{where: "'bizCatSub' = 'Other moto business'", markerOptions:{ url: "http://pollster.net/test/icons/othermoto.png" }},
{where: "'bizCatSub' = 'Shop'", markerOptions:{ url: "http://pollster.net/test/icons/shop.png" }}
]
});
layer.setMap(map);
With the above code, the data shows up on the map, but it uses default markers instead of styling them as requested. Jsfiddle here. I looked at the documentation for styles and markeroptions and icons and tried different variations, but nothing is working for me. I think I'm missing something simple, but not sure what.
Anyone know what I'm missing?