block by wboykinm 07b9b794c132fa511eb0

GIS_PLANNING.Census_Block_Groups_2000

Full Screen

index.html

<!DOCTYPE html>

<html>
<head>
  <meta charset="utf-8">
  <link rel="stylesheet" href=
  "//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=
    "//benheb.github.io/mundi/?id=07b9b794c132fa511eb0"
    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="//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/07b9b794c132fa511eb0", 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>

webmap.json

{
	"item": {
		"title": "New Map",
		"snippet": "GIS_PLANNING.Census_Block_Groups_2000",
		"extent": [
			[
				-75.98770167795043,
				39.693992618135866
			],
			[
				-74.25048854318415,
				40.310438597133405
			]
		]
	},
	"itemData": {
		"operationalLayers": [
			{
				"url": "https://services.arcgis.com/fLeGjb7u4uXqeF9q/arcgis/rest/services/Census_Block_Groups_2010/FeatureServer/0",
				"visibility": true,
				"opacity": 0.78,
				"mode": 1,
				"id": "2f982bada233478ea0100528227febce_0",
				"minScale": 0,
				"maxScale": 0,
				"layerDefinition": {
					"drawingInfo": {
						"renderer": {
							"visualVariables": [
								{
									"type": "colorInfo",
									"field": "AREA_",
									"stops": [
										{
											"value": 168132.444958,
											"color": [
												255,
												247,
												251,
												200
											],
											"label": null
										},
										{
											"value": 11970138.67783825,
											"color": [
												236,
												226,
												240,
												200
											],
											"label": null
										},
										{
											"value": 23772144.9107185,
											"color": [
												208,
												209,
												230,
												200
											],
											"label": null
										},
										{
											"value": 35574151.14359875,
											"color": [
												166,
												189,
												219,
												200
											],
											"label": null
										},
										{
											"value": 47376157.376479,
											"color": [
												103,
												169,
												207,
												200
											],
											"label": null
										},
										{
											"value": 59178163.60935925,
											"color": [
												54,
												144,
												192,
												200
											],
											"label": null
										},
										{
											"value": 70980169.8422395,
											"color": [
												2,
												129,
												138,
												200
											],
											"label": null
										},
										{
											"value": 82782176.07511975,
											"color": [
												1,
												100,
												80,
												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"
							}
						}
					}
				}
			}
		],
		"baseMap": {
			"baseMapLayers": [
				{
					"opacity": 0.5,
					"visibility": true,
					"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": false,
					"url": "http://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Base/MapServer"
				}
			],
			"title": "basemap"
		},
		"version": "1.0"
	}
}