Difference between revisions of "360Works Google Plugin/Documentation"
WikiEditTask (talk | contribs) m (Auto-upload documentation) |
(No difference)
|
Revision as of 17:37, 19 March 2014
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.
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
todestinationAddress
- GoogleDrivingDistance ( origin ; destination ) — Returns the number of meters when driving from
origin
todestination
. - GoogleDrivingTime ( origin ; destination ) — Returns the estimated number of seconds required to drive from
origin
todestination
. - 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
key
- Your Google API key
GoogleDirectionsURL ( originAddress ; destinationAddress )
Returns a URL to display a map and driving directions from originAddress
to destinationAddress
originAddress
- starting address
destinationAddress
- destination address
GoogleDrivingDistance ( origin ; destination )
Returns the number of meters when driving from origin
to destination
.
To convert meters to miles, multiply by 0.000621371
origin
- Starting address
destination
- Ending address
origin
to destination
.
GoogleDrivingTime ( origin ; destination )
Returns the estimated number of seconds required to drive from origin
to destination
.
origin
- Starting address
destination
- Ending address
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 tosublocality_level_5
. Each sublocality level is a civil entity. Larger numbers indicate a smaller geographic area.neighborhood
indicates a named neighborhoodpremise
indicates a named location, usually a building or collection of buildings with a common namesubpremise
indicates a first-order entity below a named location, usually a singular building within a collection of buildings with a common namepostal_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."
address
- street address
number
- which address to return the value for (must be 1 or greater)
type
- name of the address attribute to return
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.
""
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.
address
- Street address or zip code
GoogleLicenseInfo ( )
Returns information about the license used.
GoogleLocationURL ( latLong { ; radius } )
Returns a URL to display a given location on GoogleMaps.
latLong
- latitude,longitude value to display
radius
- radius in miles to display for the map (optional)
lat,long
coordinate at the specified zoomLevel
.
GoogleRegister ( licenseKey ; registeredTo )
Registers the plugin.
licenseKey
- a valid license key
registeredTo
- the company the plugin is registered to
"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.
errorCapture
- set to true to suppress the default popups.
GoogleVersion ( )
Returns the version of the plugin which is installed.