gisConfiguration Property

Description

This property is used to apply map and location service configurations to the ESD/SPD Web editor from the host application, which is responsible to persist or generate this data as desired.

To set this property, use the ESDWeb object's set method, as illustrated below. Note that this will overwrite any existing GIS configuration but will not change any existing diagram.

The example below illustrates the usage of the pre-configured map schemes. See also the createMapService method.

Example

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

editor.startup(...);

editor.set('gisConfiguration',
				{
					geoCodeScheme: {schemeId: 'Bing', options: {key: '<Bing API Key>'}},
					mapSchemes: [
						{schemeId: 'Bing', displayName: 'Bing', options: {key: '<Bing API Key>'}},
						{schemeId: 'Google', displayName: 'Google', options: {key: '<Google API Key>'}},
						{schemeId: 'ESRI Custom', displayName: 'ESRI Custom 2 Layer', options: {layerUrls: [
							'http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer',
							'http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer'
						]}},
						{schemeId: 'ESRI Base Layer'}
					]
				}
			);
		

Geocode Result Filtering

In order to help restrict geocoding search results to a specific area, the geoCodeScheme has an optional option called additionalOptions which is an object containing field names with desired filter values.

Supported Fields

ESRI:
see: Esri-leaflet Reference

Bing:
see: Bing Map API Reference, Address Types

Google:
see: Google Maps API Reference, Component Filtering

Example

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

editor.startup(...);

editor.set('gisConfiguration',
				{
					geoCodeScheme: {schemeId: 'Bing', options: {key: '<Bing API Key>',
																additionalOptions: {
																	countryRegion: '<Country>',
																	locality: '<City>'
																	}
																}
								},
					mapSchemes: [
						{schemeId: 'Bing', displayName: 'Bing', options: {key: '<Bing API Key>'}},
						{schemeId: 'Google', displayName: 'Google', options: {key: '<Google API Key>'}},
						{schemeId: 'ESRI Custom', displayName: 'ESRI Custom 2 Layer', options: {layerUrls: [
							'http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer',
							'http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer'
						]}},
						{schemeId: 'ESRI Base Layer'}
					]
				}
			);
		

Note: These filtering options may be specific to the map data available in a region, and may require some experimentation to obtain the desired result.