This repository has been archived by the owner on Jul 7, 2023. It is now read-only.
/
example-linked-overlays.html
92 lines (82 loc) · 3.01 KB
/
example-linked-overlays.html
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html>
<head>
<title>layer-selector Tests</title>
<!-- META TAGS -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- CSS -->
<link rel="stylesheet" href="../resources/LayerSelector.css">
<link rel="stylesheet" href="../node_modules/arcgis-js-api/css/main.css">
<style type="text/css">
body, html, #map {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
</style>
<!-- JAVASCRIPT -->
<script type="text/javascript" src="dojoConfig.js"></script>
<script type="text/javascript" src="../node_modules/dojo/dojo.js"></script>
<script type="text/javascript">
var widgetUnderTest;
require([
'layer-selector',
'esri/map',
'esri/views/MapView',
'esri/geometry/Extent',
'esri/layers/TileLayer',
'esri/layers/FeatureLayer',
'dojo/domReady!'
], function (Module, Map, MapView, Extent, TiledLayer, FeatureLayer) {
var map = new Map();
var mapView = new MapView({
map: map,
container: 'map'
});
mapView.extent = new Extent({
xmax: -12010849.397533866,
xmin: -12898741.918094235,
ymax: 5224652.298632992,
ymin: 4422369.249751998,
spatialReference: {
wkid: 3857
}
});
widgetUnderTest = new Module({
mapView: mapView,
baseLayers: [{
Factory: TiledLayer,
url: 'http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer',
id: 'Topo',
linked: ['Cities']
}, {
Factory: TiledLayer,
url: 'http://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer',
id: 'Terrain',
linked: ['Counties']
}],
overlays: [{
Factory: FeatureLayer,
url: 'http://services1.arcgis.com/99lidPhWCzftIe9K/arcgis/rest/services/UtahMunicipalBoundaries/FeatureServer/0',
id: 'Cities'
}, {
Factory: FeatureLayer,
url: 'http://services1.arcgis.com/99lidPhWCzftIe9K/arcgis/rest/services/UtahCountyBoundaries/FeatureServer/0',
id: 'Counties'
}]
});
map.add(new FeatureLayer('http://services1.arcgis.com/99lidPhWCzftIe9K/arcgis/rest/services/UtahSchools/FeatureServer/0', {}));
widgetUnderTest.startup();
});
</script>
</head>
<body>
<div id="map"></div>
<div class="node" id="node"></div>
<div class="node" id="node2"></div>
<div class="node" id="node3"></div>
<div class="node" id="node4"></div>
</body>
</html>