Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Get layer class from TileCache::Layers for the specified type,
- # raises TileCache::InvalidConfiguration if no class has been found
- def layer_class_for(type)
- class_name = type.sub(/\ALayer/, "") # once and only in the beginning
- raise NoSuchLayer, "Invalid layer type attribute: #{type}" unless Layers.const_defined?(class_name) # I assume we are within TileCache
- TileCache::Layers.const_get(class_name)
- end
Add Comment
Please, Sign In to add comment