Skip to content

Instantly share code, notes, and snippets.

@jgravois
Last active October 12, 2015 01:54
Show Gist options
  • Save jgravois/10035880e7252707890e to your computer and use it in GitHub Desktop.
Save jgravois/10035880e7252707890e to your computer and use it in GitHub Desktop.
add webmap from JSON instead of ArcGIS Online in Viewer.
<script type="text/javascript" src="./config/webmap.js"></script>
<!--existing tag-->
<script type="text/javascript" src="//js.arcgis.com/3.10/"></script>
//...
this._createWebMap(customWebmap);
var customWebmap = {};
customWebmap.item = {
"title": "Soil Survey Map of USA",
"snippet": "This map shows the Soil Survey Geographic (SSURGO) by the United States Department of Agriculture's Natural Resources Conservation Service.",
"extent": [
[-139.4916, 10.7191],
[-52.392, 59.5199]
]
};
customWebmap.itemData = {
"operationalLayers": [{
"url": "http://server.arcgisonline.com/ArcGIS/rest/services/Specialty/Soil_Survey_Map/MapServer",
"visibility": true,
"opacity": 0.75,
"title": "Soil Survey Map",
"itemId": "204d94c9b1374de9a21574c9efa31164"
}],
"baseMap": {
"baseMapLayers": [{
"opacity": 1,
"visibility": true,
"url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer"
}, {
"isReference": true,
"opacity": 1,
"visibility": true,
"url": "http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer"
}],
"title": "World_Terrain_Base"
},
"version": "1.1"
};
@asgharkhall
Copy link

Sir , actually the problem is this template , this is responsive Js Template of basic viewer , now my problem is what , in defaults.js there are webmap id , i want own map services with json ,
thanks for help .
http://www.arcgis.com/home/item.html?id=b17113eb9535427db477777f86f25d63
this is the viewer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment