Setting up trail-layer map properly before firing add/remove events on the layers (which could cause side-effects)