Skip to content

Instantly share code, notes, and snippets.

View tedrick's full-sized avatar

James Tedrick tedrick

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="fragment" content="!">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
@tedrick
tedrick / dynText.js
Created May 13, 2016 12:15
Dynamic Text for Story Map example
require(
["esri/tasks/query", "esri/tasks/QueryTask", "dojo/query", "dojo/NodeList-html"],
function(Query, QTask, dQuery){
var config = {
url: <LAYER URL>
query: "1=1",
fields: [<STAT FIELD(s)>],
dynTextMapping: {
statement: {
field: "datetext",
@tedrick
tedrick / keyUp.js
Last active December 21, 2015 13:39
Basic keyboard navigation for Story Map Series (place in index.html's custom JS section in the tpl-ready handler)
$(document).keyup(function(e){
//Right > forward
if (e.which === 39 || e.which === 34) {
var currentIndex = app.data.getCurrentEntryIndex();
if (currentIndex < app.data.getStoryLength() -1) {
topic.publish("story-navigate-entry", currentIndex + 1);
console.log('right');
console.log(currentIndex);
}
}