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> | |
<title>Dynamic Map Services</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.3/leaflet.css" /> | |
<link rel="stylesheet" href="demo.css" /> | |
<!--[if lte IE 8]><link rel="stylesheet" href="leaflet/leaflet.ie.css" /><![endif]--> | |
<script src="http://cdn.leafletjs.com/leaflet-0.6.3/leaflet.js"></script> | |
<script src="http://gravois/leaflet/esri-leaflet.min.js"></script> |
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
require([ | |
"esri/map", "esri/InfoTemplate", "esri/layers/FeatureLayer", | |
"dojo/parser", "dojo/domReady!" | |
], function( //Beginning of anonymous callback which fires when modules have been loaded. | |
Map, InfoTemplate, FeatureLayer, | |
parser //Variable names to refer to loaded modules | |
) { | |
parser.parse(); //first line of actual callback code | |
map = new Map("mapDiv", { | |
basemap: "national-geographic", |
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
//legacy | |
dojo.require(“esri.layers.FeatureLayer”); | |
var featureLayer = new esri.layers.FeatureLayer("url"); | |
//AMD | |
require([ | |
"esri/map", … "esri/layers/FeatureLayer" | |
], function( | |
Map, …, FeatureLayer, |
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
dojo.byId("messages").innerHTML = "howdy"; //legacy | |
//becomes | |
dom.byId("messages").innerHTML = "why, hello there"; //AMD |
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
if(response.features.length && !response.error){ | |
//loop through fields returned by service | |
for (var j = response.fields.length - 1; j >= 0, j--) { | |
//find field with type 'esriFieldTypeOID' and use its name as an attribute when converting to GeoJSON | |
if(response.fields[j].type == "esriFieldTypeOID") | |
var idKey = response.fields[j].name | |
} | |
for (var i = response.features.length - 1; i >= 0; i--) { | |
var feature = response.features[i]; | |
var id = feature.attributes[idKey]; |
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
use outStatistics | |
http://services.arcgis.com/OfH668nDRN7tbJh0/arcgis/rest/services/My_Walks/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&geohash=&inSR=&spatialRel=esriSpatialRelIntersects&distance=&units=esriSRUnit_Meter&outFields=&returnGeometry=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnDistinctValues=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=%5B%7B%0D%0A++++%22statisticType%22%3A+%22max%22%2C%0D%0A++++%22onStatisticField%22%3A+%22WHEN%22%0D%0A%7D%5D&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&quantizationParameters=&f=pjson&token= | |
// not the old hack you used with driskull | |
FIELD=(SELECT MAX(FIELD) FROM TABLE) | |
http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3/query?where=POP2007=(SELECT MAX(POP2007) FROM states)&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIn |
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
var sun = new SolarTerminatorLayer({ | |
map: map // (required) map object. default: null. | |
}, "SunButton"); //div for the widget | |
sun.startup(); |
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
//sometimes we see.. | |
<script>var dojoConfig = { async: true };</script> | |
<script src="http://js.arcgis.com/3.10/"></script> | |
//or maybe.. | |
<script data-dojo-config="async:true" src="http://js.arcgis.com/3.10/"> | |
</script> |
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
<script src="http://js.arcgis.com/3.10/"></script> |
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
<script> | |
var dojoConfig = { | |
async:true, | |
cacheBust:new Date(), | |
waitSeconds:5, | |
isDebug:true, | |
useDeferredInstrumentation:true | |
}; | |
</script> |
OlderNewer