Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created July 16, 2009 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmcw/148496 to your computer and use it in GitHub Desktop.
Save tmcw/148496 to your computer and use it in GitHub Desktop.
# Restrict layer list, if requested
if self.layers and self.layers != self.name:
layers = self.layers.split(",")
for layer_num in range(len(m.layers)-1, -1, -1):
l = m.layers[layer_num]
if l.name not in layers:
del m.layers[layer_num]
if self.debug:
print >>sys.stderr, "Removed layer %s loaded from %s, not in list: %s" % (l.name, self.mapfile, layers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment