API Docs for:
Show:

GoogleMapsLoader Class

Extends Base
Module: gallery-google-maps-loader

Constructor

GoogleMapsLoader

(
  • config
)

Parameters:

  • config Object

    Configuration object.

Item Index

Methods

Attributes

Methods

load

(
  • parameters
)
chainable

Loads the Google Maps JavaScript API through JSONP. Does nothing if this object has already loaded it.

Parameters:

  • parameters Object

    An optional object with the following optional properties:

    client
    This is your client id when using Google Maps API for Business.
    language
    The language code to override the browser's default language.
    libraries
    An array or comma separated string of library names.
    key
    This is your Google Maps v3 API key.
    region
    A Unicode region subtag identifier to override the default region.
    sensor
    Set this to a truthy value if your application determines the user's location via a sensor.
    source
    Location of the Google Maps JavaScript API to override the attribute.
    timeout
    Timeout in milliseconds to override the attribute.
    version
    The version of the Google Maps JavaScript API to load.

    If other properties not listed here are included in the parameters object, they will also be included the the Google Maps API request.

Attributes

loaded

Boolean

Default: false

Fires event loadedChange

Fires when the value for the configuration attribute loaded is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

source

String

The location of the Google Maps JavaScrpt API.

Default: 'http://maps.google.com/maps/api/js'

Fires event sourceChange

Fires when the value for the configuration attribute source is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

timeout

Number

The timeout in milliseconds used by JSONP.

Default: 30000

Fires event timeoutChange

Fires when the value for the configuration attribute timeout is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

Events

failure

Fired when JSONP fails.

success

Fired when JSONP succeeds.

timeout

Fired when JSONP times out.