Last active
December 2, 2015 16:18
-
-
Save brooksjbr/4cdb73ae3e1c53685f1f to your computer and use it in GitHub Desktop.
Census Tracts by Population - 2000
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href= | |
"http://js.arcgis.com/3.14/esri/css/esri.css"> | |
<link rel="stylesheet" type="text/css" href= | |
"https://rawgit.com/benheb/legend/master/legend.css"> | |
<title>Webmap created with Mundi</title> | |
<style> | |
#map { height:500px; } #mundi-link { position: absolute; right: 5px; z-index: 200; display: block; background: #FFF; text-decoration: none; color: #4C4C4C; top: 5px; padding: 5px; border-radius: 2px; } #legend-container { width: 218px; position: absolute; bottom: 20px; left: 13px; } | |
</style> | |
</head> | |
<body> | |
<div id="map"> | |
<a id="mundi-link" href= | |
"http://benheb.github.io/mundi/?id=4cdb73ae3e1c53685f1f" | |
target="_blank">View map in Mundi</a> | |
<div id="legend-container"></div> | |
</div><script src="//code.jquery.com/jquery-1.11.3.min.js"> | |
</script> <script src= | |
"//code.jquery.com/jquery-migrate-1.2.1.min.js"> | |
</script> <script src= | |
"https://rawgit.com/benheb/legend/master/sortable.js"> | |
</script> <script src="http://js.arcgis.com/3.14/"> | |
</script> <script src= | |
"https://rawgit.com/benheb/legend/master/legend.js"> | |
</script> <script> | |
require(["esri/map","esri/urlUtils","esri/arcgis/utils","esri/layers/FeatureLayer","esri/renderers/SimpleRenderer","esri/renderers/jsonUtils","dojo/domReady!"], function(Map,urlUtils,arcgisUtils,FeatureLayer,SimpleRenderer,jsonUtils) { var legend = new Legend("legend-container", { editable: false, layers: [] }); $.getJSON("https://api.github.com/gists/4cdb73ae3e1c53685f1f", function(data) { var webmap; for (var file in data.files ) { if ( file !== "index.html" ) { webmap = JSON.parse(data.files[file].content); } }; arcgisUtils.createMap(webmap, "map").then(function(response){ var map = response.map; map.graphicsLayerIds.forEach(function(layer) { var layer = map.getLayer(layer); layer.setMinScale(0); layer.setMaxScale(0); layer.redraw(); legend.addLayer({ "id": layer.id, "name": layer.name, "renderer": layer.renderer.toJson() }); }); }); }); }); | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"item": { | |
"title": "New Map", | |
"snippet": "Census Tracts by Population - 2000", | |
"extent": [ | |
[ | |
-77.2700601713012, | |
38.813104367103996 | |
], | |
[ | |
-76.78322850626277, | |
38.98490887993413 | |
] | |
] | |
}, | |
"itemData": { | |
"operationalLayers": [ | |
{ | |
"url": "http://maps2.dcgis.dc.gov/dcgis/rest/services/DCGIS_DATA/Demographic_WebMercator/MapServer/18", | |
"visibility": true, | |
"opacity": 0.78, | |
"mode": 1, | |
"id": "0efdf1f78d4f40e3ba111feadac48553_18", | |
"minScale": 0, | |
"maxScale": 0, | |
"layerDefinition": { | |
"drawingInfo": { | |
"renderer": { | |
"visualVariables": [ | |
{ | |
"type": "colorInfo", | |
"field": "CHTOTAL", | |
"stops": [ | |
{ | |
"value": -3072, | |
"color": [ | |
247, | |
252, | |
253, | |
200 | |
], | |
"label": null | |
}, | |
{ | |
"value": -2527, | |
"color": [ | |
224, | |
236, | |
244, | |
200 | |
], | |
"label": null | |
}, | |
{ | |
"value": -1982, | |
"color": [ | |
191, | |
211, | |
230, | |
200 | |
], | |
"label": null | |
}, | |
{ | |
"value": -1437, | |
"color": [ | |
158, | |
188, | |
218, | |
200 | |
], | |
"label": null | |
}, | |
{ | |
"value": -892, | |
"color": [ | |
140, | |
150, | |
198, | |
200 | |
], | |
"label": null | |
}, | |
{ | |
"value": -347, | |
"color": [ | |
140, | |
107, | |
177, | |
200 | |
], | |
"label": null | |
}, | |
{ | |
"value": 198, | |
"color": [ | |
136, | |
65, | |
157, | |
200 | |
], | |
"label": null | |
}, | |
{ | |
"value": 743, | |
"color": [ | |
110, | |
1, | |
107, | |
200 | |
], | |
"label": null | |
} | |
] | |
} | |
], | |
"type": "simple", | |
"label": "", | |
"description": "", | |
"symbol": { | |
"color": [ | |
43, | |
140, | |
190, | |
200 | |
], | |
"outline": { | |
"color": [ | |
255, | |
255, | |
255, | |
255 | |
], | |
"width": 0.5, | |
"type": "esriSLS", | |
"style": "esriSLSSolid" | |
}, | |
"type": "esriSFS", | |
"style": "esriSFSSolid" | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"url": "http://maps2.dcgis.dc.gov/dcgis/rest/services/DCGIS_DATA/Transportation_WebMercator/MapServer/3", | |
"visibility": true, | |
"opacity": 0.78, | |
"mode": 1, | |
"id": "5b0d63150e2c4c47b5b21db73a4fd928_3", | |
"minScale": 0, | |
"maxScale": 0, | |
"layerDefinition": { | |
"drawingInfo": { | |
"renderer": { | |
"visualVariables": [ | |
{ | |
"type": "colorInfo", | |
"field": "BIKELANE_YEAR", | |
"stops": [ | |
{ | |
"value": 2003, | |
"color": [ | |
255, | |
255, | |
204, | |
255 | |
], | |
"label": null | |
}, | |
{ | |
"value": 2004.375, | |
"color": [ | |
255, | |
237, | |
160, | |
255 | |
], | |
"label": null | |
}, | |
{ | |
"value": 2005.75, | |
"color": [ | |
254, | |
217, | |
118, | |
255 | |
], | |
"label": null | |
}, | |
{ | |
"value": 2007.125, | |
"color": [ | |
254, | |
178, | |
76, | |
255 | |
], | |
"label": null | |
}, | |
{ | |
"value": 2008.5, | |
"color": [ | |
253, | |
141, | |
60, | |
255 | |
], | |
"label": null | |
}, | |
{ | |
"value": 2009.875, | |
"color": [ | |
252, | |
78, | |
42, | |
255 | |
], | |
"label": null | |
}, | |
{ | |
"value": 2011.25, | |
"color": [ | |
227, | |
26, | |
28, | |
255 | |
], | |
"label": null | |
}, | |
{ | |
"value": 2012.625, | |
"color": [ | |
177, | |
0, | |
38, | |
255 | |
], | |
"label": null | |
} | |
] | |
} | |
], | |
"type": "simple", | |
"label": "", | |
"description": "", | |
"symbol": { | |
"color": [ | |
0, | |
122, | |
194, | |
255 | |
], | |
"width": 2, | |
"type": "esriSLS", | |
"style": "esriSLSSolid" | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"url": "https://services.arcgis.com/bkrWlSKcjUDFDtgw/arcgis/rest/services/v10_bike_accidents_2013/FeatureServer/0", | |
"visibility": true, | |
"opacity": 0.78, | |
"mode": 1, | |
"id": "b456c80e30c44d06a2df930bd7bd1e88_0", | |
"minScale": 0, | |
"maxScale": 0, | |
"layerDefinition": { | |
"drawingInfo": { | |
"renderer": { | |
"visualVariables": [ | |
{ | |
"type": "colorInfo", | |
"field": "Bikes", | |
"stops": [ | |
{ | |
"value": 1, | |
"color": [ | |
255, | |
247, | |
251, | |
26 | |
], | |
"label": null | |
}, | |
{ | |
"value": 1.125, | |
"color": [ | |
236, | |
226, | |
240, | |
26 | |
], | |
"label": null | |
}, | |
{ | |
"value": 1.25, | |
"color": [ | |
208, | |
209, | |
230, | |
26 | |
], | |
"label": null | |
}, | |
{ | |
"value": 1.375, | |
"color": [ | |
166, | |
189, | |
219, | |
26 | |
], | |
"label": null | |
}, | |
{ | |
"value": 1.5, | |
"color": [ | |
103, | |
169, | |
207, | |
26 | |
], | |
"label": null | |
}, | |
{ | |
"value": 1.625, | |
"color": [ | |
54, | |
144, | |
192, | |
26 | |
], | |
"label": null | |
}, | |
{ | |
"value": 1.75, | |
"color": [ | |
2, | |
129, | |
138, | |
26 | |
], | |
"label": null | |
}, | |
{ | |
"value": 1.875, | |
"color": [ | |
1, | |
100, | |
80, | |
26 | |
], | |
"label": null | |
} | |
] | |
} | |
], | |
"type": "simple", | |
"label": "", | |
"description": "", | |
"symbol": { | |
"color": [ | |
43, | |
140, | |
190, | |
26 | |
], | |
"size": 2, | |
"angle": 0, | |
"xoffset": 0, | |
"yoffset": 0, | |
"type": "esriSMS", | |
"style": "esriSMSCircle", | |
"outline": { | |
"color": [ | |
37, | |
37, | |
37, | |
255 | |
], | |
"width": 1.5, | |
"type": "esriSLS", | |
"style": "esriSLSSolid" | |
} | |
} | |
} | |
} | |
} | |
} | |
], | |
"baseMap": { | |
"baseMapLayers": [ | |
{ | |
"opacity": 0.5, | |
"visibility": false, | |
"url": "http://services.arcgisonline.com/arcgis/rest/services/Specialty/DeLorme_World_Base_Map/MapServer" | |
}, | |
{ | |
"opacity": 0.8, | |
"visibility": false, | |
"url": "http://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Base/MapServer" | |
}, | |
{ | |
"opacity": 1, | |
"visibility": true, | |
"url": "http://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Base/MapServer" | |
} | |
], | |
"title": "basemap" | |
}, | |
"version": "1.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment