# Why is the Tilemap not fitting the screen?

I have a background image which I made it in tiled map editor of width 40tiles and height of 8tiles.When I run the game the tilemap bounces with the player and I can see the black portion of the screen.The game screen width and height is 320 by 256.Here is the problem Play class

cam.position.x = MathUtils.clamp(cam.position.x, mapLeftBoundary, mapRightBoundary);

cam.position.set(player.getPosition().x+40/2 , 8/2,0);