Skip to content

Instantly share code, notes, and snippets.

@jwieringa
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwieringa/1a21a6f24b8fba118e5d to your computer and use it in GitHub Desktop.
Save jwieringa/1a21a6f24b8fba118e5d to your computer and use it in GitHub Desktop.
US_State_Boundaries
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href=
"http://js.arcgis.com/3.14/esri/css/esri.css">
<title>Webmap created with Mundi</title>
<style>
#map { height:500px; } #mundi-link { position: absolute; right: 5px; z-index: 200; display: block; background: #C9D5DC; text-decoration: none; color: #4C4C4C; top: 5px; padding: 5px; border-radius: 2px; }
</style>
</head>
<body>
<div id="map">
<a id="mundi-link" href=
"http://benheb.github.io/mundi/?id=1a21a6f24b8fba118e5d"
target="_blank">View map in Mundi</a>
</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/1a21a6f24b8fba118e5d", 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>
</html>
{
"item": {
"title": "New Map",
"snippet": "US_State_Boundaries",
"extent": [
[
-137.7615681788987,
26.079053107525535
],
[
-25.2615681789286,
48.92435192163839
]
]
},
"itemData": {
"operationalLayers": [
{
"url": "https://services1.arcgis.com/IAQQkLXctKHrf8Av/arcgis/rest/services/US_State_Boundaries/FeatureServer/0",
"visibility": true,
"opacity": 0.78,
"layerDefinition": {
"drawingInfo": {
"renderer": {
"visualVariables": [
{
"type": "colorInfo",
"field": "DRAWSEQ",
"stops": [
{
"value": 1,
"color": {
"r": 255,
"g": 247,
"b": 251,
"a": 0.7843137254901961
},
"label": null
},
{
"value": 7.25,
"color": {
"r": 236,
"g": 226,
"b": 240,
"a": 0.7843137254901961
},
"label": null
},
{
"value": 13.5,
"color": {
"r": 208,
"g": 209,
"b": 230,
"a": 0.7843137254901961
},
"label": null
},
{
"value": 19.75,
"color": {
"r": 166,
"g": 189,
"b": 219,
"a": 0.7843137254901961
},
"label": null
},
{
"value": 26,
"color": {
"r": 103,
"g": 169,
"b": 207,
"a": 0.7843137254901961
},
"label": null
},
{
"value": 32.25,
"color": {
"r": 54,
"g": 144,
"b": 192,
"a": 0.7843137254901961
},
"label": null
},
{
"value": 38.5,
"color": {
"r": 2,
"g": 129,
"b": 138,
"a": 0.7843137254901961
},
"label": null
},
{
"value": 44.75,
"color": {
"r": 1,
"g": 100,
"b": 80,
"a": 0.7843137254901961
},
"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"
}
}
}
},
"mode": 1,
"id": "graphicsLayer3"
}
],
"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