Updated click event to handle point/line/poly layers.