-
Notifications
You must be signed in to change notification settings - Fork 29
/
index.html
84 lines (80 loc) · 1.84 KB
/
index.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>Esri <3 d3js</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.13/esri/css/esri.css">
<style type="text/css">
html, body {
height: 100%; width: 100%;
margin: 0; padding: 0;
}
body{
background-color: #fff; overflow:hidden;
font-family: sans-serif;
}
path {
fill: #08c;
stroke: #fff;
stroke-width:1.5px;
opacity: 0.5;
}
path#Arizona {
fill: #FF0;
}
path#Colorado {
fill: #F49;
}
#map {
position:absolute;
width: 100%;
height: 100%;
}
</style>
<script>
var dojoConfig = {
parseOnLoad: true,
packages: [{
"name": "modules",
"location": location.origin + location.pathname.replace(/\/[^/]+$/, '')
}]
};
</script>
<script src="http://js.arcgis.com/3.13/"></script>
<script>
require([
"esri/map",
"modules/d3Layer",
"dojo/parser",
"dojo/domReady!"
], function(
Map,
d3Layer,
parser) {
parser.parse();
map = new Map("map", {
center: [-98, 39],
zoom: 4,
basemap: "gray"
});
layer = new d3Layer('us-states.json', {
styles: [
//{ key: 'fill', value: '#555'}
],
attrs: [{
key: 'id',
value: function(d) {
return d.properties.name;
}
}]
});
map.addLayer(layer);
});
</script>
</head>
<body>
<div id="map"></div>
</body>
</html>