collect and code javascript map control