Last active
June 16, 2017 19:30
-
-
Save ajturner/1ad08f8c1d79f6ec0b3d3ecb678f8470 to your computer and use it in GitHub Desktop.
Public Schools
This file contains hidden or 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=1ad08f8c1d79f6ec0b3d3ecb678f8470" | |
| 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/1ad08f8c1d79f6ec0b3d3ecb678f8470", 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 hidden or 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": "Public Schools", | |
| "extent": [ | |
| [ | |
| -77.33735143106544, | |
| 38.77912182892026 | |
| ], | |
| [ | |
| -76.68469487589054, | |
| 39.01105719015419 | |
| ] | |
| ] | |
| }, | |
| "itemData": { | |
| "operationalLayers": [ | |
| { | |
| "url": "http://maps2.dcgis.dc.gov/dcgis/rest/services/DCGIS_DATA/Transportation_WebMercator/MapServer/113", | |
| "visibility": true, | |
| "opacity": 0.78, | |
| "layerDefinition": { | |
| "drawingInfo": { | |
| "renderer": { | |
| "type": "simple", | |
| "label": "", | |
| "description": "", | |
| "symbol": { | |
| "color": [ | |
| 227, | |
| 26, | |
| 28, | |
| 255 | |
| ], | |
| "width": 2, | |
| "type": "esriSLS", | |
| "style": "esriSLSSolid" | |
| } | |
| } | |
| } | |
| }, | |
| "mode": 1, | |
| "id": "63032fe31e6247d891199af860cd5109_113" | |
| }, | |
| { | |
| "url": "http://maps2.dcgis.dc.gov/dcgis/rest/services/DCGIS_DATA/Transportation_WebMercator/MapServer/52", | |
| "visibility": true, | |
| "opacity": 0.78, | |
| "layerDefinition": { | |
| "drawingInfo": { | |
| "renderer": { | |
| "type": "classBreaks", | |
| "field": "TOTAL_STUD", | |
| "defaultSymbol": { | |
| "color": [ | |
| 254, | |
| 217, | |
| 118, | |
| 230 | |
| ], | |
| "size": 9, | |
| "angle": 0, | |
| "xoffset": 0, | |
| "yoffset": 0, | |
| "type": "esriSMS", | |
| "style": "esriSMSCircle", | |
| "outline": { | |
| "color": [ | |
| 189, | |
| 189, | |
| 189, | |
| 255 | |
| ], | |
| "width": 1.3, | |
| "type": "esriSLS", | |
| "style": "esriSLSSolid" | |
| } | |
| }, | |
| "minValue": 1, | |
| "classBreakInfos": [ | |
| { | |
| "symbol": { | |
| "color": [ | |
| 0, | |
| 88, | |
| 36, | |
| 230 | |
| ], | |
| "size": 4, | |
| "angle": 0, | |
| "xoffset": 0, | |
| "yoffset": 0, | |
| "type": "esriSMS", | |
| "style": "esriSMSCircle", | |
| "outline": { | |
| "color": [ | |
| 189, | |
| 189, | |
| 189, | |
| 255 | |
| ], | |
| "width": 1.3, | |
| "type": "esriSLS", | |
| "style": "esriSLSSolid" | |
| } | |
| }, | |
| "label": 0, | |
| "classMaxValue": 0 | |
| }, | |
| { | |
| "symbol": { | |
| "color": [ | |
| 0, | |
| 88, | |
| 36, | |
| 230 | |
| ], | |
| "size": 10, | |
| "angle": 0, | |
| "xoffset": 0, | |
| "yoffset": 0, | |
| "type": "esriSMS", | |
| "style": "esriSMSCircle", | |
| "outline": { | |
| "color": [ | |
| 189, | |
| 189, | |
| 189, | |
| 255 | |
| ], | |
| "width": 1.3, | |
| "type": "esriSLS", | |
| "style": "esriSLSSolid" | |
| } | |
| }, | |
| "label": "> 0 to 204.125", | |
| "classMaxValue": 204.125 | |
| }, | |
| { | |
| "symbol": { | |
| "color": [ | |
| 0, | |
| 88, | |
| 36, | |
| 230 | |
| ], | |
| "size": 16, | |
| "angle": 0, | |
| "xoffset": 0, | |
| "yoffset": 0, | |
| "type": "esriSMS", | |
| "style": "esriSMSCircle", | |
| "outline": { | |
| "color": [ | |
| 189, | |
| 189, | |
| 189, | |
| 255 | |
| ], | |
| "width": 1.3, | |
| "type": "esriSLS", | |
| "style": "esriSLSSolid" | |
| } | |
| }, | |
| "label": "> 204.125 to 408.25", | |
| "classMaxValue": 408.25 | |
| }, | |
| { | |
| "symbol": { | |
| "color": [ | |
| 0, | |
| 88, | |
| 36, | |
| 230 | |
| ], | |
| "size": 22, | |
| "angle": 0, | |
| "xoffset": 0, | |
| "yoffset": 0, | |
| "type": "esriSMS", | |
| "style": "esriSMSCircle", | |
| "outline": { | |
| "color": [ | |
| 189, | |
| 189, | |
| 189, | |
| 255 | |
| ], | |
| "width": 1.3, | |
| "type": "esriSLS", | |
| "style": "esriSLSSolid" | |
| } | |
| }, | |
| "label": "> 408.25 to 612.375", | |
| "classMaxValue": 612.375 | |
| }, | |
| { | |
| "symbol": { | |
| "color": [ | |
| 0, | |
| 88, | |
| 36, | |
| 230 | |
| ], | |
| "size": 30, | |
| "angle": 0, | |
| "xoffset": 0, | |
| "yoffset": 0, | |
| "type": "esriSMS", | |
| "style": "esriSMSCircle", | |
| "outline": { | |
| "color": [ | |
| 189, | |
| 189, | |
| 189, | |
| 255 | |
| ], | |
| "width": 1.3, | |
| "type": "esriSLS", | |
| "style": "esriSLSSolid" | |
| } | |
| }, | |
| "label": "> 612.375 to 816.5", | |
| "classMaxValue": 816.5 | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| "mode": 1, | |
| "id": "54018b7f06b943f2af278bbe415df1de_52" | |
| }, | |
| { | |
| "url": "http://maps2.dcgis.dc.gov/dcgis/rest/services/DCGIS_DATA/Education_WebMercator/MapServer/5", | |
| "visibility": true, | |
| "opacity": 0.78, | |
| "layerDefinition": { | |
| "drawingInfo": { | |
| "renderer": { | |
| "type": "classBreaks", | |
| "field": "TOTAL_STUD", | |
| "defaultSymbol": { | |
| "color": [ | |
| 0, | |
| 88, | |
| 36, | |
| 230 | |
| ], | |
| "size": 9, | |
| "angle": 0, | |
| "xoffset": 0, | |
| "yoffset": 0, | |
| "type": "esriSMS", | |
| "style": "esriSMSCircle", | |
| "outline": { | |
| "color": [ | |
| 189, | |
| 189, | |
| 189, | |
| 255 | |
| ], | |
| "width": 1.3, | |
| "type": "esriSLS", | |
| "style": "esriSLSSolid" | |
| } | |
| }, | |
| "minValue": 1, | |
| "classBreakInfos": [ | |
| { | |
| "symbol": { | |
| "color": [ | |
| 0, | |
| 88, | |
| 36, | |
| 230 | |
| ], | |
| "size": 4, | |
| "angle": 0, | |
| "xoffset": 0, | |
| "yoffset": 0, | |
| "type": "esriSMS", | |
| "style": "esriSMSCircle", | |
| "outline": { | |
| "color": [ | |
| 189, | |
| 189, | |
| 189, | |
| 255 | |
| ], | |
| "width": 1.3, | |
| "type": "esriSLS", | |
| "style": "esriSLSSolid" | |
| } | |
| }, | |
| "label": 0, | |
| "classMaxValue": 0 | |
| }, | |
| { | |
| "symbol": { | |
| "color": [ | |
| 0, | |
| 88, | |
| 36, | |
| 230 | |
| ], | |
| "size": 10, | |
| "angle": 0, | |
| "xoffset": 0, | |
| "yoffset": 0, | |
| "type": "esriSMS", | |
| "style": "esriSMSCircle", | |
| "outline": { | |
| "color": [ | |
| 189, | |
| 189, | |
| 189, | |
| 255 | |
| ], | |
| "width": 1.3, | |
| "type": "esriSLS", | |
| "style": "esriSLSSolid" | |
| } | |
| }, | |
| "label": "> 0 to 204.125", | |
| "classMaxValue": 204.125 | |
| }, | |
| { | |
| "symbol": { | |
| "color": [ | |
| 0, | |
| 88, | |
| 36, | |
| 230 | |
| ], | |
| "size": 16, | |
| "angle": 0, | |
| "xoffset": 0, | |
| "yoffset": 0, | |
| "type": "esriSMS", | |
| "style": "esriSMSCircle", | |
| "outline": { | |
| "color": [ | |
| 189, | |
| 189, | |
| 189, | |
| 255 | |
| ], | |
| "width": 1.3, | |
| "type": "esriSLS", | |
| "style": "esriSLSSolid" | |
| } | |
| }, | |
| "label": "> 204.125 to 408.25", | |
| "classMaxValue": 408.25 | |
| }, | |
| { | |
| "symbol": { | |
| "color": [ | |
| 0, | |
| 88, | |
| 36, | |
| 230 | |
| ], | |
| "size": 22, | |
| "angle": 0, | |
| "xoffset": 0, | |
| "yoffset": 0, | |
| "type": "esriSMS", | |
| "style": "esriSMSCircle", | |
| "outline": { | |
| "color": [ | |
| 189, | |
| 189, | |
| 189, | |
| 255 | |
| ], | |
| "width": 1.3, | |
| "type": "esriSLS", | |
| "style": "esriSLSSolid" | |
| } | |
| }, | |
| "label": "> 408.25 to 612.375", | |
| "classMaxValue": 612.375 | |
| }, | |
| { | |
| "symbol": { | |
| "color": [ | |
| 0, | |
| 88, | |
| 36, | |
| 230 | |
| ], | |
| "size": 30, | |
| "angle": 0, | |
| "xoffset": 0, | |
| "yoffset": 0, | |
| "type": "esriSMS", | |
| "style": "esriSMSCircle", | |
| "outline": { | |
| "color": [ | |
| 189, | |
| 189, | |
| 189, | |
| 255 | |
| ], | |
| "width": 1.3, | |
| "type": "esriSLS", | |
| "style": "esriSLSSolid" | |
| } | |
| }, | |
| "label": "> 612.375 to 816.5", | |
| "classMaxValue": 816.5 | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| "mode": 1, | |
| "id": "71b1039f9e3c4cf486a7bbd9b8498756_5" | |
| } | |
| ], | |
| "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": true, | |
| "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" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment