arthur-e/Wicket — pull request #38 by amenadiel (2014-03-17 16:52:50+00:00)
Title: Deconstructing supports circle, point, latlng & returns WKT string

This feature adds support for *google.maps.LatLng*, *google.maps.Point* and *google.maps.Circle* objects to the *Wkt.Wkt.prototype.deconstruct* method. LatLng and Point result in a WKT Point, while Circle deconstruction returns a WKT Polygon made of 32 segments. ([In concordance with PostGIS treatment of circle when using ST_Buffer](http://postgis.net/docs/ST_Buffer.html)).

Additionally, the deconstruction method will now return also a WKT key containing the WKT representation of the deconstructed element.

To test:
```js
var Wicket =new Wkt.Wkt()
var NewCircle = new google.maps.Circle({radius:300, center: new google.maps.LatLng(37.75, -122.4) });
Wicket.deconstruct(NewCircle);
```

should return

```js
Object {type: "polygon", components: Array[1], WKT: "POLYGON((-122.39659075856113 37.75,-122.3966562661…7942 37.7494741044496,-122.39659075856113 37.75))"}
```

Whereas

```js
Wicket.deconstruct(NewCircle.getCenter());
```

should return

```js
Object {type: "point", components: Array[1], WKT: "POINT(-122.4 37.75)"}
```