# Class: ViewPoint

## vcs.vcm.util.ViewPoint

A Viewpoint Object

#### new vcs.vcm.util.ViewPoint(options)

  Name | Type | Description
  --- | --- | ---
  `options` | vcs.vcm.util.ViewPoint.Options |

### Members

#### name{string}

  name of this viewpoint;

### Methods

#### vcs.vcm.util.ViewPoint.createViewPointFromExtent(extent){vcs.vcm.util.ViewPoint}

  Creates a viewpoint based on an extent

  Name | Type | Description
  --- | --- | ---
  `extent` | ol.Extent |

#### clone(){vcs.vcm.util.ViewPoint}

  clones the viewpoint

  ##### Returns:

  viewpoint

#### getAnimate(){boolean}

  If this viewpoint is animated

#### getCameraPosition(){ol.Coordinate}

  get a point object (position of the camera)

#### getConfigObject(){Object}

  ##### Returns:

  returns a options object. This object can be used to reconstruct a new viewpoint

#### getDistance(){number}

  get distance between target and Point

#### getGroundPosition(){ol.Coordinate}

  get Ground Position point on the ground

#### getHeading(){number}

  get heading, angle between 0 and 360 degree 0° = North, 90° = east ...

#### getName(){string}

  returns the name of this viewpoint

  Deprecated
    - Yes

#### getPitch(){number}

  get pitch

#### getRoll(){number}

  get roll

#### isValid()

  Checks if this Viewpoint is Valid

  ##### Throws:

  on invalid viewpoint

  Type
    vcs.vcm.util.InvalidArgument

#### setAnimate(animate)

  sets, whether to animate this viewpoint

  Name | Type | Description
  --- | --- | ---
  `animate` | boolean |

#### setCameraPosition(cameraPosition)

  set camera Position

  Name | Type | Description
  --- | --- | ---
  `cameraPosition` | ol.Coordinate |

#### setDistance(distance)

  set distance

  Name | Type | Description
  --- | --- | ---
  `distance` | number |

#### setGroundPosition(groundPosition)

  set ground Position

  Name | Type | Description
  --- | --- | ---
  `groundPosition` | ol.Coordinate | set the ground target

#### setHeading(heading)

  set heading

  Name | Type | Description
  --- | --- | ---
  `heading` | number |

#### setPitch(pitch)

  set pitch

  Name | Type | Description
  --- | --- | ---
  `pitch` | number |

#### setRoll(roll)

  set roll

  Name | Type | Description
  --- | --- | ---
  `roll` | number |

#### toString(){string}

  creates a String representation of this viewpoint

### Type Definitions

#### vcs.vcm.util.ViewPoint.Options{Object}

  ##### Properties:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `name` | string | undefined |  |  | viewpoint name
  `cameraPosition` | ol.Coordinate |  |  | ol3 coordinate array with xyz coordinates (z value is mandatory)
  `groundPosition` | ol.Coordinate |  |  | ol3 coordinate array with xyz coordinates (z value is optional)
  `distance` | number | undefined |  |  | distance between the camera position and the target
  `heading` | number | <optional> | 0 | angle between 0 and 360 degree
  `pitch` | number | <optional> | -90 | angle between 0 and 360 degree
  `roll` | number | <optional> | 0 | angle between 0 and 360 degree
  `animate` | boolean | <optional> | false | if possible the switching to the new viewpoint will be animated