问题
How can i retrieve OR calculate the coordinates of the NW or SE corners of a Rectangle?
I'm using Google Maps API v3 and I know there is the getBounds() method which returns the NE and SW coordinates of the rectangle.
I need all four coordinates because KML 2.2 does not have a rectangle schema spec, it only has the polygon schema and i need to be able to export my rectangle into a kml as a polygon.
回答1:
NW coordinates - (x1, y1)
SE coordinates - (x2, y2)
NE coordinates - (x2, y1)
SW coordinates - (x1, y2)
来源:https://stackoverflow.com/questions/3891066/how-do-i-get-the-coordinates-of-all-four-corners-of-a-rectangle