PilotGaea 2D O'view
    正在準備搜尋索引...

    類別 Geolocation

    Helper class for providing HTML5 Geolocation capabilities. The Geolocation API is used to locate a user's position.

    To get notified of position changes, register a listener for the generic change event on your instance of ol.Geolocation.

    Example:

    var geolocation = new ol.Geolocation({
      // take the projection to use from the map's view
      projection: view.getProjection()
    });
    // listen to changes in position
    geolocation.on('change', function(evt) {
      window.console.log(geolocation.getPosition());
    });
    

    error

    Options.

    stable

    層級 (查看層級一覽)

    索引

    方法

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

      參數

      • key: Object | Object[]

        The key returned by on() or once() (or an array of keys).

      回傳 void

      stable

    • Get the accuracy of the position in meters.

      回傳 number

      The accuracy of the position measurement in meters.

      stable

    • Get a geometry of the position accuracy.

      回傳 ol.geom.Geometry

      A geometry of the position accuracy.

      stable

    • Get the altitude associated with the position.

      回傳 number

      The altitude of the position in meters above mean sea level.

      stable

    • Get the altitude accuracy of the position.

      回傳 number

      The accuracy of the altitude measurement in meters.

      stable

    • Get the heading as radians clockwise from North.

      回傳 number

      The heading of the device in radians from north.

      stable

    • Get the position of the device.

      回傳 Coordinate

      The current position of the device reported in the current projection.

      stable

    • Get the projection associated with the position.

      回傳 Projection

      The projection the position is reported in.

      stable

    • Get the speed in meters per second.

      回傳 number

      The instantaneous speed of the device in meters per second.

      stable

    • Determine if the device location is being tracked.

      回傳 boolean

      The device location is being tracked.

      stable

    • Set the projection to use for transforming the coordinates.

      參數

      • projection: Projection

        The projection the position is reported in.

      回傳 void

      stable

    • Enable or disable tracking.

      參數

      • tracking: boolean

        Enable tracking.

      回傳 void

      stable

    • Gets a value.

      參數

      • key: string

        Key name.

      回傳 any

      Value.

      stable

    • Get a list of object property names.

      回傳 string[]

      List of property names.

      stable

    • Get an object of all property names and values.

      回傳 { [k: string]: any }

      Object.

      stable

    • Sets a value.

      參數

      • key: string

        Key name.

      • value: any

        Value.

      • 可選opt_silent: boolean

        Update without triggering an event.

      回傳 void

      stable

    • Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).

      參數

      • values: { [k: string]: any }

        Values.

      • 可選opt_silent: boolean

        Update without triggering an event.

      回傳 void

      stable

    • Unsets a property.

      參數

      • key: string

        Key name.

      • 可選opt_silent: boolean

        Unset without triggering an event.

      回傳 void

      stable

    • Increases the revision counter and dispatches a 'change' event.

      回傳 void

    • 函數

      Dispatches an event and calls all listeners listening for events of this type. The event parameter can either be a string or an Object with a type property.

      參數

      回傳 void

    • Get the version number for this object. Each time the object is modified, its version number will be incremented.

      回傳 number

      Revision.

    • Listen for a certain type of event.

      參數

      • type: string | string[]

        The event type or array of event types.

      • listener: Function

        The listener function.

      • 可選opt_this: Object

        The object to use as this in listener.

      回傳 Object | Object[]

      Unique key for the listener. If called with an array of event types as the first argument, the return will be an array of keys.

      stable

    • Listen once for a certain type of event.

      參數

      • type: string | string[]

        The event type or array of event types.

      • listener: Function

        The listener function.

      • 可選opt_this: Object

        The object to use as this in listener.

      回傳 Object | Object[]

      Unique key for the listener. If called with an array of event types as the first argument, the return will be an array of keys.

      stable

    • Unlisten for a certain type of event.

      參數

      • type: string | string[]

        The event type or array of event types.

      • listener: Function

        The listener function.

      • 可選opt_this: Object

        The object which was used as this by the listener.

      回傳 void

      stable

    • 函數

      Removes an event listener using the key returned by on() or once(). Note that using the ol.Observable.unByKey static function is to be preferred.

      參數

      • key: Object | Object[]

        The key returned by on() or once() (or an array of keys).

      回傳 void

      stable

    構造函數

    • 參數

      回傳 Geolocation

      Helper class for providing HTML5 Geolocation capabilities. The Geolocation API is used to locate a user's position.

      To get notified of position changes, register a listener for the generic change event on your instance of ol.Geolocation.

      Example:

      var geolocation = new ol.Geolocation({
        // take the projection to use from the map's view
        projection: view.getProjection()
      });
      // listen to changes in position
      geolocation.on('change', function(evt) {
        window.console.log(geolocation.getPosition());
      });
      

      error

      stable