360Works Google Plugin/Documentation

From 360Works Product Documentation Wiki
Revision as of 17:46, 10 July 2015 by WikiEditTask (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

360Works Google Plugin User Guide

The Google Plugin integrates with Google Maps, providing support for GeoCoding an address, and generating Google Maps URLs.

Before calling plugin functions, specify your Google API key using the GoogleAPIKey function. </p>


360Works Plugin Setup Guides

See Plugins_101 for Error reporting, installation, registration, and more.

Function Summary

  • GoogleAPIKey ( key ) — Sets the Google API Key to use for plugin calls to Gogole's servers.
  • GoogleDirectionsURL ( originAddress ; destinationAddress ) — Returns a URL to display a map and driving directions from originAddress to destinationAddress
  • GoogleDrivingDistance ( origin ; destination { ; priority=distance ; waypoints=waypoint1|waypoint2|waypoint3 ; avoid=tolls|highways|ferries } ) — Returns the number of meters when driving from origin to destination.
  • GoogleDrivingTime ( origin ; destination { ; priority=distance ; waypoints=waypoint1|waypoint2|waypoint3 ; avoid=tolls|highways|ferries } ) — Returns the estimated number of seconds required to drive from origin to destination.
  • GoogleGeocode ( address ; number ; type ) — Get metadata about a street address.
  • GoogleLastError ( ) — Returns the last Plugin-related error which occurred.
  • GoogleLatLong ( address ) — Returns the lat/long for a street address.
  • GoogleLicenseInfo ( ) — Returns information about the license used.
  • GoogleLocationURL ( latLong { ; radius } ) — Returns a URL to display a given location on GoogleMaps.
  • GoogleRegister ( licenseKey ; registeredTo ) — Registers the plugin.
  • GoogleSetErrorCapture ( errorCapture ) — Toggles error dialogs on or off.
  • GoogleVersion ( ) — Returns the version of the plugin which is installed.

Function Detail

GoogleAPIKey ( key )

Sets the Google API Key to use for plugin calls to Gogole's servers. You can get an API key at https://console.developers.google.com.

When setting up your API key, include the following services:

  • Distance Matrix API
  • Geocoding API
Parameters:

key
Your Google API key


GoogleDirectionsURL ( originAddress ; destinationAddress )

Returns a URL to display a map and driving directions from originAddress to destinationAddress

Parameters:

originAddress
starting address
destinationAddress
destination address

Returns: a URL which will display a map and driving directions.

GoogleDrivingDistance ( origin ; destination { ; priority=distance ; waypoints=waypoint1|waypoint2|waypoint3 ; avoid=tolls|highways|ferries } )

Returns the number of meters when driving from origin to destination.

To convert meters to miles, multiply by 0.000621371


Parameters:

origin
Starting address
destination
Ending address

Returns: Meters when driving from origin to destination.

GoogleDrivingTime ( origin ; destination { ; priority=distance ; waypoints=waypoint1|waypoint2|waypoint3 ; avoid=tolls|highways|ferries } )

Returns the estimated number of seconds required to drive from origin to destination.

Parameters:

origin
Starting address
destination
Ending address

Returns: Seconds when driving from origin to destination.

GoogleGeocode ( address ; number ; type )

Get metadata about a street address. address is a street address, and type should be one of the following:

  • count The number of matching addresses found.
  • formatted_address The complete address, with formatting and any missing information applied.
  • location The latitude,longitude of the address.
  • street_address indicates a precise street address.
  • route indicates a named route (such as "US 101").
  • intersection indicates a major intersection, usually of two major roads.
  • political indicates a political entity. Usually, this type indicates a polygon of some civil administration.
  • country indicates the national political entity, and is typically the highest order type returned by the Geocoder.
  • administrative_area_level_1 indicates a first-order civil entity below the country level. Within the United States, these administrative levels are states. Not all nations exhibit these administrative levels.
  • administrative_area_level_2 indicates a second-order civil entity below the country level. Within the United States, these administrative levels are counties. Not all nations exhibit these administrative levels.
  • administrative_area_level_3 indicates a third-order civil entity below the country level. This type indicates a minor civil division. Not all nations exhibit these administrative levels.
  • colloquial_area indicates a commonly-used alternative name for the entity.
  • locality indicates an incorporated city or town political entity.
  • sublocality indicates a first-order civil entity below a locality. For some locations may receive one of the additional types: sublocality_level_1 through to sublocality_level_5. Each sublocality level is a civil entity. Larger numbers indicate a smaller geographic area.
  • neighborhood indicates a named neighborhood
  • premise indicates a named location, usually a building or collection of buildings with a common name
  • subpremise indicates a first-order entity below a named location, usually a singular building within a collection of buildings with a common name
  • postal_code indicates a postal code as used to address postal mail within the country.
  • natural_feature indicates a prominent natural feature.
  • airport indicates an airport.
  • park indicates a named park.
  • point_of_interest indicates a named point of interest. Typically, these "POI"s are prominent local entities that don't easily fit in another category such as "Empire State Building" or "Statue of Liberty."
Parameters:

address
street address
number
which address to return the value for (must be 1 or greater)
type
name of the address attribute to return

See also: GoogleAPIKey
Returns: information about address, or "ERROR" if an error occurred.

GoogleLastError ( )

Returns the last Plugin-related error which occurred. This should be called any time that a plugin function returns "ERROR" to get a user-readable description of the error.

Returns: Error text, or "" if there was no error.

GoogleLatLong ( address )

Returns the lat/long for a street address. If multiple addresses are found, the first one is used.

Parameters:

address
Street address or zip code

See also: GoogleAPIKey
Returns: lat,long values, or "ERROR" if an error occurred.

GoogleLicenseInfo ( )

Returns information about the license used.


GoogleLocationURL ( latLong { ; radius } )

Returns a URL to display a given location on GoogleMaps.

Parameters:

latLong
latitude,longitude value to display
radius
radius in miles to display for the map (optional)

Returns: a URL to Google Maps which will display the indicated lat,long coordinate at the specified zoomLevel.

GoogleRegister ( licenseKey ; registeredTo )

Registers the plugin.

Parameters:

licenseKey
a valid license key
registeredTo
the company the plugin is registered to

Returns: 1 on success, or "ERROR" on failure.

GoogleSetErrorCapture ( errorCapture )

Toggles error dialogs on or off. When something unexpected happens, the plug-in will pop up a dialog displaying the error message. This makes it easy to see what went wrong. However, in some cases, you (the developer) may prefer to show your own message to the user, or possibly not show a message at all. In that case, you can call ScribeSetErrorCapture with a parameter of true. That will suppress the error dialog from appearing to the user.

Parameters:

errorCapture
set to true to suppress the default popups.


GoogleVersion ( )

Returns the version of the plugin which is installed.

Personal tools
Namespaces

Variants
Actions
Plug-in Products
Other Products
Navigation
Toolbox