0

Improved flexibilty when specifying signGroups

Group membership is now determined with a function.  See config.js for
some examples.  If we want to include more information about markers in
markers.js, this model should be useful.
This commit is contained in:
Andrew Chin
2010-12-08 21:59:45 -05:00
parent 65264407f9
commit 9bc7c10bd1
2 changed files with 36 additions and 36 deletions

View File

@@ -10,14 +10,23 @@
};
// define a list of pattern-label pairs. Each label will appear
// in the 'Signposts' control, allowing your users to quickly enable
// or disable certain labels. See below for some examples:
var signGroups = {
// "Directions": /^#Direction/i,
// "Big Dig": /big\s*dig/i,
// "Warnings": /warning/i,
};
/* signGroups -- A list of signpost groups. A signpost can fall into zero, one, or more than one
* group. See below for some examples.
*
* Required:
* label : string. Displayed in the drop down menu control.
* match : function. Applied to each marker (from markers.js). It is returns true if the marker
* Should be part of the group.
*
* Optional:
* checked : boolean. Set to true to have the group visible by default
*/
var signGroups = [
// {label: "'To'", checked: false, match: function(s) {return s.msg.match(/to/)}},
// {label: "Storage", match: function(s) {return s.msg.match(/storage/i) || s.msg.match(/dirt/i) || s.msg.match(/sand/)}},
// {label: "Below Sealevel", match: function(s) { return s.y<64;}},
{label: "All", match: function(s) {return true}}
];
// Please leave the following variables here:
var markerCollection = {}; // holds groups of markers