This file contains 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
/** | |
* An update on David Walsh's Unique Combobox | |
* Updated for Dojo AMD (tested at v. 1.10) | |
* Originally posted: https://davidwalsh.name/unique-combobox | |
*/ | |
define("davidwalsh.form._UniqueComboBoxMenu", | |
["dojo/_base/declare", "dojo/_base/array", "dijit/form/_ComboBoxMenu"], | |
function (declare, arrayUtils, _ComboBoxMenu) { | |
return declare([_ComboBoxMenu], { | |
createOptions: function (results, dataObject, labelFunc) { |
This file contains 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
/** | |
* Gets a time stamp out of either localStorage, or a cookie session, if those are available. | |
* Use in conjunction with SetTimeStamp module. | |
* @module GetTimeStamp | |
* @param {string} id - string id you want to use to retrieve a time stamp from the browser | |
* @returns {Date} - Date of the last time stamp | |
*/ | |
define(["dojo/cookie"], function (cookie) { | |
return { | |
load: function (id, require, callback) { |
This file contains 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> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> | |
<title>Simple Map</title> | |
<link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css"> | |
<style> | |
html, body, #map { | |
height: 100%; |
This file contains 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 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 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 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 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 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 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"); | |
//... | |
}); |