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
/* | |
* Jeff Jacobson, CGIS, ITS3 | |
* 2008-09 | |
*/ | |
using System.Text.RegularExpressions; | |
using System; | |
namespace Wsdot.Cgis.Extensions | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Web.Script.Serialization; | |
namespace LayerTypeDetector | |
{ | |
class Program |
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
/** | |
* Writes the properties of an object to a definition list. | |
* @param Any type of object. | |
* @return {string} Returns a definition list for most objects. Returns an ordered list for Arrays. Strings and Dates will return a string. | |
*/ | |
function objectToList(obj) { | |
var name, output, t, v; | |
t = typeof(obj); |
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
/** | |
* Converts a value to a string appropriate for entry into a CSV table. E.g., a string value will be surrounded by quotes. | |
* @param {string|number|object} theValue | |
* @param {string} sDelimiter The string delimiter. Defaults to a double quote (") if omitted. | |
*/ | |
function toCsvValue(theValue, sDelimiter) { | |
var t = typeof (theValue), output; | |
if (typeof (sDelimiter) === "undefined" || sDelimiter === null) { | |
sDelimiter = '"'; |
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
/// <summary> | |
/// <para>ArcGIS Server 10.1 introduced a bug that causes the output format to always be set to "json" | |
/// even if another format (e.g., "xml") is specified via the "f" parameter in the HTTP request. | |
/// This method reads the "f" parameter from the <paramref name="operationInput"/> and sets the | |
/// <paramref name="outputFormat"/> to be the same value as the "f" parameter.</para> | |
/// <para>If there is no "f" parameter in <paramref name="operationInput"/> then | |
/// <paramref name="outputFormat"/> will retain its original value.</para> | |
/// </summary> | |
/// <param name="boundVariables"></param> | |
/// <param name="outputFormat"></param> |
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
function generateScoreColorCss() { | |
/// <summary>Generates CSS style element that colors address candidate scored elements add adds the element to <head>.</summary> | |
/// <returns type="jQuery"> | |
var i, output = $("<style>"), css; | |
function generateStyle(min, max, color) { | |
var style = []; | |
for (i = min; i <= max; i++) { | |
if (i > min) { style.push(","); } | |
style.push(".score-" + i); |
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
/** | |
* 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(" "); | |
} |
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
// 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 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
//------------------------------------------------------------------------------ | |
// <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 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
/// <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); |