Support the GridMap to handle the boundary out

Support the GridMap to handle the boundary out