refactoring map to use layer map, fixed bug where sometimes doesnt select layer after history or breadcrumb use