Module: WPGMZA

Methods

(static) assertInstanceOf(instance, instanceName) → {void}

This function is for checking inheritence has been setup correctly. For objects that have engine and Pro specific classes, it will automatically add the engine and pro prefix to the supplied string and if such an object exists it will test against that name rather than the un-prefix argument supplied. For example, if we are running the Pro addon with Google maps as the engine, if you supply Marker as the instance name the function will check to see if instance is an instance of GoogleProMarker

Parameters:
Name Type Description
instance object The object to check
instanceName string The class name as a string which this object should be an instance of
Source:
Returns:
Type
void

(static) assertInstanceOf(instance, instanceName) → {void}

This function is for checking inheritence has been setup correctly. For objects that have engine and Pro specific classes, it will automatically add the engine and pro prefix to the supplied string and if such an object exists it will test against that name rather than the un-prefix argument supplied. For example, if we are running the Pro addon with Google maps as the engine, if you supply Marker as the instance name the function will check to see if instance is an instance of GoogleProMarker

Parameters:
Name Type Description
instance object The object to check
instanceName string The class name as a string which this object should be an instance of
Source:
Returns:
Type
void

(static) getCurrentPosition() → {object}

This function will get the users position, it first attempts to get high accuracy position (mobile with GPS sensors etc.), if that fails (desktops will time out) then it tries again without high accuracy enabled

Source:
Returns:
The users position as a LatLng literal
Type
object

(static) getCurrentPosition() → {object}

This function will get the users position, it first attempts to get high accuracy position (mobile with GPS sensors etc.), if that fails (desktops will time out) then it tries again without high accuracy enabled

Source:
Returns:
The users position as a LatLng literal
Type
object

(static) getImageDimensions(src, callback) → {void}

Utility function to get the dimensions of an image, caches results for best performance

Parameters:
Name Type Description
src string Image source URL
callback function Callback to recieve image dimensions
Source:
Returns:
Type
void

(static) getImageDimensions(src, callback) → {void}

Utility function to get the dimensions of an image, caches results for best performance

Parameters:
Name Type Description
src string Image source URL
callback function Callback to recieve image dimensions
Source:
Returns:
Type
void

(static) getMapByID(id) → {object}

Parameters:
Name Type Description
id mixed The ID of the map to retrieve
Source:
Returns:
The map object, or null if no such map exists
Type
object

(static) getMapByID(id) → {object}

Parameters:
Name Type Description
id mixed The ID of the map to retrieve
Source:
Returns:
The map object, or null if no such map exists
Type
object

(static) guid() → {string}

Utility function returns a GUID

Source:
Returns:
The GUID
Type
string

(static) guid() → {string}

Utility function returns a GUID

Source:
Returns:
The GUID
Type
string

(static) hexOpacityToRGBA(colour, opacity) → {array}

Takes a hex string and opacity value and converts it to Openlayers RGBA format

Parameters:
Name Type Description
colour string The hex color string
opacity number The opacity from 0.0 - 1.0
Source:
Returns:
RGBA where color components are 0 - 255 and opacity is 0.0 - 1.0
Type
array

(static) hexOpacityToRGBA(colour, opacity) → {array}

Takes a hex string and opacity value and converts it to Openlayers RGBA format

Parameters:
Name Type Description
colour string The hex color string
opacity number The opacity from 0.0 - 1.0
Source:
Returns:
RGBA where color components are 0 - 255 and opacity is 0.0 - 1.0
Type
array

(static) isDeveloperMode() → {boolean}

Returns true if developer mode is set

Source:
Returns:
True if developer mode is on
Type
boolean

(static) isDeveloperMode() → {boolean}

Returns true if developer mode is set

Source:
Returns:
True if developer mode is on
Type
boolean

(static) isGoogleAutocompleteSupported() → {boolean}

Shorthand function to determine if the Places Autocomplete is available

Source:
Returns:
Type
boolean

(static) isGoogleAutocompleteSupported() → {boolean}

Shorthand function to determine if the Places Autocomplete is available

Source:
Returns:
Type
boolean

(static) isLatLngString(str) → {array}

Utility function returns true is string is a latitude and longitude

Parameters:
Name Type Description
str string The string to attempt to parse as coordinates
Source:
Returns:
the matched latitude and longitude or null if no match
Type
array

(static) isLatLngString(str) → {array}

Utility function returns true is string is a latitude and longitude

Parameters:
Name Type Description
str string The string to attempt to parse as coordinates
Source:
Returns:
the matched latitude and longitude or null if no match
Type
array

(static) isProVersion() → {boolean}

Returns true if the Pro add-on is active

Source:
Returns:
True if the Pro add-on is active
Type
boolean

(static) isProVersion() → {boolean}

Returns true if the Pro add-on is active

Source:
Returns:
True if the Pro add-on is active
Type
boolean

(static) openMediaDialog(callback) → {void}

Opens the WP media dialog and returns the result to a callback

Parameters:
Name Type Description
callback function Callback to recieve the attachment ID as the first parameter and URL as the second
Source:
Returns:
Type
void

(static) openMediaDialog(callback) → {void}

Opens the WP media dialog and returns the result to a callback

Parameters:
Name Type Description
callback function Callback to recieve the attachment ID as the first parameter and URL as the second
Source:
Returns:
Type
void

(static) runCatchableTask(callback, friendlyErrorContainer) → {void}

Runs a catchable task and displays a friendly error if the function throws an error

Parameters:
Name Type Description
callback function The function to run
friendlyErrorContainer HTMLElement The container element to hold the error
Source:
Returns:
Type
void

(static) runCatchableTask(callback, friendlyErrorContainer) → {void}

Runs a catchable task and displays a friendly error if the function throws an error

Parameters:
Name Type Description
callback function The function to run
friendlyErrorContainer HTMLElement The container element to hold the error
Source:
Returns:
Type
void

(static) stringToLatLng(str) → {object}

Utility function returns a latLng literal given a valid latLng string

Parameters:
Name Type Description
str string The string to attempt to parse as coordinates
Source:
Returns:
LatLng literal
Type
object

(static) stringToLatLng(str) → {object}

Utility function returns a latLng literal given a valid latLng string

Parameters:
Name Type Description
str string The string to attempt to parse as coordinates
Source:
Returns:
LatLng literal
Type
object

Methods

(static) assertInstanceOf(instance, instanceName) → {void}

This function is for checking inheritence has been setup correctly. For objects that have engine and Pro specific classes, it will automatically add the engine and pro prefix to the supplied string and if such an object exists it will test against that name rather than the un-prefix argument supplied. For example, if we are running the Pro addon with Google maps as the engine, if you supply Marker as the instance name the function will check to see if instance is an instance of GoogleProMarker

Parameters:
Name Type Description
instance object The object to check
instanceName string The class name as a string which this object should be an instance of
Source:
Returns:
Type
void

(static) assertInstanceOf(instance, instanceName) → {void}

This function is for checking inheritence has been setup correctly. For objects that have engine and Pro specific classes, it will automatically add the engine and pro prefix to the supplied string and if such an object exists it will test against that name rather than the un-prefix argument supplied. For example, if we are running the Pro addon with Google maps as the engine, if you supply Marker as the instance name the function will check to see if instance is an instance of GoogleProMarker

Parameters:
Name Type Description
instance object The object to check
instanceName string The class name as a string which this object should be an instance of
Source:
Returns:
Type
void

(static) getCurrentPosition() → {object}

This function will get the users position, it first attempts to get high accuracy position (mobile with GPS sensors etc.), if that fails (desktops will time out) then it tries again without high accuracy enabled

Source:
Returns:
The users position as a LatLng literal
Type
object

(static) getCurrentPosition() → {object}

This function will get the users position, it first attempts to get high accuracy position (mobile with GPS sensors etc.), if that fails (desktops will time out) then it tries again without high accuracy enabled

Source:
Returns:
The users position as a LatLng literal
Type
object

(static) getImageDimensions(src, callback) → {void}

Utility function to get the dimensions of an image, caches results for best performance

Parameters:
Name Type Description
src string Image source URL
callback function Callback to recieve image dimensions
Source:
Returns:
Type
void

(static) getImageDimensions(src, callback) → {void}

Utility function to get the dimensions of an image, caches results for best performance

Parameters:
Name Type Description
src string Image source URL
callback function Callback to recieve image dimensions
Source:
Returns:
Type
void

