<< Click to Display Table of Contents >>

 

new sg.geometry.Circle(center, options)

 

 

Description

create a circle geometry.

 

Position

Geometry.js

 

 

Parameters

 

Parameter

Type

Description

center

sg.geometry.Point

The center of the circle

options

Object

Options used to setup circle

set object

Name

Type

Description

radius

Number

Circle radius

numberOfPoints

Number

Number of points on the perimeter.

Default:60

 

 

Properties

 

Properties

Type

Description

area

Number

Geometry area

extent

sg.geometry.Extent

Geometry extent

numberOfPoints

Number

Number of points on the perimeter.

radius

Number

Circle radius

rings

Array.<sg.geometry.LinearRing>

Array of multi-rings polygon

type

String

Geometry type

 

 

Methods

 

Methods

Type

Description

addRing(ring)

sg.geometry.LinearRing

add a ring to a polygon.

Name

Type

Description

ring

sg.geometry.LinearRing

ring

contains(pt)

pt:sg.geometry.Point

Returns: Boolean

return whether a point is contained in a polygon.

Name

Type

Description

pt

sg.geometry.Point

The geometry of a point

Returns:

Type

Description

Boolean

whether a point is contained in a polygon

True:contained in a polygon

False:not contained in a polygon

getArea()

Returns: Number

return geometry area

Returns:

Type

Description

Number

geometry area

getCentroid()

Returns: sg.geometry.Point

return geometry center

Returns:

Type

Description

sg.geometry.Point

geometry center

getExtent()

Returns: sg.geometry.Extent

return geometry extent

Returns:

Type

Description

sg.geometry.Extent

geometry extent

isClockwise(ring)

ring:sg.geometry.LinearRing

Returns:Boolean

return whether a ring is clockwise

Returns:

Name

Type

Description

ring

sg.geometry.LinearRing

The geometry of a ring

Returns:

Type

Description

Boolean

whether a ring is clockwise

True:yes
False:no

toWkt()

Returns: String

return WKT string

Returns:

Type

Description

String

WKT string

update()


update the geometry extent, area, and so on.

updateCircle_()


update circle geometry. Use this method after you set the radius or numberOfPoints.

 

 

Example

 

 

<script type="text/javascript" src="scripts/Geometry.js"></script>

 

var circle = new sg.geometry.Circle(new sg.geometry.Point(1761784,5716536), {numberOfPoints:60, radius:200000});

 

 

See live example

 

 


©2015 Supergeo Technologies Inc.