0

I'm a c# programmer, my JS skills are weak. I've been trying all manners and syntax to get a custom icon image to appear based on query parameters from a Fusion table. I always get a default red dot icon. I'm using SetOptions as follows:

Note that the other markers do work, just not the custom image.

Many thanks for any help.

layerl0.setOptions({
    query:
    {
        select: 'col3',
        from: '1RqmLYAIdL9mvV3zAMVdnEjncXiiX0ZXJAwL92PY'
    },
    styles: [
    { where: "'Category' = 'Hotel'", markerOptions: { iconName: "rec_lodging" } },
    { where: "'Category' = 'Restaurant'", markerOptions: { iconName: "dining" } },
    { where: "'Category' = 'Do'", markerOptions: { icon: new google.maps.MarkerImage("http://m.inbocas.com/Content/icons/surfing.png")} },
    { where: "'Category' = 'Shop'", markerOptions: { iconName: "grocery" } },
    { where: "'Category' = 'Party'", markerOptions: { iconName: "bars" } },
    ]
});
nbrooks
  • 18,126
  • 5
  • 54
  • 66
user1926976
  • 31
  • 1
  • 3
  • May not be exact duplicate http://stackoverflow.com/questions/6573726/multiple-markers-for-google-maps-api-v3-with-custom-icon – Ramesh Kotha Dec 24 '12 at 16:23
  • hmm thanks, that is related to the maps api but not seeing code related to custom icon image in that example though. – user1926976 Dec 24 '12 at 16:48

1 Answers1

0

Do you have the constructor for your MarkerImage?

MarkerImage(url:string, size?:Size, origin?:Point, anchor?:Point, scaledSize?:Size)

leventcinel
  • 358
  • 2
  • 5
  • I thought this was the constructor: new google.maps.MarkerImage("http://m.inbocas.com/Content/icons/surfing.png") – user1926976 Dec 24 '12 at 16:36
  • Can't seem to get rid of the semi colon in the above comment, it is not in the actual code in the original question. – user1926976 Dec 24 '12 at 16:42