(static) getMapByID(id) → {object}

Parameters:
Name Type Description
id mixed The ID of the map to retrieve
Source:
Returns:
The map object, or null if no such map exists
Type
object

(static) getMapByID(id) → {object}

Parameters:
Name Type Description
id mixed The ID of the map to retrieve
Source:
Returns:
The map object, or null if no such map exists
Type
object

(static) guid() → {string}

Utility function returns a GUID

Source:
Returns:
The GUID
Type
string

(static) guid() → {string}

Utility function returns a GUID

Source:
Returns:
The GUID
Type
string

(static) hexOpacityToRGBA(colour, opacity) → {array}

Takes a hex string and opacity value and converts it to Openlayers RGBA format

Parameters:
Name Type Description
colour string The hex color string
opacity number The opacity from 0.0 - 1.0
Source:
Returns:
RGBA where color components are 0 - 255 and opacity is 0.0 - 1.0
Type
array

(static) hexOpacityToRGBA(colour, opacity) → {array}

Takes a hex string and opacity value and converts it to Openlayers RGBA format

Parameters:
Name Type Description
colour string The hex color string
opacity number The opacity from 0.0 - 1.0
Source:
Returns:
RGBA where color components are 0 - 255 and opacity is 0.0 - 1.0
Type
array

(static) isDeveloperMode() → {boolean}

Returns true if developer mode is set

Source:
Returns:
True if developer mode is on
Type
boolean

(static) isDeveloperMode() → {boolean}

Returns true if developer mode is set

Source:
Returns:
True if developer mode is on
Type
boolean

(static) isGoogleAutocompleteSupported() → {boolean}

Shorthand function to determine if the Places Autocomplete is available

Source:
Returns:
Type
boolean

(static) isGoogleAutocompleteSupported() → {boolean}

Shorthand function to determine if the Places Autocomplete is available

Source:
Returns:
Type
boolean

(static) isLatLngString(str) → {array}

Utility function returns true is string is a latitude and longitude

Parameters:
Name Type Description
str string The string to attempt to parse as coordinates
Source:
Returns:
the matched latitude and longitude or null if no match
Type
array

(static) isLatLngString(str) → {array}

Utility function returns true is string is a latitude and longitude

Parameters:
Name Type Description
str string The string to attempt to parse as coordinates
Source:
Returns:
the matched latitude and longitude or null if no match
Type
array

(static) isProVersion() → {boolean}

Returns true if the Pro add-on is active

Source:
Returns:
True if the Pro add-on is active
Type
boolean

(static) isProVersion() → {boolean}

Returns true if the Pro add-on is active

Source:
Returns:
True if the Pro add-on is active
Type
boolean

(static) openMediaDialog(callback) → {void}

Opens the WP media dialog and returns the result to a callback

Parameters:
Name Type Description
callback function Callback to recieve the attachment ID as the first parameter and URL as the second
Source:
Returns:
Type
void

(static) openMediaDialog(callback) → {void}

Opens the WP media dialog and returns the result to a callback

Parameters:
Name Type Description
callback function Callback to recieve the attachment ID as the first parameter and URL as the second
Source:
Returns:
Type
void

(static) runCatchableTask(callback, friendlyErrorContainer) → {void}

Runs a catchable task and displays a friendly error if the function throws an error

Parameters:
Name Type Description
callback function The function to run
friendlyErrorContainer HTMLElement The container element to hold the error
Source:
Returns:
Type
void

(static) runCatchableTask(callback, friendlyErrorContainer) → {void}

Runs a catchable task and displays a friendly error if the function throws an error

Parameters:
Name Type Description
callback function The function to run
friendlyErrorContainer HTMLElement The container element to hold the error
Source:
Returns:
Type
void

(static) stringToLatLng(str) → {object}

Utility function returns a latLng literal given a valid latLng string

Parameters:
Name Type Description
str string The string to attempt to parse as coordinates
Source:
Returns:
LatLng literal
Type
object

(static) stringToLatLng(str) → {object}

Utility function returns a latLng literal given a valid latLng string

Parameters:
Name Type Description
str string The string to attempt to parse as coordinates
Source:
Returns:
LatLng literal
Type
object