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
// Setup Google Analytics, but not if user has specified that they don't want to be tracked. | |
(function (dnt, cookieDomain) { | |
var scriptTag, hostRe = new RegExp(cookieDomain.replace(".", "\\.") + "$"); | |
if (dnt !== "yes" && dnt !== "1") { | |
window.ga = window.ga || function () { (ga.q = ga.q || []).push(arguments) }; ga.l = +new Date; | |
ga('create', 'YOUR-ID-HERE', hostRe.test(location.host) ? cookieDomain : "auto"); | |
ga(function (tracker) { | |
tracker.set("appName", "Your app name here"); | |
tracker.send('pageview'); | |
}); |
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
/// <summary> | |
/// Converts from a JavaScript Date value in milliseconds to a <see cref="DateTimeOffset"/>. | |
/// </summary> | |
/// <param name="milliseconds">Number of milliseconds since 1970-1-1T00:00:00</param> | |
/// <returns>Returns the <see cref="DateTimeOffset"/> equivalent of <paramref name="milliseconds"/>.</returns> | |
public static DateTimeOffset FromJSDateToDateTimeOffset(this double milliseconds) | |
{ | |
return new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero).AddMilliseconds(milliseconds * 1000); | |
} |
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
// For use withhttp://proj4js.org/ | |
/** @typedef {(string|proj4.Proj)} Projection | |
* | |
*/ | |
/** @typedef {object} ThisProjectionInfo | |
* @property {?Projection} inPrj | |
* @property {?Projection} outPrj | |
*/ |
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 query string parameter. | |
@returns {String|null} Returns the value of the query string parameter, or null if that parameter is not defined. | |
*/ | |
function getQueryStringParameter(/** {String} */ key) { | |
var keyRe, match, output = null; | |
if (document.location.search.length) { | |
keyRe = new RegExp(key + "=([^\\&]+)", "i"); | |
match = document.location.search.match(keyRe); | |
if (match) { | |
output = match[1]; |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using Dict = System.Collections.Generic.Dictionary<string, object>; | |
/* | |
Licensed under the MIT license (http://opensource.org/licenses/MIT) | |
Copyright (c) 2013 Washington State Department of Transportation |
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> | |
<title></title> | |
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/esri/css/esri.css" /> | |
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.3compact" type="text/javascript"></script> | |
<style> | |
html, body, #map, map.container { | |
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
/// <summary> | |
/// Appends an AccessCode parameter to the input URI if it is a WSDOT Traveler Info REST API URI and does not already have an AccessCode parameter. | |
/// </summary> | |
/// <param name="uri">The URI passed to the proxy. Note that this string will be modified if an access code is determined to be necessary.</param> | |
/// <example> | |
/// <code><![CDATA[public void ProcessRequest (HttpContext context) { | |
/// HttpResponse response = context.Response; | |
/// // Get the URL requested by the client (take the entire querystring at once to handle the case of the URL itself containing querystring parameters) | |
/// string uri = context.Request.Url.Query.Substring(1); | |
/// AddTravelerApiAccessCodeIfNecessary(ref uri); |
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
//------------------------------------------------------------------------------ | |
// <auto-generated> | |
// This code was generated by a tool. | |
// Runtime Version:4.0.30319.269 | |
// | |
// Changes to this file may cause incorrect behavior and will be lost if | |
// the code is regenerated. | |
// </auto-generated> | |
//------------------------------------------------------------------------------ |
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
// from http://www.gal-systems.com/2011/07/convert-coordinates-between-web.html | |
private void ToGeographic(ref double mercatorX_lon, ref double mercatorY_lat) | |
{ | |
if (Math.Abs(mercatorX_lon) < 180 && Math.Abs(mercatorY_lat) < 90) | |
return; | |
if ((Math.Abs(mercatorX_lon) > 20037508.3427892) || (Math.Abs(mercatorY_lat) > 20037508.3427892)) | |
return; |
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
/** | |
* Splits a Pascal-Case word into individual words separated by spaces. | |
* @param {Object} word | |
* @returns {String} | |
*/ | |
function splitPascalCase(word) { | |
var wordRe = /($[a-z])|[A-Z][^A-Z]+/g; | |
return word.match(wordRe).join(" "); | |
} |