Skip to content

Instantly share code, notes, and snippets.


David Spriggs DavidSpriggs

View GitHub Profile
DavidSpriggs / viewer.js
Created July 14, 2015 19:47
widget for viewer.js config file that loads an href via a content pane.
View viewer.js
hrefContent: {
include: true,
title: 'hrefContent',
id: 'myWidgetID',
type: 'titlePane',
position: 10,
path: 'dijit/layout/ContentPane',
options: {
href: 'js/gis/dijit/Help/templates/HelpDialog.html',
preload: true
View Gruntfile.js
/*global module:false*/
module.exports = function(grunt) {
// Load grunt tasks automatically
// Project configuration.
// use esri_slurp to download api locally. This allows a custom build of the

Keybase proof

I hereby claim:

  • I am davidspriggs on github.
  • I am davidspriggs ( on keybase.
  • I have a public key whose fingerprint is A1F3 7C7A 5041 8EF1 14B6 DF4C C02B 6411 C145 BDB2

To claim this, I am signing this object:

DavidSpriggs / Multi-line
Last active January 9, 2017 20:27 — forked from asizer/
Multi-line labels with label layer
View Multi-line

Multi-line labels on a Feature Layer

This is a workaround to add line breaks to the Label Layer

NOTE: I can't figure out a way to return all the labels for a Feature Layer here, unfortunately. The Label Layer only returns the labels that will fit into their elements, or not conflict with other labels, as calculated based on the original, single-line label. Splitting these labels into multiple lines might reduce conflicts, or allow them to fit properly within their polygons, but because they were conflicted out in the first place, we never see them.

DavidSpriggs / _repositionInfoWin.js
Created July 25, 2014 20:49
Reposition infoWindow if out of frame
View _repositionInfoWin.js
_repositionInfoWin: function(graphic) {
// Determine the upper right, and center, coordinates of the map
var maxPoint = new esri.geometry.Point(this._map.extent.xmax, this._map.extent.ymax, this._map.spatialReference);
var centerPoint = new esri.geometry.Point(this._map.extent.getCenter());
// Convert to screen coordinates
var maxPointScreen = this._map.toScreen(maxPoint);
var centerPointScreen = this._map.toScreen(centerPoint);
var graphicPointScreen = this._map.toScreen(graphic.geometry); // Points only
// Buffer
var marginLR = 10;
DavidSpriggs / viewer.js
Created July 22, 2014 17:21
Config for higher quality dynamic maps services
View viewer.js
], function(InfoTemplate, units, Extent, esriConfig, GeometryService, ImageParameters) {
// url to your proxy page, must be on same machine hosting you app. See proxy folder for readme.
DavidSpriggs / streetview_pro4js_snipits.js
Last active August 29, 2015 14:04
streetview pro4js code
View streetview_pro4js_snipits.js
getStreetView: function(mapPoint) {
// location chosen by clicking the left panel button or by using streetview widget, 'display', 'none');, 'display', 'inline-block');
if (mapPoint.spatialReference.wkid !== 4326) {
var coordinatesToProject = {
x: mapPoint.x,
y: mapPoint.y
var fromProjection = this.wkt_26852;
DavidSpriggs / DrawAndMeasurement.js
Last active August 29, 2015 14:02
Adding two widgets to one title pane
View DrawAndMeasurement.js
], function(declare, _WidgetBase, Measurement, Draw, aspect, lang, domConstruct, TitlePane) {
DavidSpriggs / async.js
Created June 3, 2014 19:04
dojo async plugin
View async.js
/*global dojoConfig */
define(function() {
var cb = '_asyncApiLoaderCallback';
return {
load: function(param, req, loadCallback) {
if (!cb) {
} else {
dojoConfig[cb] = function() {
delete dojoConfig[cb];