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 AutoSceneDrawWeb object as illustrated below to set
the value of this property. Note that this will overwrite any existing GIS configuration but will not change
the existing diagram.
The example below illustrates the usage of the pre-configured map schemes.
Example
editor = new window.__editor(undefined, document.getElementById('editor-node'));
editor.startup(...);
editor.set('gisConfiguration', {
geoCodeScheme: {schemeId: 'Azure', options: {key: '<Azure API Key>'}},
mapSchemes: [
{schemeId: 'Azure', displayName: 'Azure', options: {key: '<Azure 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'},
{schemeId: 'OSM', displayName: 'Public OpenStreetMap Service'},
{schemeId: 'OSM', displayName: 'Custom OpenStreetMap Service', options: {layerUrl: 'https://tile.example.com/{z}/{x}/{y}.png'}}
{
schemeId: 'Tiled',
displayName: 'Generic Tiled Map',
options: {
layerUrl: 'https://tiles.example.com/tiles/{z}/{x}/{y}.png?key={key}',
maxZoomLevel: 19,
attribution: 'Attribution Text',
apiKey: 'optional api key'
}
}
]
});
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:
- neighborhood
- city
- subregion
- region
- postal
- country
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
Azure:
- AerialWithLabels
- Aerial
- Road
Google:
- hybrid
- satellite
- roadmap
- terrain
Example
editor = new AutoSceneDrawWeb(null, 'editorNode');
editor.startup(...);
editor.set('gisConfiguration', {
// note that Bing Maps is being phased out by Microsoft and is therefore deprecated
geoCodeScheme: {schemeId: 'Bing', options: {
key: '<Bing API Key>',
additionalOptions: {
countryRegion: '<Country>',
locality: '<City>'
}
}},
mapSchemes: [
{schemeId: 'Azure', displayName: 'Azure', options: {key: '<Azure API Key>'}},
// note that Bing Maps is being phased out by Microsoft and is therefore deprecated
{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'}
]
});
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.