createLocationService Method

Description

Creates a geolocation service based on a declared location service scheme, making it available for use in the diagram editor.

Note that mapping is a separately licensed feature of the ESD/SPD Web SDK.

Syntax

.createLocationService(/* String */ schemeId, /* Object */ serviceConfiguration);

Parameters

schemeId: String

The ID of a declared geolocation scheme. Two geolocation schemes are pre-declared, 'Bing' and 'Google'. These two schemes use the REST-based geo-location services provided by Google and Bing to find location information for a diagram.

serviceConfiguration: Object

A hash containing information used to initialize the geolocation service. For the two pre-declared geolocation schemes, this should contain one attribute, 'key', with the value set to the API key for Bing or Google maps.

Remarks

Custom geolocation schemes can be declared to enable the use of other geolocation services. For more information on this, contact PAE support.

Example

editor = new ESDWeb(null, 'editorNode');

editor.startup();

// If the map feature is enabled, create map services and configure the map layer.
if (editor.get('features').some(function (f) { return f === 'GIS'})) {
    editor.createLocationService('Bing', {key: '==== Bing Map API Key ====='});
}