-
Notifications
You must be signed in to change notification settings - Fork 4
/
options-promise.js
44 lines (41 loc) · 1.6 KB
/
options-promise.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// showing how to use esri-loader with `getOptions`
import {loadModules} from 'esri-loader';
import thumbnailUrl from './thumbnail';
export default {
title: 'Loading complex options via async promise',
debug: true,
viewOptions: {
center: [-85.05019999999857, 33.12552399999943],
zoom: 6
},
mapOptions: {
basemap: 'gray'
},
widgets: [{
type: 'esri',
parent: 'view',
position: 'top-right',
path: 'esri/widgets/BasemapToggle',
getOptions(){
return loadModules(['esri/Basemap', 'esri/layers/WebTileLayer'])
.then(([BaseMap, WebTileLayer]) => {
return {
titleVisible: true,
nextBasemap: new BaseMap({
title: 'Terrain',
id: 'terrain',
thumbnailUrl,
baseLayers: [new WebTileLayer({
urlTemplate: 'http://{subDomain}.tile.stamen.com/terrain/{level}/{col}/{row}.png',
subDomains: ['a', 'b', 'c', 'd'],
copyright: 'Map tiles by <a href="http://stamen.com/">Stamen Design</a>, ' +
'under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. ' +
'Data by <a href="http://openstreetmap.org/">OpenStreetMap</a>, ' +
'under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>.'
})]
})
};
})
}
}]
};