Show:

Places Class

Places plugin's front end code

Item Index

Methods

Methods

closest

(
  • point
  • polyline
)
Object static

Use this method to calculate the closest point on a polyline

Parameters:

Returns:

Object:

contains properties "index", "x", "y", "distance", "fraction"

distance

(
  • lat1
  • long1
  • lat2
  • long2
)
Number static

Parameters:

  • lat1 Number

    latitude in degrees

  • long1 Number

    longitude in degrees

  • lat2 Number

    latitude in degrees

  • long2 Number

    longitude in degrees

Returns:

Number:

The result, in meters, of applying the haversine formula

distanceLabel

(
  • meters
  • [units]
)
String static

Use this method to generate a label for a radius based on a distance in meters

Parameters:

  • meters Number
  • [units] String optional

    optionally specify 'km', 'kilometers' or 'miles'

Returns:

String:

Returns a label that looks like "x.y km", "x miles" or "x meters"

heading

(
  • lat1
  • long1
  • lat2
  • long2
)
Number static

Use this method to calculate the heading from pairs of coordinates

Parameters:

  • lat1 Number

    latitude in degrees

  • long1 Number

    longitude in degrees

  • lat2 Number

    latitude in degrees

  • long2 Number

    longitude in degrees

Returns:

Number:

The heading, in degrees

loadCountries

(
  • callback
)
static

Parameters:

  • callback Function

    Once the callback is called, Q.Places.countries and Q.Places.countries is accessible

loadGoogleMaps

(
  • callback
)
static

Parameters:

  • callback Function

    Once the callback is called, google.maps is accessible