as a start you could have additional layer properties to store the
rule definitions.
For the simplest types of rules you could have the properties "rule",
"operation" and "list"
rule: none | shadow | group etc
operation: any | all
list: comma separated list of layer ids
1. the visible property would be determined by a formula if "rule"
wasn't "none"
2. the formula would be conjunction/disjunction over the "visible"
property of a list of layers
3. the formula would be evaluated on the initial state of the layers
4. afterwards a layer would listen to "visible_changed" on the layers
in its list, nd recalculate its own visible property accordingly.
you would need two functions for formula calculation:
function any(list) {
var a = false;
for (var i in list) {
a = a || overlays.get(i).get("visible");
}
return a;
}
function all(list) {
var a = true;
for (var i in list) {
a = a && overlays.get(i).get("visible");
}
return a;
}
...
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.