Skip to content

Instantly share code, notes, and snippets.

@ajturner
Created July 31, 2015 20:41
Show Gist options
  • Select an option

  • Save ajturner/5b69cc1de0d23b85ce1f to your computer and use it in GitHub Desktop.

Select an option

Save ajturner/5b69cc1de0d23b85ce1f to your computer and use it in GitHub Desktop.
Public Schools
<!DOCTYPE html> <meta charset="utf-8"> <link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css"> <style> #map { height:500px; } </style> <body> <div id="map"></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="http://js.arcgis.com/3.14/"></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) { $.getJSON("https://api.github.com/gists/5b69cc1de0d23b85ce1f", 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(); }); }); }); }); </script> </body>
{"item":{"title":"New Map","snippet":"Public Schools","extent":[[-77.44315944293868,38.75847465450012],[-76.57729945758827,39.03796028806459]]},"itemData":{"operationalLayers":[{"url":"https://services.arcgis.com/OUDgwkiMsqiL8Tvp/arcgis/rest/services/Public_Schools/FeatureServer/0","visibility":true,"opacity":0.78,"mode":1,"id":"graphicsLayer0","minScale":0,"maxScale":0,"layerDefinition":{"drawingInfo":{"renderer":{"type":"classBreaks","field":"TOTAL_STUD","minValue":1,"classBreakInfos":[{"symbol":{"color":[140,107,177,255],"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":[140,107,177,255],"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":[140,107,177,255],"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":[140,107,177,255],"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":[140,107,177,255],"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}]}}}}],"baseMap":{"baseMapLayers":[{"opacity":1,"visibility":true,"url":"http://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Base/MapServer"},{"opacity":0.3,"visibility":true,"url":"http://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"}],"title":"basemap"},"version":"1.0"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment