functionality for map in viewer