gisConfiguration Property

Description

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

Use the set method of the ESDWeb object as illustrated below to set the value of this property. Note that this will overwrite any existing GIS configuration but will not change existing diagram.

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

Example

editor = new window.__editor(undefined, document.getElementById('editor-node'));

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: 'NearMap', displayName: 'NearMap', options: {key: '<NearMap API Key>', region: 'us'}},
		{schemeId: 'ESRI Custom', displayName: 'ESRI Custom 2 Layer', options: {
			maxZoomLevel: 19,
			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 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: {
			maxZoomLevel: 19,
			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.