/* $Id: icon.js,v 1.3 2008/10/03 18:38:51 bdragon Exp $ */ /** * GIcon manager for GMap. * * Required for markers to operate properly. */ /** * Get the GIcon corresponding to a setname / sequence. * There is only one GIcon for each slot in the sequence. * The marker set wraps around when reaching the end of the sequence. * @@@ TODO: Move this directly into the preparemarker event binding. */ Drupal.gmap.getIcon = function(setname, sequence) { var othimg = ['printImage','mozPrintImage','printShadow','transparent']; // If no setname, return google's default icon. if (!setname) { return G_DEFAULT_ICON; } if (!this.gicons) { this.gicons = {}; } // If no sequence, synthesise one. if (!sequence) { // @TODO make this per-map. if (!this.sequences) { this.sequences = {}; } if (!this.sequences[setname]) { this.sequences[setname] = -1; } this.sequences[setname]++; sequence = this.sequences[setname]; } if (!this.gicons[setname]) { if (!Drupal.gmap.icons[setname]) { alert('Request for invalid marker set '+setname+'!'); } this.gicons[setname] = []; var q = Drupal.gmap.icons[setname]; for (var i=0; i