spatial layer and javascript BOM stripping