# OpenLayers.Control.Geolocate

The Geolocate control wraps w3c geolocation API into control that can be bound to a map, and generate events on location update

To use this control requires to load the proj4js library if the projection of the map is not EPSG:4326 or EPSG:900913.

#### Inherits from

- OpenLayers.Control

Summary

OpenLayers.Control.Geolocate | The Geolocate control wraps w3c geolocation API into control that can be bound to a map, and generate events on location update
Constants |
EVENT_TYPES |
Properties |
bind | {Boolean} If true, map center will be set on location update.
watch | {Boolean} If true, position will be update regularly.
geolocationOptions | {Object} Options to pass to the navigator’s geolocation API.
Constructor |
OpenLayers.Control.Geolocate | Create a new control to deal with browser geolocation API
Functions |
getCurrentLocation | {Boolean} Returns true if a event will be fired (successfull registration)

### Constants

### EVENT_TYPES

#### Supported event types

- locationupdated Triggered when browser return a new position
- locationfailed Triggered when geolocation has failed
- locationuncapable Triggered when control is activated on a browser which doesn’t support geolocation

### Properties

### bind

{Boolean} If true, map center will be set on location update.

### watch

{Boolean} If true, position will be update regularly.

### geolocationOptions

{Object} Options to pass to the navigator’s geolocation API. See http://dev.w3.org/geo/api/spec-source.html. No specific option is passed to the geolocation API by default.

### Constructor

### OpenLayers.Control.Geolocate

Create a new control to deal with browser geolocation API

### Functions

### getCurrentLocation

> getCurrentLocation: function()

#### Returns

{Boolean} Returns true if a event will be fired (successfull registration)

> getCurrentLocation: function()

{Boolean} Returns true if a event will be fired (successfull registration)
Controls affect the display or behavior of the map.
Close