I would like to add a feature in the map object so that the user can turn on or off tarffic layer i map. A representation is given at https://developers.google.com/maps/documentation/javascript/examples/layer-traffic Example: 