In reply to Yingxin.

You need to have your lat/lng pairs in such an order so they go from one vertex to another. Any two adjacent points lat1/lng1 and lat2/lng2 produce a line segment (or polygon side) of the polygon. The very last pair latN/lngN connects with the first one lat1/lng1.