Show:

Places.Coordinates Class

Create a Places.Coordinates object from some data

Constructor

Places.Coordinates

(
  • data
  • [callback]
)
Places.Coordinates static

Parameters:

  • data Object | Streams.Stream\Places.Coordinates

    Can be a stream with attributes, or object with properties, which can include either ("latitude" and "longitude") together, or ("address") or ("userId" with optional "streamName"). It can additionally specify "heading" and "speed".

    • updatedKey String

      If data is a stream, then set this to a string or Q.Tool to subscribe to the "Places/location/updated" message for location updates.

    • latitude Number

      Used together with latitude

    • longitude Number

      Used together with longitude

    • heading Number

      Used to set heading, in clockwise degrees from true north

    • speed Number

      Horizontal component of the velocity in meters-per-second

    • [platform=Places.options.platform] String optional
    • [address] String optional

      This would be geocoded by the platform

    • [placeId] String optional

      A google placeId, if the platform is 'google'

    • [userId] String optional

      Can be used to indicate a specific user

    • [streamName="Places/user/location"] String optional

      Name of a stream published by the user

  • [callback] Function optional

    Called after latitude and longitude are available (may do geocoding with the platform to obtain them if they're not available yet). The first parameter is an error string, if any. Next is an array of platform-specific Result objects. The "this" object is the Coordinates object itself, containing the latitude and longitude from the main result.

Returns:

Item Index

Methods

Methods

geocode

(
  • callback
  • [options]
)
static

Obtain geocoding definition from a geocoding service

Parameters:

  • callback Function

    The first parameter is an error string, if any. Next is an array of platform-specific Result objects. The "this" object is the Coordinates object itself, containing the latitude and longitude from the main result.

  • [options] Object optional
    • [platform=Places.options.platform] String optional
    • [basic=false] Boolean optional

      If true, skips requests to platform if latitude & longitude are available