replace switch with ifs (they're faster in JS)

improves vector tile reading by ~8%