My son did the same when he's around 27 months old. I generally ignore him and didn't pay one second of attention on him. He even did that one time when we were out in a restaurant. The people in the restaurant were looking me him and also wondering who the mother on earth would allow her son cried and laid down on the floor like that. It's mixed feeling on me. On one hand, it's really hurt seeing my son acting that way; on the other hand, I know it's for his own good that I ignore his stupid act like this.
After that incidence, he had never laid down on the floor outside again. If he's in the house, I would ignore him still, but sometimes, I would throw a "toy snake" on the floor and said the snake will bite him. That way, he will get up immediately.