proxyTemplate Property

Description

The property proxyTemplate is used to define the URL template used to proxy map image and geo-location service requests. A proxy is necessary because the user's browser will typically treat map requests as prohibited cross-origin requests.

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

To set this property, use the ESDWeb object's set method, as illustrated in the example below.

The value of this property must be set to a proxy URL template string. This string will be used to formulate map service requests by replacing the token {url} in it with the base map request URL. For example, setting the proxyTemplate property to '/proxy?url={url}' indicates that a facility called 'proxy' exists at the root of the current site for proxying map requests and that it takes one argument called 'url' whose value should be set to the URL of a map service request.

Example

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

editor.startup(...);

// Set the current unit-of-measure.
editor.set('uom', 'feetAndInches');

// Create map services and configure the map layer:
editor.set('proxyTemplate', '/proxy?url={url}');
editor.set('minMapWidth', '200\''); // 200 feet
editor.set('minMapWidth', 200);	    // 200 feet (The UOM is feet and inches).
editor.createMapService('Bing', {key: '==== Bing Map API Key ====='});
editor.createMapService('Google', {key: '==== Google Map API Key ====='});