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
/** | |
* This script is a test to see whether the people who are supposed to be user testing your site are actually doing | |
* anything. It injects a piece of red text with content of George Washington somewhere in the document. It's designed | |
* to look for lowest hanging HTML dom nodes in the DOM tree (no children elements) that are visible (offsetParent is not null). | |
*/ | |
(function () { | |
var nodes = Array.prototype.filter.call(document.querySelectorAll('div, p, span, blockquote, code, a, td'), function (node) { | |
return !(node.children && node.children.length) && node.offsetParent !== null; | |
}); | |
if (nodes.length) { |
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 AMD helper function to convert dates stored as UTC milliseconds from January 1, 1970 to a date/time format more fitting | |
* for current location. | |
* Reason: ArcGIS Server stores dates without times as midnight UTC. When those times are translated into real dates, | |
* the browser often corrects the date for time zone differences, moving the date back several hours in the U.S. | |
*/ | |
/* globals define */ | |
define(function () { | |
var oneDay = 24 * 60 * 60 * 1000; | |
/** |
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
/** globals define */ | |
define([ | |
"dojo/_base/declare", | |
"dojo/Deferred", | |
"esri/tasks/query", | |
"esri/tasks/QueryTask", | |
"esri/request" | |
], function ( | |
declare, Deferred, Query, QueryTask, esriRequest | |
) { |
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
/* | |
* Custom Measurement Widget extension that connects to Popup dijit (esri/dijit/Popup), | |
* retrieves the selected feature, then passes the geometry to be measured by the Measurement Dijit. | |
*/ | |
define("custom.Measurement", | |
[ | |
"dojo/_base/declare", | |
"dojo/_base/lang", | |
"esri/dijit/Measurement", | |
"dojo/query", |
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/arcgis/utils"], function (arcgisUtils) { | |
// borrowed webmap id from https://developers.arcgis.com/javascript/jsapi/esri.arcgis.utils-amd.html#createmap | |
arcgisUtils.createMap("c41d5f3b4e304806a047702fbfc2759e", "mapdiv", { | |
usePopupManager: true, // just tossed this in there to show other webmap options | |
mapOptions: { | |
basemap: "streets", | |
center: [-15.469, 36.428] | |
lods: [ | |
//{ | |
// level: 0, |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<CacheInfo xsi:type='typens:CacheInfo' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:typens='http://www.esri.com/schemas/ArcGIS/10.1'> | |
<TileCacheInfo xsi:type='typens:TileCacheInfo'> | |
<SpatialReference xsi:type='typens:ProjectedCoordinateSystem'> | |
<WKT>PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0],AUTHORITY["EPSG",3857]]</WKT> | |
<XOrigin>-20037700</XOrigin> | |
<YOrigin>-30241100</YOrigin> | |
<XYScal |
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"], function (Map) { | |
var map = new Map("mapdiv", { | |
basemap: "streets", | |
center: [-15.469, 36.428] | |
lods: [ | |
//{ | |
// level: 0, | |
// resolution: 156543.033928, | |
// scale: 591657527.591555 | |
//}, |
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/request"], function (esriRequest) { | |
esriRequest.setRequestPreCallback(function(ioArgs){ | |
// test if we're sending the request to a mapservice query | |
if(/query\/?$/.test(ioArgs.url)){ | |
// if not requesting ObjectIds, count, or querying with a list of ObjectIDs, return distinct values. | |
if (ioArgs.content && !ioArgs.content.returnIdsOnly && !ioArgs.content.returnCountOnly && !ioArgs.content.objectIds) { | |
ioArgs.content.returnDistinctValues = true; | |
} | |
} | |
return ioArgs; |
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/tasks/QueryTask"], function (QueryTask) { | |
var url = "http://www.cat-hurders.com:6080/arcgis/rest/services/CatSightings/MapServer/", | |
qTask = new QueryTask(url + "?returnDistinctValues=true"); | |
//... | |
}); |
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/tasks/query", "esri/tasks/QueryTask", "dojo/_base/array",...], | |
function (..., Query, QueryTask, arrayUtils,...) { | |
... | |
// urls faked to protect the innocent kitties | |
var qTask = new QueryTask("http://www.cat-hurders.com:6080/arcgis/rest/services/CatSightings/MapServer/"), | |
query = new Query(); | |
// set up the parameters to query for the breeds | |
query.where = "1=1"; | |
query.outFields = ["breed"]; | |
query.returnGeometry = false; |