code: public static Map<String, String> getLayerFiltersForCriterion(Criterion critter, MapModel mapModel) {
  		Map<String, String> filters = new HashMap<String, String>();
  		Set<String> serverLayerIds = new HashSet<String>();
  		critter.serverLayerIdVisitor(serverLayerIds);
  
  		for (VectorLayer vectorLayer : mapModel.getVectorLayers()) {
  			if (serverLayerIds.contains(vectorLayer.getServerLayerId())) {
  				if (vectorLayer.getFilter() != null && !"".equals(vectorLayer.getFilter())) {
  					filters.put(vectorLayer.getServerLayerId(), vectorLayer.getFilter());
  				}
  			}
  		}
  		return filters;
  	}
docs: Builds a map with the filters for all layers that are used in the given criterion.
  
  @param critter criterion
  @param mapModel map model
  @return filters for all layers