## ol.source. ol.source.VectorFile

#### new VectorFile

Stability: experimental

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `options` | olx.source.VectorFileOptions | <optional> | Options.

  Source:
    - vectorfilesource.js, line 29

  ##### Fires:

  - ol.source.VectorEvent ol.source.event:VectorEvent

### Extends

- ol.source.Vector

### Methods

#### addFeature

Stability: experimental

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `feature` | ol.Feature | Feature.

  Inherited From:
    - ol.source.Vector#addFeature
  Source:
    - vectorsource.js, line 89

#### addFeatures

Stability: experimental

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `features` | Array.<ol.Feature> | Features.

  Inherited From:
    - ol.source.Vector#addFeatures
  Source:
    - vectorsource.js, line 127

#### dispatchChangeEvent

Stability: experimental

  Dispatches a `change` event. Register a listener for this event to get notified of changes.

  Inherited From:
    - ol.Observable#dispatchChangeEvent
  Source:
    - observable.js, line 39

  ##### Fires:

  - event:change

#### forEachFeature

Stability: experimental

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `f` | function |  | Callback.
  `this` | T | <optional> | The object to use as `this` in `f`.

  Inherited From:
    - ol.source.Vector#forEachFeature
  Source:
    - vectorsource.js, line 168

  ##### Returns:

  Type
    S | undefined

#### forEachFeatureInExtent

Stability: experimental

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `extent` | ol.Extent |  | Extent.
  `f` | function |  | Callback.
  `this` | T | <optional> | The object to use as `this` in `f`.

  Inherited From:
    - ol.source.Vector#forEachFeatureInExtent
  Source:
    - vectorsource.js, line 204

  ##### Returns:

  Type
    S | undefined

#### getClosestFeatureToCoordinate

Stability: experimental

  ##### Parameters:

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

  Inherited From:
    - ol.source.Vector#getClosestFeatureToCoordinate
  Source:
    - vectorsource.js, line 253

  ##### Returns:

  Closest feature.

  Type
    ol.Feature

#### getExtent

Stability: experimental
  Inherited From:
    - ol.source.Vector#getExtent
  Source:
    - vectorsource.js, line 299

  ##### Returns:

  Extent.

  Type
    ol.Extent

#### getFeatures

Stability: experimental
  Inherited From:
    - ol.source.Vector#getFeatures
  Source:
    - vectorsource.js, line 214

  ##### Returns:

  Features.

  Type
    Array.<ol.Feature>

#### getFeaturesAtCoordinate

Stability: experimental

  ##### Parameters:

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

  Inherited From:
    - ol.source.Vector#getFeaturesAtCoordinate
  Source:
    - vectorsource.js, line 229

  ##### Returns:

  Features.

  Type
    Array.<ol.Feature>

#### getState

Stability: not documented
  Inherited From:
    - ol.source.Source#getState
  Source:
    - source.js, line 135

  ##### Returns:

  State.

  Type
    ol.source.State

#### on

Stability: experimental

  Listen for a certain type of event.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `type` | string | Array.<string> |  | The event type or array of event types.
  `listener` | function |  | The listener function.
  `this` | Object | <optional> | The object to use as `this` in `listener`.

  Inherited From:
    - ol.Observable#on
  Source:
    - observable.js, line 62

  ##### Returns:

  Unique key for the listener.

  Type
    goog.events.Key

#### once

Stability: experimental

  Listen once for a certain type of event.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `type` | string | Array.<string> |  | The event type or array of event types.
  `listener` | function |  | The listener function.
  `this` | Object | <optional> | The object to use as `this` in `listener`.

  Inherited From:
    - ol.Observable#once
  Source:
    - observable.js, line 75

  ##### Returns:

  Unique key for the listener.

  Type
    goog.events.Key

#### removeFeature

Stability: experimental

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `feature` | ol.Feature | Feature.

  Inherited From:
    - ol.source.Vector#removeFeature
  Source:
    - vectorsource.js, line 344

#### un

Stability: experimental

  Unlisten for a certain type of event.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `type` | string | Array.<string> |  | The event type or array of event types.
  `listener` | function |  | The listener function.
  `this` | Object | <optional> | The object to use as `this` in `listener`.

  Inherited From:
    - ol.Observable#un
  Source:
    - observable.js, line 87

#### unByKey

Stability: experimental

  Removes an event listener using the key returned by `on()` or `once()`.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `key` | goog.events.Key | Key.

  Inherited From:
    - ol.Observable#unByKey
  Source:
    - observable.js, line 97