Detect entity type when on click event

How to detect entity type i.e. whether polygon or point on click event of entity?