On 19 May 2010 16:22, Amanda <[email protected]> wrote:
>
> without
> function createMarker(point, state, punishment, stat) {
> var marker = new GMarker(point, customIcons[punishment]);
> return marker;
> }
>
> no markers are created, have I missed something??
That function creates the markers. How about replacing the middle line with
var marker = new
GMarker(point,{icon:customIcons[punishment],clickable:(stat>0)});
so that if stat=0 the expression evaluates to false and the marker is
not clickable. If stat>0 the expression is true and the marker is
clickable.
You can then add the infoWindow regardless, by putting these lines
immediately after that one:
var html = "<b>Total Executions: </b>" + stat;
GEvent.addListener(marker, 'click', function() {
marker.openInfoWindowHtml(html);
});
Andrew
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.