# Class: Locator

## vcs.vcm.widgets.Locator

A widget to read out the window.navigation and request the geolocation from the user.

### Extends

- vcs.vcm.widgets.Widget

### Members

#### active{boolean}

#### className{string}

  class Name of the Object

#### initialized{boolean}

#### name{string}

  unique Name

### Methods

#### vcs.vcm.widgets.Locator.getLocation(){Promise.<Position, PositionError>}

  Tries to get the geolocation from the navigator.

#### getClassName(){string} inherited

  returns the class name of this object.

  Deprecated
    - Yes

  ##### Returns:

  className

#### getConfigObject(){Object} inherited

#### getId(){string} inherited

  returns the id of this object

  Deprecated
    - Yes

#### getName(){string} inherited

  returns the name of the Object, the name is either given by the config Object or a uuid is generated

  Deprecated
    - Yes

#### getSupportedMaps(){Array.<string>} inherited

  Returns the widgets supported maps

#### getValuesObject(){Object}

  Returns the ui values for this widget, so they can be observed

  Deprecated
    - 3.5

#### isActive(){boolean} inherited

  returns the active state of the widget

  Deprecated
    - v3.6 use the property active directly

  ##### Returns:

  state of the widget

#### isInitialized(){boolean} inherited

  checks if the Widget is already initialized

  Deprecated
    - Yes

  ##### Returns:

  true if all requirements are there

#### isSupported(map){boolean} inherited

  returns true if this widget supports the given map. Should be overriden by the widget

  Name | Type | Description
  --- | --- | ---
  `map` | string | vcs.vcm.maps.Map | the map or className to check for support

#### isVisible(){boolean|*}

  Whether the associated vecotr layer is visible or not

  Deprecated
    - 3.5

#### locatorClicked()

  Starts watching the position, shows the layer (with error circle) of the widget. If the users position is not in view, the camera is paned.

#### setStyle(style)

  Sets the style of the locator widget

  Name | Type | Description
  --- | --- | ---
  `style` | ol.style.Style |

  Deprecated
    - 3.6

### Type Definitions

#### vcs.vcm.widgets.Locator.Options{vcs.vcm.widgets.Widget.Options}

  ##### Properties:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `style` | vcs.vcm.util.style.VectorStyleItem.Options | undefined |  |  |
  `zoomDistance` | number | <optional> | 1000 | the distance to zoom away when viewing the location
  `classificationType` | string | <optional> | 'both' | pass 'terrain' to maintain legacy behavior
  `extrusion` | number | false | <optional> | 80 | extrusion of the point. if false, the point is not a pin