creating mask from a map