If `style =  new OpenLayers.Style( elmStyle.init );` here, then the `styleMap` initialization can be moved out of all the conditional branches to just before the functions return statement