Created
July 29, 2010 03:45
-
-
Save springmeyer/497172 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pull layers from query string | |
boost::optional<std::string> layer_string = get_layer_string(): | |
if (layer_string) | |
{ | |
std::clog << "filtering layers...\n"; | |
// convert comma separated layers to vector | |
std::vector<std::string> layer_names = parse_layer_string(*layer_string); | |
// for each map layer object | |
BOOST_FOREACH ( layer const& lyr, map_.layers() ) | |
{ | |
bool requested = false; | |
// figure out if it was requested and either | |
// set active (status = on) or disable | |
BOOST_FOREACH ( std::string & lyr_name, layer_names ) | |
{ | |
if (lyr.name() == lyr_name) | |
{ | |
requested = true; | |
} | |
} | |
lyr.setActive(requested); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment