new SmartSDK()
SmartSDK is the starting point of the Steerpath Smart SDK.
Start SmartSDK by calling start() method.
It requires API key and optionally the configuration JSON object.
If configuration object is not given the SmartSDK checks if threre's one specified in the API key (the "cfg" property).
If API key contains the "cfg" property the SmartSDK will load it
from the server and initialise itself. Configuration object contains the parameters Steerpath Smart SDK and it's
classes require to work.You can checkout the defaultConfig from the window namespace(window.steerpath.defaultConfig).
When configuration is loaded the SmartSDK will download
all the resources related to this API key (POIs, buildings, routes and style).
These resources are stored in the window.steerpath namespace same place as the instance of your SmartSDK.
Properties:
Name | Type | Description |
---|---|---|
apiKey |
string | Your API key provided by steerpath team |
config |
object | string | Configuration JSON object for the SDK. Configuration object contains the parameters Steerpath Smart SDK and it's classes require to work.You can checkout the defaultConfig from the window namespace(window.steerpath.defaultConfig). |
Methods
(static) setLanguage(languageCode)
Set the language of the UI elements. Currently supports English and Finnish languages
Parameters
Name | Type | Description |
---|---|---|
languageCode |
string | For example "en-GB" or "fi-FI" |
(static) setTheme(theme)
Set the map theme. Currently supported themes are default and dark
Parameters
Name | Type | Description |
---|---|---|
theme |
string | For example "dark". Theme needs to be also int he the config's list of supportedThemes. |
(static) start(apiKey, configopt)
Start your instance of SteerpathSDK by calling this method.
Parameters
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
apiKey |
string | Your API key provided by Steerpath team | ||
config |
object |
<optional> |
null | Your configuration JSON object. |