GPolygon.prototype.Contains=function(b){var c=0;var e=false;var a=b.lng();var f=b.lat();for(var d=0;d<this.getVertexCount();d++){c++;if(c==this.getVertexCount()){c=0}if(((this.getVertex(d).lat()<f)&&(this.getVertex(c).lat()>=f))||((this.getVertex(c).lat()<f)&&(this.getVertex(d).lat()>=f))){if(this.getVertex(d).lng()+(f-this.getVertex(d).lat())/(this.getVertex(c).lat()-this.getVertex(d).lat())*(this.getVertex(c).lng()-this.getVertex(d).lng())<a){e=!e}}}return e};GPolygon.prototype.Area=function(){var m=0;var f=0;var k=this.Bounds();var e=k.getSouthWest().lng();var n=k.getSouthWest().lat();for(var g=0;g<this.getVertexCount();g++){f++;if(f==this.getVertexCount()){f=0}var d=this.getVertex(g).distanceFrom(new GLatLng(this.getVertex(g).lat(),e));var c=this.getVertex(f).distanceFrom(new GLatLng(this.getVertex(f).lat(),e));var l=this.getVertex(g).distanceFrom(new GLatLng(n,this.getVertex(g).lng()));var h=this.getVertex(f).distanceFrom(new GLatLng(n,this.getVertex(f).lng()));m+=d*h-c*l}return Math.abs(m*0.5)};GPolygon.prototype.Distance=function(){var b=0;for(var a=1;a<this.getVertexCount();a++){b+=this.getVertex(a).distanceFrom(this.getVertex(a-1))}return b};GPolygon.prototype.Bounds=function(){var b=new GLatLngBounds();for(var a=0;a<this.getVertexCount();a++){b.extend(this.getVertex(a))}return b};GPolygon.prototype.GetPointAtDistance=function(b){if(b==0){return this.getVertex(0)}if(b<0){return null}var g=0;var c=0;for(var d=1;(d<this.getVertexCount()&&g<b);d++){c=g;g+=this.getVertex(d).distanceFrom(this.getVertex(d-1))}if(g<b){return null}var f=this.getVertex(d-2);var e=this.getVertex(d-1);var a=(b-c)/(g-c);return new GLatLng(f.lat()+(e.lat()-f.lat())*a,f.lng()+(e.lng()-f.lng())*a)};GPolygon.prototype.GetIndexAtDistance=function(a){if(a==0){return this.getVertex(0)}if(a<0){return null}var d=0;var b=0;for(var c=1;(c<this.getVertexCount()&&d<a);c++){b=d;d+=this.getVertex(c).distanceFrom(this.getVertex(c-1))}if(d<a){return null}return c};GPolygon.prototype.Bearing=function(g,f){if(g==null){g=0;f=this.getVertexCount()-1}else{if(f==null){f=g+1}}if((g<0)||(g>=this.getVertexCount())||(f<0)||(f>=this.getVertexCount())){return}var h=this.getVertex(g);var i=this.getVertex(f);if(h.equals(i)){return 0}var c=h.latRadians();var e=h.lngRadians();var b=i.latRadians();var d=i.lngRadians();var a=-Math.atan2(Math.sin(e-d)*Math.cos(b),Math.cos(c)*Math.sin(b)-Math.sin(c)*Math.cos(b)*Math.cos(e-d));if(a<0){a+=Math.PI*2}a=a*180/Math.PI;return parseFloat(a.toFixed(1))};GPolyline.prototype.Contains=GPolygon.prototype.Contains;GPolyline.prototype.Area=GPolygon.prototype.Area;GPolyline.prototype.Distance=GPolygon.prototype.Distance;GPolyline.prototype.Bounds=GPolygon.prototype.Bounds;GPolyline.prototype.GetPointAtDistance=GPolygon.prototype.GetPointAtDistance;GPolyline.prototype.GetIndexAtDistance=GPolygon.prototype.GetIndexAtDistance;GPolyline.prototype.Bearing=GPolygon.prototype.Bearing;