gisConfiguration
gisConfiguration Property
Description
This property is used to apply map and location service configurations to the 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.
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.
Supported Fields
ESRI:
- neighborhood
- city
- subregion
- region
- postal
- country
Bing:
- locality
- neighborhood
- adminDistrict
- adminDistrict2
- postalCode
- countryRegion
see: Bing Map API Reference, Address Types
Google:
- route
- locality
- administrative_area
- postal_code
- country
Setting the Map Type
If you desire to set the map type to something other than the default, you can do so by setting the mapType
property
of the options
object for the desired mapScheme. See the “Google” example below.
Supported Schemes
ESRI:
- Imagery
- ImageryAndLabels
- Streets
- Topographic
Bing:
- AerialWithLabels
- Aerial
- Road
Google:
- hybrid
- satellite
- roadmap
- terrain
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>',
mapType: 'hybrid'
}},
{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'}
]
});