UNPKG

usng-gmaps

Version:

USNG for Google Maps V3

860 lines (736 loc) 267 kB
import { MARCONI } from './marconi.library'; /* eslint-disable */ export const MARCONIMAP = function() { var METERS_TO_SURVEY_FEET = 3.28083333333333; var SURVEY_FEET_TO_METERS = 1.0 / METERS_TO_SURVEY_FEET; // post-1955 "standard" definition of feet to meters is international standard // used for example by Oregon for its state plane system, but not used by most states var METERS_TO_INTERNATIONAL_FEET = 100 / (2.54 * 12); var INTERNATIONALFEET_TO_METERS = 12 * 2.54 / 100; var DEGREES_TO_RADIANS = Math.PI/ 180; var RADIANS_TO_DEGREES = 180 / Math.PI; // ellipsoid constants var ELLIPSOID_GRS80 = "GRS80"; var ELLIPSOID_WGS84 = "WGS84"; var ELLIPSOID_AIRY1830 = "AIRY"; var ELLIPSOID_AIRY1849 = "AIRY1849"; var ELLIPSOID_CLARKE1866 = "CLARKE1866"; var ELLIPSOID_BESSEL = "BESSEL"; // BESSEL 1842 var ELLIPSOID_GRS80_STR = "GRS 80"; var ELLIPSOID_CLARKE1866_STR = "Clarke 1866"; var ELLIPSOID_WGS84_STR = "WGS 84"; var RADIUS_CLARKE1866_METERS = 6378206.4; var RADIUS_WGS84_METERS = 6378137.0; var RADIUS_GRS80_METERS = 6378137.0; var RADIUS_AIRY1830_METERS = 6377563.396; var RADIUS_AIRY1849_METERS = 6377340.189; var RADIUS_CLARKE1866_SURVEYFEET = RADIUS_CLARKE1866_METERS * METERS_TO_SURVEY_FEET; var RADIUS_GRS80_SURVEYFEET = RADIUS_GRS80_METERS * METERS_TO_SURVEY_FEET; var RADIUS_GRS80_INTERNATIONALFEET = RADIUS_GRS80_METERS * METERS_TO_INTERNATIONAL_FEET; var eSquared_CLARKE1866 = 0.006768658; var eSquared_WGS84 = 0.00669437999014; var eSquared_GRS80 = 0.00669438; var eSquared_AIRY1830 = 0.006670540074149084; var eSquared_AIRY1849 = 0.00667054015; var E_CLARKE1866 = 0.0822718542230039; var E_GRS80 = 0.0818191911198883; var E_WGS84 = 0.081819190842622; var E_AIRY1830 = 0.0816733743281685; var E_AIRY1849 = 0.08167337375652854; var FINV_CLARKE1866 = 294.9786982; var FINV_GRS80 = 298.257222101; var FINV_WGS84 = 298.257223563; var FINV_AIRY1830 = 299.3249753; var FINV_AIRY1849 = 299.3249646; // these codes for datum, units, coord systems, etc. should be used by any source code in lieu // of literal strings, to ensure exact matches with no only javscript source but also database code values var DATUM_HORIZ_1927 = "NAD27"; var DATUM_HORIZ_1983 = "NAD83"; var DATUM_HORIZ_WGS84 = "WGS84"; var DATUM_HORIZ_OSGB = "OSGB"; var DATUM_HORIZ_IRISH65 = "IRISH65"; var DATUM_HORIZ_DEFAULT = DATUM_HORIZ_WGS84; var UNITS_INTERNATIONALFEET = "ft"; var UNITS_SURVEYFEET = "usft"; var UNITS_METERS = "m"; var UNITS_KILOMETERS = "km"; var UNITS_MILES = "mi"; var UNITS_DEGREES = "degrees"; var UNITS_GRID = "grid"; var UNITS_SQUAREMETERS = "sqm"; var UNITS_HECTARES = "hectare"; var UNITS_ACRES = "ac"; var UNITS_NAUTMILES = "nmi"; var UNITS_SQUAREMILES = "sqmi"; var UNITS_SQUARENAUTMILES = "sqnmi"; var UNITS_DEFAULT = UNITS_DEGREES; var COORDSYS_WORLD = "WORLD"; var COORDSYS_CAZONE2 = "CAZONE2"; var COORDSYS_CAZONE3 = "CAZONE3"; var COORDSYS_CAZONE4 = "CAZONE4"; var COORDSYS_UTM10 = "UTM10"; var COORDSYS_USNG = "USNG"; var COORDSYS_MGRS = "MGRS"; var COORDSYS_GARS = "GARS"; var COORDSYS_CAP_CLASSIC = "CAP_CLASSIC"; var COORDSYS_CAP_CELL = "CAP_CELL"; var COORDSYS_ALBERS_CONUS = "ALBERS_CONUS"; var COORDSYS_EBMUDGRID = "EBMUD"; var COORDSYS_LAMBERTCUSTOM = "LAMBERTCUSTOM"; var COORDSYS_TMCUSTOM = "TMCUSTOM"; var COORDSYS_UTM18 = "UTM18"; var COORDSYS_UTM = "UTM"; var COORDSYS_DEFAULT = COORDSYS_WORLD; var COORDSYS_OSGB = "OSGB"; // Ordnance Survey Great Britain var COORDSYS_IRISH = "IRISH"; var DATUM_HORIZ_1927_STR = "NAD 1927"; var DATUM_HORIZ_1983_STR = "NAD 1983"; var DATUM_HORIZ_WGS84_STR = "WGS84"; var DATUM_HORIZ_OSGB_STR = "OSGB datum"; var DATUM_HORIZ_IRISH65_STR = "Irish 1965 datum"; var DATUM_HORIZ_DEFAULT_STR = DATUM_HORIZ_WGS84_STR; var UNITS_INTERNATIONALFEET_STR = "International feet (rarely used)"; var UNITS_SURVEYFEET_STR = "US Survey feet (usual kind for maps)"; var UNITS_METERS_STR = "Meters"; var UNITS_MILES_STR = "Miles"; var UNITS_NAUTMILES_STR = "Nautical Miles"; var UNITS_KILOMETERS_STR = "Kilometers"; var UNITS_DEGREES_STR = "Degrees"; var UNITS_GRID_STR = "Grid and-or page designation"; // for grids or atlas systems var UNITS_SQUAREMETERS_STR = "Square meters"; var UNITS_HECTARES_STR = "Hectare"; var UNITS_ACRES_STR = "Acre"; var UNITS_SQUAREMILES_STR = "Square miles"; var UNITS_SQUARENAUTMILES_STR = "Square nautical miles"; var COORDSYS_WORLD_STR = "World (lat/long)"; var COORDSYS_CAZONE2_STR = "CA Zone 2"; var COORDSYS_CAZONE3_STR = "CA Zone 3 (SF Bay Area)"; var COORDSYS_CAZONE4_STR = "CA Zone 4"; var COORDSYS_UTM10_STR = "UTM Zone 10 (SF Bay Area)"; var COORDSYS_USNG_STR = "US National Grid"; var COORDSYS_MGRS_STR = "US Military Grid Ref System (MGRS)"; var COORDSYS_GARS_STR = "Global Area Reference System grid (GARS)"; var COORDSYS_CAP_CLASSIC_STR = "Civil Air Patrol classic"; var COORDSYS_CAP_CELL_STR = "Civil Air Patrol Cell system"; var COORDSYS_ALBERS_CONUS_STR = "Albers Equal-area conic for CONUS"; var COORDSYS_TMCUSTOM_STR = "Custom Transverse Mercator"; var COORDSYS_UTM18_STR = "UTM Zone 18"; var COORDSYS_UTM_STR = "UTM"; var COORDSYS_EBMUDGRID_STR = "EBMUD map grid"; var COORDSYS_LAMBERTCUSTOM_STR = "Lambert custom"; var COORDSYS_OSGB_STR = "Ordnance Survey Great Britain"; var COORDSYS_IRISH_STR = "Irish Grid"; var COORDSYS_TYPE_WORLD = "WORLD"; var COORDSYS_TYPE_LAMBERT = "LAMBERT"; var COORDSYS_TYPE_TM = "TM"; var COORDSYS_TYPE_GRID = "GRID"; var COORDSYS_TYPE_ATLAS = "ATLAS"; var COORDSYS_TYPE_MERCATOR = "MERCATOR"; var COORDSYS_TYPE_ALBERS = "ALBERS"; var COORDSYS_TYPE_STEREO = "STEREO"; var SPATIALREF_LATLONG_WGS84 = "LATLONG_WGS84"; var SPATIALREF_LATLONG_NAD27 = "LATLONG_NAD27"; var SPATIALREF_LATLONG_NAD83 = "LATLONG_NAD83"; var SPATIALREF_LATLONG_OSGB = "LATLONG_OSGB"; var SPATIALREF_UTM10_NAD83 = "UTM10_NAD83"; var SPATIALREF_UTM10_NAD27 = "UTM10_NAD27"; var SPATIALREF_UTM_NAD83 = "UTM_NAD83"; var SPATIALREF_UTM_NAD27 = "UTM_NAD27"; var SPATIALREF_EBMUDGRID = "EBMUD"; var SPATIALREF_USNG = "USNG"; var SPATIALREF_MGRS = "MGRS"; var SPATIALREF_GARS = "GARS"; var SPATIALREF_CAP_CLASSIC = "CAP_CLASSIC"; var SPATIALREF_CAP_CELL = "CAP_CELL"; var SPATIALREF_UTM18_NAD83 = "UTM18_NAD83"; var SPATIALREF_ALBERS_CONUS = "ALBERS_CONUS"; var SPATIALREF_OSGB = "OSGB"; var SPATIALREF_IRISH = "IRISH"; var SPATIALREF_DEFAULT_INPUT = SPATIALREF_LATLONG_WGS84; var SPATIALREF_DEFAULT_OUTPUT = SPATIALREF_USNG; var SPATIALREF_FOR_STORAGE = SPATIALREF_LATLONG_WGS84; var _datumArray = [ {datumCD: DATUM_HORIZ_1927, datumName: DATUM_HORIZ_1927_STR, isActive:true, equitorialAxisMeters: RADIUS_CLARKE1866_METERS, eccentricity: E_CLARKE1866, eccentricitySquared: eSquared_CLARKE1866, flatteningInverse:FINV_CLARKE1866}, {datumCD: DATUM_HORIZ_1983, datumName: DATUM_HORIZ_1983_STR, isActive:true, equitorialAxisMeters: RADIUS_GRS80_METERS, eccentricity: E_GRS80, eccentricitySquared: eSquared_GRS80, flatteningInverse:FINV_GRS80}, {datumCD: DATUM_HORIZ_WGS84, datumName: DATUM_HORIZ_WGS84_STR, isActive:true, equitorialAxisMeters: RADIUS_WGS84_METERS, eccentricity: E_WGS84, eccentricitySquared:eSquared_WGS84, flatteningInverse:FINV_WGS84}, {datumCD: DATUM_HORIZ_OSGB, datumName: DATUM_HORIZ_OSGB_STR, isActive:true, equitorialAxisMeters: RADIUS_AIRY1830_METERS, eccentricity: E_AIRY1830, eccentricitySquared:eSquared_AIRY1830, flatteningInverse:FINV_AIRY1830}, {datumCD: DATUM_HORIZ_IRISH65, datumName: DATUM_HORIZ_IRISH65_STR, isActive:true, equitorialAxisMeters: RADIUS_AIRY1849_METERS, eccentricity: E_AIRY1849, eccentricitySquared:eSquared_AIRY1849, flatteningInverse:FINV_AIRY1849} ]; var _mapUnitArray = [ {mapUnitCD: UNITS_DEGREES, unitName: UNITS_DEGREES_STR, isLinear: false, isActive:true}, {mapUnitCD: UNITS_SURVEYFEET, unitName: UNITS_SURVEYFEET_STR, isLinear: true, metersPerUnit: SURVEY_FEET_TO_METERS, isActive:true}, {mapUnitCD: UNITS_MILES, unitName: UNITS_MILES_STR, isLinear: true, metersPerUnit: SURVEY_FEET_TO_METERS*5280.0, isActive:true}, {mapUnitCD: UNITS_METERS, unitName: UNITS_METERS_STR, isLinear: true, metersPerUnit: 1.0, isActive:true}, {mapUnitCD: UNITS_KILOMETERS, unitName: UNITS_KILOMETERS_STR, isLinear: true, metersPerUnit: 1000.0, isActive:true}, {mapUnitCD: UNITS_NAUTMILES, unitName: UNITS_NAUTMILES_STR, isLinear: true, metersPerUnit: 1852.0, isActive:true}, {mapUnitCD: UNITS_GRID, unitName: UNITS_GRID_STR, isLinear: false, isActive:true}, {mapUnitCD: UNITS_INTERNATIONALFEET, unitName: UNITS_INTERNATIONALFEET_STR, isLinear: true, metersPerUnit: INTERNATIONALFEET_TO_METERS, isActive:true}, {mapUnitCD: UNITS_SQUAREMETERS, unitName: UNITS_SQUAREMETERS_STR, isLinear: false, metersPerUnit: 1.0, isAreal: true, isActive:true}, {mapUnitCD: UNITS_HECTARES, unitName: UNITS_HECTARES_STR, isLinear: false, metersPerUnit: 10000, isAreal: true, isActive:true}, {mapUnitCD: UNITS_ACRES, unitName: UNITS_ACRES_STR, isLinear: false, metersPerUnit: 4046.85642, isAreal: true, isActive:true}, {mapUnitCD: UNITS_SQUAREMILES, unitName: UNITS_ACRES_STR, isLinear: false, metersPerUnit: 2589988.11, isAreal: true, isActive:true}, {mapUnitCD: UNITS_SQUARENAUTMILES, unitName: UNITS_ACRES_STR, isLinear: false, metersPerUnit: 1852*1852, isAreal: true, isActive:true} ]; var _coordSysArray = [ {coordSysCD: COORDSYS_WORLD, coordSysName: COORDSYS_WORLD_STR, coordSysTypeCD: COORDSYS_TYPE_WORLD, isActive: true}, {coordSysCD: COORDSYS_CAZONE2, coordSysName: COORDSYS_CAZONE2_STR, coordSysTypeCD: COORDSYS_TYPE_LAMBERT, isActive: false}, {coordSysCD: COORDSYS_CAZONE3, coordSysName: COORDSYS_CAZONE3_STR, coordSysTypeCD: COORDSYS_TYPE_LAMBERT, isActive: true}, {coordSysCD: COORDSYS_CAZONE4, coordSysName: COORDSYS_CAZONE4_STR, coordSysTypeCD: COORDSYS_TYPE_LAMBERT, isActive: false}, {coordSysCD: COORDSYS_UTM, coordSysName: COORDSYS_UTM_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, isActive: true}, {coordSysCD: COORDSYS_UTM10, coordSysName: COORDSYS_UTM10_STR, coordSysTypeCD: COORDSYS_TYPE_TM, isActive: true}, {coordSysCD: COORDSYS_UTM18, coordSysName: COORDSYS_UTM18_STR, coordSysTypeCD: COORDSYS_TYPE_TM, isActive: false}, {coordSysCD: COORDSYS_USNG, coordSysName: COORDSYS_USNG_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, isActive: true}, {coordSysCD: COORDSYS_MGRS, coordSysName: COORDSYS_MGRS_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, isActive: true}, {coordSysCD: COORDSYS_GARS, coordSysName: COORDSYS_GARS_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, isActive: true}, {coordSysCD: COORDSYS_CAP_CLASSIC, coordSysName: COORDSYS_CAP_CLASSIC_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, isActive: true}, {coordSysCD: COORDSYS_CAP_CELL, coordSysName: COORDSYS_CAP_CELL_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, isActive: true}, {coordSysCD: COORDSYS_ALBERS_CONUS, coordSysName: COORDSYS_ALBERS_CONUS_STR, coordSysTypeCD: COORDSYS_TYPE_ALBERS, isActive: true}, {coordSysCD: COORDSYS_EBMUDGRID, coordSysName: COORDSYS_EBMUDGRID_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, isActive: true, stateCD: "CA", zone: 3, gridTemplate: "{0,number,0000}B{1,number,000}", gridCellSizeHorizontal: 3000, gridCellSizeVertical: 2000, baseCoordSysCD: COORDSYS_CAZONE3}, {coordSysCD: COORDSYS_LAMBERTCUSTOM, coordSysName: COORDSYS_LAMBERTCUSTOM_STR, coordSysTypeCD: COORDSYS_TYPE_LAMBERT, isActive: true}, {coordSysCD: COORDSYS_TMCUSTOM, coordSysName: COORDSYS_TMCUSTOM_STR, coordSysTypeCD: COORDSYS_TYPE_TM, isActive: true}, {coordSysCD: COORDSYS_OSGB, coordSysName: COORDSYS_OSGB_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, isActive: true}, {coordSysCD: COORDSYS_IRISH, coordSysName: COORDSYS_IRISH_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, isActive: true} ]; // datum shifts, if named the names should be identical to any functionally identical datum shifts defined on the server // so that ajax refresh does not create a duplicate datum shift var _datumShifts = [ {fromDatumCD: DATUM_HORIZ_1983, toDatumCD: DATUM_HORIZ_WGS84, datumShiftMethodCD: 'SYNONYM', datumShiftMethodName: 'Synonym -- the datums are essentially identical', isActive:true}, {fromDatumCD: DATUM_HORIZ_1927, toDatumCD: DATUM_HORIZ_WGS84, datumShiftMethodCD: 'MRE', datumShiftMethodName: 'Multiple Regression Equation (MRE)', isActive:true, longitudeCoefficients: [ {expLat: 0, expLong: 0, value: -0.88437}, {expLat: 0, expLong: 1, value: 2.05061}, {expLat: 1, expLong: 1, value: -0.76804}, {expLat: 2, expLong: 0, value: 0.26361}, {expLat: 0, expLong: 2, value: 0.13374}, {expLat: 2, expLong: 1, value: -0.52162}, {expLat: 1, expLong: 2, value: -1.05853}, {expLat: 2, expLong: 2, value: -0.49211}, {expLat: 3, expLong: 0, value: -1.31974}, {expLat: 1, expLong: 3, value: 2.17204}, {expLat: 0, expLong: 4, value: -0.06004}, {expLat: 4, expLong: 1, value: 0.30139}, {expLat: 1, expLong: 4, value: 1.88585}, {expLat: 1, expLong: 5, value: -0.81162}, {expLat: 3, expLong: 5, value: -0.12948}, {expLat: 0, expLong: 6, value: -0.05183}, {expLat: 1, expLong: 6, value: -0.96723}, {expLat: 8, expLong: 1, value: -0.44507}, {expLat: 1, expLong: 8, value: 0.18882}, {expLat: 9, expLong: 0, value: 3.41827}, {expLat: 0, expLong: 9, value: -0.01444}, {expLat: 1, expLong: 9, value: 0.04794}, {expLat: 9, expLong: 3, value: -0.59013} ], latitudeCoefficients: [ {expLat: 0, expLong: 0, value: 0.16984}, {expLat: 0, expLong: 1, value: 0.09585}, {expLat: 1, expLong: 0, value: -0.76173}, {expLat: 0, expLong: 3, value: 0.49831}, {expLat: 0, expLong: 4, value: 0.1145}, {expLat: 1, expLong: 3, value: 0.12415}, {expLat: 2, expLong: 0, value: 1.09919}, {expLat: 2, expLong: 1, value: -1.13239}, {expLat: 3, expLong: 0, value: -4.57801}, {expLat: 3, expLong: 1, value: -0.98399}, {expLat: 5, expLong: 0, value: 27.05396}, {expLat: 0, expLong: 5, value: -0.37548}, {expLat: 0, expLong: 6, value: -0.14197}, {expLat: 0, expLong: 7, value: 0.07439}, {expLat: 0, expLong: 8, value: 0.03385}, {expLat: 2, expLong: 3, value: 0.73357}, {expLat: 3, expLong: 9, value: -0.07653}, {expLat: 4, expLong: 1, value: 2.03449}, {expLat: 4, expLong: 9, value: 0.08646}, {expLat: 6, expLong: 3, value: -1.30575}, {expLat: 7, expLong: 0, value: -59.96555}, {expLat: 8, expLong: 0, value: -4.76082}, {expLat: 9, expLong: 0, value: 49.0432} ], scaleFactor: .05235988, shiftY: 37, shiftX: -95, latitudeMin:20, latitudeMax:50, longitudeMin: -131, longitudeMax:-63 }, { datumShiftName: 'CONUS', fromDatumCD: DATUM_HORIZ_1927, toDatumCD: DATUM_HORIZ_WGS84, datumShiftMethodCD: 'MOLODENSKY', datumShiftMethodName: 'Molodensky three-parameter offset', shiftX: -8, shiftY: 160, shiftZ: 176, isActive:true }, { datumShiftName: 'OSGB-M', fromDatumCD: DATUM_HORIZ_OSGB, toDatumCD: DATUM_HORIZ_WGS84, datumShiftMethodCD: 'MOLODENSKY', datumShiftMethodName: 'Molodensky three-parameter offset', shiftX: 375, shiftY: -111, shiftZ: 431, isActive:true }, { // see http://www.movable-type.co.uk/scripts/latlong-convert-coords.html datumShiftName: 'OSGB-H', fromDatumCD: DATUM_HORIZ_WGS84, toDatumCD: DATUM_HORIZ_OSGB, datumShiftMethodCD: 'HELMERT', datumShiftMethodName: 'Helmert seven-parameter offset', shiftX: -446.448, shiftY: 125.157, shiftZ: -542.060, rotationX: -0.1502, rotationY:-0.2470, rotationZ:-0.8421, scaleFactor: 20.4894, isActive:true }, { // see http://en.wikipedia.org/wiki/Helmert_transformation datumShiftName: 'IRISH-H', fromDatumCD: DATUM_HORIZ_WGS84, toDatumCD: DATUM_HORIZ_IRISH65, datumShiftMethodCD: 'HELMERT', datumShiftMethodName: 'Helmert seven-parameter offset', shiftX: -482.53, shiftY: 130.596, shiftZ: -564.557, rotationX: 1.042, rotationY:0.214, rotationZ:.631, scaleFactor: -8.15, isActive:true } ]; var _atlasArray = []; // sometimes we have AJAX calls pending, // so whenever we finish the "last" AJAX function we call an onready func if told to do so var _pendingAJAXCount=0; var _onReadyFunc=null; var _spatialRefArray = [ {spatialReferenceCD:"CAZONE3_NAD27_FT", spatialReferenceName: "CA Zone 3 NAD 27 feet", coordSysTypeCD: COORDSYS_TYPE_LAMBERT, coordSysCD: COORDSYS_CAZONE3, coordSysName: COORDSYS_CAZONE3_STR, originLatitude: 36.5, originLongitude: -120.5, parallelOne: 37.0 + 4.0 / 60.0, parallelTwo: 38.0 + 26.0 / 60.0, originX: 2000000.0, originY: 0, centralScaleFactor: 1.0, mapUnitCD: UNITS_SURVEYFEET, datumCD: DATUM_HORIZ_1927, ellipsoidCD: ELLIPSOID_CLARKE1866, ellipsoidName: ELLIPSOID_CLARKE1866_STR, equitorialAxisMeters: RADIUS_CLARKE1866_METERS, eccentricity: E_CLARKE1866, isActive: true }, {spatialReferenceCD: "CAZONE3_NAD27_M", spatialReferenceName: "CA Zone 3 NAD 27 meters", coordSysTypeCD: COORDSYS_TYPE_LAMBERT, coordSysCD: COORDSYS_CAZONE3, coordSysName: COORDSYS_CAZONE3_STR, originLatitude: 36.5, originLongitude: -120.5, parallelOne: 37.0 + 4.0 / 60.0, parallelTwo: (38.0 + 26.0 / 60.0), originX: 2000000.0 * SURVEY_FEET_TO_METERS, originY: 0, centralScaleFactor: 1.0, mapUnitCD: UNITS_METERS, datumCD: DATUM_HORIZ_1927, ellipsoidCD: ELLIPSOID_CLARKE1866, ellipsoidName: ELLIPSOID_CLARKE1866_STR, equitorialAxisMeters: RADIUS_CLARKE1866_METERS, eccentricity: E_CLARKE1866, isActive: false }, {spatialReferenceCD:"CAZONE3_NAD83_FT", spatialReferenceName: "CA Zone 3 NAD 83 feet", coordSysTypeCD: COORDSYS_TYPE_LAMBERT, coordSysCD: COORDSYS_CAZONE3, coordSysName: COORDSYS_CAZONE3_STR, originLatitude: 36.5, originLongitude: -120.5, parallelOne: 37.0 + 4.0 / 60.0, parallelTwo: (38.0 + 26.0 / 60.0), originX: 2000000.0 * METERS_TO_SURVEY_FEET, originY: 500000.0 * METERS_TO_SURVEY_FEET, centralScaleFactor: 1.0, mapUnitCD: UNITS_SURVEYFEET, datumCD: DATUM_HORIZ_1983, ellipsoidCD: ELLIPSOID_GRS80, ellipsoidName: ELLIPSOID_GRS80_STR, equitorialAxisMeters: RADIUS_GRS80_METERS, eccentricity: E_GRS80, isActive: true }, {spatialReferenceCD:"CAZONE3_NAD83_M", spatialReferenceName: "CA Zone 3 NAD 83 meters", coordSysTypeCD: COORDSYS_TYPE_LAMBERT, coordSysCD: COORDSYS_CAZONE3, coordSysName: COORDSYS_CAZONE3_STR, originLatitude: 36.5, originLongitude: -120.5, parallelOne: 37.0 + 4 / 60.0, parallelTwo: (38.0 + 26.0 / 60.0), originX: 2000000.0, originY: 500000.0, centralScaleFactor: 1.0, mapUnitCD: UNITS_METERS, datumCD: DATUM_HORIZ_1983, ellipsoidCD: ELLIPSOID_GRS80, ellipsoidName: ELLIPSOID_GRS80_STR, equitorialAxisMeters: RADIUS_GRS80_METERS, eccentricity: E_GRS80, isActive: false }, {spatialReferenceCD: SPATIALREF_USNG, spatialReferenceName: COORDSYS_USNG_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, coordSysCD: COORDSYS_USNG, coordSysName: COORDSYS_USNG_STR, originLatitude: null, originLongitude: null, datumCD: DATUM_HORIZ_1983, mapUnitCD: UNITS_GRID, ellipsoidCD: ELLIPSOID_GRS80, ellipsoidName: ELLIPSOID_GRS80_STR, equitorialAxisMeters: RADIUS_GRS80_METERS, eccentricity: E_GRS80, isActive: true }, {spatialReferenceCD: SPATIALREF_MGRS, spatialReferenceName: COORDSYS_MGRS_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, coordSysCD: COORDSYS_MGRS, coordSysName: COORDSYS_MGRS_STR, originLatitude: null, originLongitude: null, datumCD: DATUM_HORIZ_1983, mapUnitCD: UNITS_GRID, ellipsoidCD: ELLIPSOID_GRS80, ellipsoidName: ELLIPSOID_GRS80_STR, equitorialAxisMeters: RADIUS_GRS80_METERS, eccentricity: E_GRS80, isActive: false }, {spatialReferenceCD:SPATIALREF_OSGB, spatialReferenceName: COORDSYS_OSGB_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, coordSysCD: COORDSYS_OSGB, coordSysName: COORDSYS_OSGB_STR, originLatitude: 49.0, originLongitude: -2.0, originX : 400000, originY : -100000, datumCD: DATUM_HORIZ_OSGB, mapUnitCD: UNITS_GRID, centralScaleFactor: 0.9996012717, ellipsoidCD: ELLIPSOID_AIRY1830, ellipsoidName: ELLIPSOID_AIRY1830, equitorialAxisMeters: RADIUS_AIRY1830_METERS, eccentricity: E_AIRY1830, isActive: true, latitudeMin: 42, latitudeMax: 62, longitudeMin: -10, longitudeMax: 4 }, {spatialReferenceCD:SPATIALREF_IRISH, spatialReferenceName: COORDSYS_IRISH_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, coordSysCD: COORDSYS_IRISH, coordSysName: COORDSYS_IRISH_STR, originLatitude: 53.5, originLongitude: -8.0, originX : 200000, originY : 250000, datumCD: DATUM_HORIZ_IRISH65, mapUnitCD: UNITS_GRID, centralScaleFactor: 1.000035, ellipsoidCD: ELLIPSOID_AIRY1849, ellipsoidName: ELLIPSOID_AIRY1849, equitorialAxisMeters: RADIUS_AIRY1849_METERS, eccentricity: E_AIRY1849, isActive: true, latitudeMin: 50, latitudeMax: 57, longitudeMin: -12, longitudeMax: -3 }, {spatialReferenceCD: SPATIALREF_UTM_NAD83, spatialReferenceName: COORDSYS_UTM + " NAD83", coordSysTypeCD: COORDSYS_TYPE_GRID, coordSysCD: COORDSYS_UTM, coordSysName: COORDSYS_UTM_STR, originLatitude: null, originLongitude: null, datumCD: DATUM_HORIZ_1983, mapUnitCD: UNITS_GRID, ellipsoidCD: ELLIPSOID_GRS80, ellipsoidName: ELLIPSOID_GRS80_STR, equitorialAxisMeters: RADIUS_GRS80_METERS, eccentricity: E_GRS80, isActive: true }, {spatialReferenceCD: SPATIALREF_UTM_NAD27, spatialReferenceName: COORDSYS_UTM + " NAD27", coordSysTypeCD: COORDSYS_TYPE_GRID, coordSysCD: COORDSYS_UTM, coordSysName: COORDSYS_UTM_STR, originLatitude: null, originLongitude: null, datumCD: DATUM_HORIZ_1927, mapUnitCD: UNITS_GRID, ellipsoidCD: ELLIPSOID_CLARKE1866, ellipsoidName: ELLIPSOID_CLARKE1866_STR, equitorialAxisMeters: RADIUS_CLARKE1866_METERS, eccentricity: E_CLARKE1866, isActive: true }, {spatialReferenceCD:SPATIALREF_GARS, spatialReferenceName: COORDSYS_GARS_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, coordSysCD: COORDSYS_GARS, coordSysName: COORDSYS_GARS_STR, originLatitude: null, originLongitude: null, datumCD: DATUM_HORIZ_WGS84, mapUnitCD: UNITS_GRID, ellipsoidCD: ELLIPSOID_WGS84, ellipsoidName: ELLIPSOID_WGS84_STR, equitorialAxisMeters: RADIUS_WGS84_METERS, eccentricity: E_WGS84, isActive: true }, {spatialReferenceCD:SPATIALREF_CAP_CLASSIC, spatialReferenceName: COORDSYS_CAP_CLASSIC_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, coordSysCD: COORDSYS_CAP_CLASSIC, coordSysName: COORDSYS_CAP_CLASSIC_STR, originLatitude: null, originLongitude: null, datumCD: DATUM_HORIZ_WGS84, mapUnitCD: UNITS_GRID, ellipsoidCD: ELLIPSOID_WGS84, ellipsoidName: ELLIPSOID_WGS84_STR, equitorialAxisMeters: RADIUS_WGS84_METERS, eccentricity: E_WGS84, isActive: true }, {spatialReferenceCD:SPATIALREF_CAP_CELL, spatialReferenceName: COORDSYS_CAP_CELL_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, coordSysCD: COORDSYS_CAP_CELL, coordSysName: COORDSYS_CAP_CELL_STR, originLatitude: null, originLongitude: null, datumCD: DATUM_HORIZ_WGS84, mapUnitCD: UNITS_GRID, ellipsoidCD: ELLIPSOID_WGS84, ellipsoidName: ELLIPSOID_WGS84_STR, equitorialAxisMeters: RADIUS_WGS84_METERS, eccentricity: E_WGS84, isActive: true }, {spatialReferenceCD: SPATIALREF_EBMUDGRID, spatialReferenceName: COORDSYS_EBMUDGRID_STR, coordSysTypeCD: COORDSYS_TYPE_GRID, coordSysCD: COORDSYS_EBMUDGRID, coordSysName: COORDSYS_EBMUDGRID_STR, originLatitude: null, originLongitude: null, parallelOne: null, parallelTwo: null, originX: null, originY: null, centralScaleFactor: null, mapUnitCD: UNITS_GRID, datumCD: DATUM_HORIZ_1927, ellipsoidCD: ELLIPSOID_CLARKE1866, ellipsoidName: ELLIPSOID_CLARKE1866_STR, equitorialAxisMeters: RADIUS_CLARKE1866_METERS, eccentricity: E_CLARKE1866, isActive: true, inputResolution:1000, inputResolutionUnitCD: UNITS_SURVEYFEET, latitudeMin: 37.518, latitudeMax: 38.031, longitudeMin: -122.442626953125, longitudeMax: -121.734008789062, stateCD: "CA", zone: 3, gridTemplate: "{0,number,0000}B{1,number,000}", gridCellSizeHorizontal: 3000, gridCellSizeVertical: 2000, baseCoordSysCD: COORDSYS_CAZONE3 }, {spatialReferenceCD:SPATIALREF_LATLONG_NAD27, spatialReferenceName: "Lat-long NAD27", coordSysTypeCD: COORDSYS_TYPE_WORLD, coordSysCD: COORDSYS_WORLD, coordSysName: COORDSYS_WORLD_STR, originLatitude: 0, originLongitude: 0, mapUnitCD: UNITS_DEGREES, datumCD: DATUM_HORIZ_1927, ellipsoidCD: ELLIPSOID_CLARKE1866, ellipsoidName: ELLIPSOID_CLARKE1866_STR, equitorialAxisMeters: RADIUS_CLARKE1866_METERS, eccentricity: E_CLARKE1866, isActive: true }, {spatialReferenceCD:SPATIALREF_LATLONG_NAD83, spatialReferenceName: "Lat-long NAD83", coordSysTypeCD: COORDSYS_TYPE_WORLD, coordSysCD: COORDSYS_WORLD, coordSysName: COORDSYS_WORLD_STR, originLatitude: null, originLongitude: null, mapUnitCD: UNITS_DEGREES, datumCD: DATUM_HORIZ_1983, ellipsoidCD: ELLIPSOID_GRS80, ellipsoidName: ELLIPSOID_GRS80_STR, equitorialAxisMeters: RADIUS_GRS80_METERS, eccentricity: E_GRS80, isActive: true }, {spatialReferenceCD:SPATIALREF_LATLONG_WGS84, spatialReferenceName: "Lat-long WGS84", coordSysTypeCD: COORDSYS_TYPE_WORLD, coordSysCD: COORDSYS_WORLD, coordSysName: COORDSYS_WORLD_STR, originLatitude: null, originLongitude: null, mapUnitCD: UNITS_DEGREES, datumCD: DATUM_HORIZ_WGS84, ellipsoidCD: ELLIPSOID_WGS84, ellipsoidName: ELLIPSOID_WGS84_STR, equitorialAxisMeters: RADIUS_WGS84_METERS, eccentricity: E_WGS84, isActive: true }, {spatialReferenceCD:SPATIALREF_LATLONG_OSGB, spatialReferenceName: "Lat-long OSGB36", coordSysTypeCD: COORDSYS_TYPE_WORLD, coordSysCD: COORDSYS_WORLD, coordSysName: COORDSYS_WORLD_STR, originLatitude: 0, originLongitude: 0, mapUnitCD: UNITS_DEGREES, datumCD: DATUM_HORIZ_OSGB, ellipsoidCD: ELLIPSOID_AIRY1830, ellipsoidName: ELLIPSOID_AIRY1830, equitorialAxisMeters: RADIUS_AIRY1830_METERS, eccentricity: E_AIRY1830, isActive: true }, {spatialReferenceCD: SPATIALREF_UTM10_NAD83, spatialReferenceName: "UTM zone 10, NAD83", coordSysTypeCD: COORDSYS_TYPE_TM, coordSysCD: COORDSYS_UTM10, coordSysName: COORDSYS_UTM10_STR, originLatitude: 0, originLongitude: -123, originX: 500000.0, originY: 0, centralScaleFactor: 0.9996, mapUnitCD: UNITS_METERS, datumCD: DATUM_HORIZ_1983, ellipsoidCD: ELLIPSOID_GRS80, ellipsoidName: ELLIPSOID_GRS80_STR, equitorialAxisMeters: RADIUS_GRS80_METERS, eccentricity: E_GRS80, isActive: false }, {spatialReferenceCD: SPATIALREF_UTM10_NAD27, spatialReferenceName: "UTM zone 10, NAD27", coordSysTypeCD: COORDSYS_TYPE_TM, coordSysCD: COORDSYS_UTM10, coordSysName: COORDSYS_UTM10_STR, originLatitude: 0, originLongitude: -123, originX: 500000.0, originY: 0, centralScaleFactor: 0.9996, mapUnitCD: UNITS_METERS, datumCD: DATUM_HORIZ_1927, ellipsoidCD: ELLIPSOID_CLARKE1866, ellipsoidName: ELLIPSOID_CLARKE1866_STR, equitorialAxisMeters: RADIUS_CLARKE1866_METERS, eccentricity: E_CLARKE1866, isActive: false }, {spatialReferenceCD: SPATIALREF_UTM18_NAD83, spatialReferenceName: "UTM zone 18, NAD83", coordSysTypeCD: COORDSYS_TYPE_TM, coordSysCD: COORDSYS_UTM18, coordSysName: COORDSYS_UTM18_STR, originLatitude: 0, originLongitude: -75, originX: 500000.0, originY: 0, centralScaleFactor: 0.9996, mapUnitCD: UNITS_METERS, datumCD: DATUM_HORIZ_1983, ellipsoidCD: ELLIPSOID_GRS80, ellipsoidName: ELLIPSOID_GRS80_STR, equitorialAxisMeters: RADIUS_GRS80_METERS, eccentricity: E_GRS80, isActive: false }, {spatialReferenceCD: SPATIALREF_ALBERS_CONUS, spatialReferenceName: "Albers Equal-area Conic for CONUS", coordSysTypeCD: COORDSYS_TYPE_ALBERS, coordSysCD: COORDSYS_ALBERS_CONUS, coordSysName: COORDSYS_ALBERS_CONUS_STR, originLatitude: 37.5, originLongitude: -96, parallelOne: 29.5, parallelTwo: 45.5, originX: 0.0, originY: 0.0, centralScaleFactor: 1.0, mapUnitCD: UNITS_METERS, datumCD: DATUM_HORIZ_1983, ellipsoidCD: ELLIPSOID_GRS80, ellipsoidName: ELLIPSOID_GRS80_STR, equitorialAxisMeters: RADIUS_GRS80_METERS, eccentricity: E_GRS80, isActive: true } ]; var _canonicalDatums=null; function registerAJAXCompletion(msg) { var stage=""; try { _pendingAJAXCount--; MARCONI.log("Finished " + (msg ? msg : " asynch task") + ", " + _pendingAJAXCount + " tasks still running"); if( _pendingAJAXCount === 0) { if( _onReadyFunc ) { // MARCONI.log("All AJAX map.js calls completed, calling completion callback functions: " + _onReadyFunc); // copy the functions and then clear the original // in case one of the functions is yet another ajax call to ourselves, // in which case confusion would result since the callback function array would be rewritten var callStack = []; for( var i = 0 ; i < _onReadyFunc.length ; i++) { callStack.push(_onReadyFunc[i]); } _onReadyFunc=null; // now use our own private copy of the call stack for( i = 0 ; i < callStack.length ; i++) { callStack[i]("MARCONI map module is ready to use"); } } else { //MARCONI.log("All AJAX map.js calls completed"); } } else { //MARCONI.log(_pendingAJAXCount + " calls still pending" + (_onReadyFunc ? ", will call back" : ", no callback registered")); } } catch(ex) { throw "Error registering completion of AJAX map calls at stage " + stage + ": " + ex + ", onready type is " + typeof(_onReadyFunc); } } function registerAJAXLaunch(msg) { _pendingAJAXCount++; if( msg ) { MARCONI.log("Launched " + (msg ? msg : "asynch task") + ", pending task count is " + _pendingAJAXCount); } } // key for DOM storage function storageDataKey(entity, queryString) { return (entity ? entity : "data") + "_" + (queryString ? queryString : ""); } // get data from DOM storage if available and not expired // looking at cfg.minDate for expire date function getFromStorage( entity, queryString, onSuccess, onError, cfg ) { // attempt to read the indicated data from DOM storage // return true or false to indicate failure or at least possible success // If successful, invoke onSuccess with the data; else invoke onError with a message if not var MAX_AGE_MINUTES = 24*60*7; // a week default is reasonably safe for most data function doGet( entity, queryString, cfg ) { try { var rawData = null; try { rawData = engine.getItem( storageDataKey(entity, queryString) ); } catch(getEx) { MARCONI.warn("Exception reading raw " + entity + " data from storage: " + getEx); } if( rawData ) { //MARCONI.log("parsing raw " + entity + " data retrieved from storage"); var dataObject = JSON.parse(rawData); var dataArray = dataObject && dataObject.data || dataObject; var dateStored = dataObject && dataObject.dateStored ? (typeof(dataObject.dateStored)=="string" ? MARCONI.datetime.parseDate(dataObject.dateStored) : dataObject.dateStored) : null; // establish minDate, the min cache date which we will accept -- anything earlier is too stale var minDate = typeof(cfg.minDate)=="string" ? MARCONI.datetime.parseDate(cfg.minDate) : cfg.minDate; // maxMinutes defaults only when minDate is not given var maxMinutes = cfg.maxMinutes ? cfg.maxMinutes : (minDate ? null : MAX_AGE_MINUTES); if( maxMinutes ) { // compute minDate based on maxMinutes var possibleMinDate = new Date(new Date().valueOf() - 1000*60*maxMinutes); // use the most restrictive minDate if( !minDate || possibleMinDate > minDate ) { minDate = possibleMinDate; } } if( dateStored && (dateStored > minDate) ) { MARCONI.log("Got useful " + entity + " data " + (queryString ? "for query " + queryString : "") + " from DOM storage, date stored was " + dateStored + " versus min date of " + minDate); return dataArray; } else { MARCONI.log("Got expired " + entity + " data for query " + queryString + " from DOM storage, date stored was " + dateStored + " versus min date of " + minDate); } } else { MARCONI.log("No useful " + entity + " data read from DOM storage" + (queryString ? ", " + queryString : "")); } return null; } catch(ex) { throw "Error doing user-data get from storage: " + ex; } } if(!entity) { throw "Must provide entity to getFromStorage()"; } if(!onSuccess) { throw "Must provide onSuccess callback to getFromStorage()"; } if(!onError) { throw "Must provide onError callback to getFromStorage()"; } var engine=null; if(engine) { if( engine.isReady ) { // MARCONI.log("Engine already running, will get " + entity + " data immediately"); try { var data = doGet(entity, queryString, cfg ); if( data ) { onSuccess(data, cfg); } else { return false; } } catch(ex) { throw "Error doing immediate fetch of " + entity + queryString + " from DOM storage: " + ex; } } else { //MARCONI.log("Registering with storage engine to callback and get " + entity + queryString + " data from DOM storage"); engine.subscribe( engine.CE_READY, function(e) { try { var dataArray = doGet(entity, queryString , cfg ); if( dataArray ) { onSuccess( dataArray, cfg); } else { onError("No " + entity + " data", cfg); } registerAJAXCompletion("fetching " + entity + " from storage"); } catch(ex) { onError(ex, cfg); } }); registerAJAXLaunch("fetch of " + entity + " from storage"); } return true; } return false; } function putToStorage(entity, queryString, data, onSuccess, onError) { function doPut(entity, queryString, data, onSuccess, onError) { MARCONI.log("About to save " + entity + queryString + " data to DOM storage"); } var engine=null; try { if( engine) { if( engine.isReady ) { // MARCONI.log("Storage engine already running, will save " + entity + queryString + " data to DOM storage"); doPut(entity, queryString, data, onSuccess, onError); } else { MARCONI.log("Subscribing to event to save " + entity + queryString + " data to DOM storage"); engine.subscribe( engine.CE_READY, function(e) { doPut(entity, queryString, data, onSuccess, onError); registerAJAXCompletion("Storage of " + entity + queryString); }); registerAJAXLaunch("Finished asynch storage of " + entity + queryString); } return true; } } catch(ex) { if( onError ) { onError(ex); } return false; } return false; } var _CAPSections = [ // Civil Air Patrol // normal grid cells are 15 minutes of latitude, 15 minutes of longitude {code: "SEA", sectionName : "Seattle", north: 49, south: 44.5, west: -125, east: -117}, {code: "GTF", sectionName : "Great Falls", north: 49, south: 44.5, west: -117, east: -109}, {code: "BIL", sectionName : "Billings", north: 49, south: 44.5, west: -109, east: -101}, {code: "MSP", sectionName : "Twin Cities", north: 49, south: 44.5, west: -101, east: -93}, {code: "GRB", sectionName : "Green Bay", north: 48.25, south: 44, west: -93, east: -85}, {code: "LHN", sectionName : "Lake Huron", north: 48, south: 44, west: -85, east: -77}, {code: "MON", sectionName : "Montreal", north: 48, south: 44, west: -77, east: -69}, {code: "HFX", sectionName : "Halifax", north: 48, south: 44, west: -69, east: -61}, {code: "LMT", sectionName : "Klamath Falls", north: 44.5, south: 40, west: -125, east: -117}, {code: "SLC", sectionName : "Salt Lake City", north: 44.5, south: 40, west: -117, east: -109}, {code: "CYS", sectionName : "Cheyenne", north: 44.5, south: 40, west: -109, east: -101}, {code: "OMA", sectionName : "Omaha", north: 44.5, south: 40, west: -101, east: -93}, {code: "ORD", sectionName : "Chicago", north: 44, south: 40, west: -93, east: -85}, {code: "DET", sectionName : "Detroit", north: 44, south: 40, west: -85, east: -77}, {code: "NYC", sectionName : "New York", north: 44, south: 40, west: -77, east: -69}, {code: "SFO", sectionName : "San Franciso", north: 40, south: 36, west: -125, east: -118}, {code: "LAX", sectionName : "Los Angeles", north: 36, south: 32, west: -121.5, east: -115}, {code: "LAS", sectionName : "Las Vegas", north: 40, south: 35.75, west: -118, east: -111}, {code: "DEN", sectionName : "Denver", north: 40, south: 35.75, west: -111, east: -104}, {code: "ICT", sectionName : "Wichita", north: 40, south: 36, west: -104, east: -97}, {code: "MKC", sectionName : "Kansas City", north: 40, south: 36, west: -97, east: -90}, {code: "STL", sectionName : "St. Louis", north: 40, south: 36, west: -91, east: -84}, {code: "LUK", sectionName : "Cincinnati", north: 40, south: 36, west: -85, east: -78}, {code: "DCA", sectionName : "Washington", north: 40, south: 36, west: -79, east: -72}, {code: "PHX", sectionName : "Phoenix", north: 35.75, south: 31.25, west: -116, east: -109}, {code: "ABQ", sectionName : "Albuquerque", north: 36, south: 32, west: -109, east: -102}, {code: "DFW", sectionName : "Dallas - Ft. Worth", north: 36, south: 32, west: -102, east: -95}, {code: "MEM", sectionName : "Memphis", north: 36, south: 32, west: -95, east: -88}, {code: "ATL", sectionName : "Atlanta", north: 36, south: 32, west: -88, east: -81}, {code: "CLT", sectionName : "Charlotte", north: 36, south: 32, west: -81, east: -75}, {code: "ELP", sectionName : "El Paso", north: 32, south: 28, west: -109, east: -103}, {code: "SAT", sectionName : "San Antonio", north: 32, south: 28, west: -103, east: -97}, {code: "HOU", sectionName : "Houstone", north: 32, south: 28, west: -97, east: -91}, {code: "MSY", sectionName : "New Orleans", north: 32, south: 28, west: -91, east: -85}, {code: "JAX", sectionName : "Jacksonville", north: 32, south: 28, west: -85, east: -79}, {code: "BRO", sectionName : "Brownsville", north: 28, south: 24, west: -103, east: -97}, {code: "MIA", sectionName : "Miami", north: 28, south: 24, west: -83, east: -77}, // Alaska grids are 30 minutes latitude, one degree of longitude {code: "AL_I", sectionName : "Alaska I", north: 72, south: 68, west: -175, east: -160, widthMinutes: 60, heightMinutes: 30}, {code: "AL_II", sectionName : "Alaska II", north: 72, south: 68, west: -160, east: -144, widthMinutes: 60, heightMinutes: 30}, {code: "AL_III", sectionName : "Alaska III", north: 72, south: 68, west: -144, east: -128, widthMinutes: 60, heightMinutes: 30}, {code: "AL_IV", sectionName : "Alaska IV", north: 68, south: 64, west: -171, east: -158, widthMinutes: 60, heightMinutes: 30}, {code: "AL_V", sectionName : "Alaska V", north: 68, south: 64, west: -158, east: -145, widthMinutes: 60, heightMinutes: 30}, {code: "AL_VI", sectionName : "Alaska VI", north: 68, south: 64, west: -145, east: -132, widthMinutes: 60, heightMinutes: 30}, {code: "AL_VII", sectionName : "Alaska VII", north: 64, south: 60, west: -172, east: -160, widthMinutes: 60, heightMinutes: 30}, {code: "AL_VIII", sectionName : "Alaska VIII", north: 64, south: 60, west: -160, east: -148, widthMinutes: 60, heightMinutes: 30}, {code: "AL_IX", sectionName : "Alaska IX", north: 64, south: 60, west: -148, east: -136, widthMinutes: 60, heightMinutes: 30}, {code: "AL_X", sectionName : "Alaska X", north: 60, south: 56, west: -173, east: -162, widthMinutes: 60, heightMinutes: 30}, {code: "AL_XI", sectionName : "Alaska XI", north: 60, south: 56, west: -162, east: -151, widthMinutes: 60, heightMinutes: 30}, {code: "AL_XII", sectionName : "Alaska XII", north: 60, south: 56, west: -151, east: -141, widthMinutes: 60, heightMinutes: 30}, {code: "AL_XIII", sectionName : "Alaska XIII", north: 60, south: 56, west: -141, east: -131, widthMinutes: 60, heightMinutes: 30}, {code: "AL_XIV", sectionName : "Alaska XIV", north: 56, south: 52, west: -168, east: -159, widthMinutes: 60, heightMinutes: 30}, {code: "AL_XV", sectionName : "Alaska XV", north: 56, south: 52, west: -135, east: -126, widthMinutes: 60, heightMinutes: 30} ]; // this is the singleton pattern here, returning a literal object consisting of selecting variables // and various functions return { // these codes for datum, units, coord systems, etc. should be used by any source code in lieu // of literal strings, to ensure exact matches with no only javscript source but also database code values METERS_TO_SURVEY_FEET : METERS_TO_SURVEY_FEET, SURVEY_FEET_TO_METERS : SURVEY_FEET_TO_METERS, METERS_TO_INTERNATIONAL_FEET : METERS_TO_INTERNATIONAL_FEET, INTERNATIONALFEET_TO_METERS: INTERNATIONALFEET_TO_METERS, DEGREES_TO_RADIANS: DEGREES_TO_RADIANS, RADIANS_TO_DEGREES: RADIANS_TO_DEGREES, RADIUS_CLARKE1866_METERS : RADIUS_CLARKE1866_METERS, RADIUS_WGS84_METERS : RADIUS_WGS84_METERS, RADIUS_GRS80_METERS : RADIUS_GRS80_METERS, RADIUS_CLARKE1866_SURVEYFEET : RADIUS_CLARKE1866_SURVEYFEET, eSquared_CLARKE1866 : eSquared_CLARKE1866, E_CLARKE1866 : E_CLARKE1866, RADIUS_GRS80_SURVEYFEET : RADIUS_GRS80_SURVEYFEET, RADIUS_GRS80_INTERNATIONALFEET : RADIUS_GRS80_INTERNATIONALFEET, eSquared_WGS84 : eSquared_WGS84, eSquared_GRS80 : eSquared_GRS80, E_GRS80 : E_GRS80, E_WGS84 : E_WGS84, DATUM_HORIZ_1927 : DATUM_HORIZ_1927, DATUM_HORIZ_1983 : DATUM_HORIZ_1983, DATUM_HORIZ_WGS84 : DATUM_HORIZ_WGS84, DATUM_HORIZ_OSGB : DATUM_HORIZ_OSGB, DATUM_HORIZ_IRISH65 : DATUM_HORIZ_IRISH65, DATUM_HORIZ_WGS84_STR : DATUM_HORIZ_WGS84_STR, UNITS_INTERNATIONALFEET : UNITS_INTERNATIONALFEET, UNITS_SURVEYFEET : UNITS_SURVEYFEET, UNITS_METERS : UNITS_METERS, UNITS_KILOMETERS : UNITS_KILOMETERS, UNITS_MILES : UNITS_MILES, UNITS_DEGREES : UNITS_DEGREES, UNITS_GRID : UNITS_GRID, UNITS_SQUAREMETERS : UNITS_SQUAREMETERS, UNITS_ACRES : UNITS_ACRES, UNITS_HECTARES : UNITS_HECTARES, UNITS_DEGREES_STR : UNITS_DEGREES_STR, COORDSYS_WORLD : COORDSYS_WORLD, COORDSYS_CAZONE2 : COORDSYS_CAZONE2, COORDSYS_CAZONE3 : COORDSYS_CAZONE3, COORDSYS_CAZONE4 : COORDSYS_CAZONE4, COORDSYS_UTM10 : COORDSYS_UTM10, COORDSYS_USNG : COORDSYS_USNG, COORDSYS_MGRS : COORDSYS_MGRS, COORDSYS_GARS : COORDSYS_GARS, COORDSYS_OSGB : COORDSYS_OSGB, COORDSYS_IRISH : COORDSYS_IRISH, COORDSYS_CAP_CLASSIC : COORDSYS_CAP_CLASSIC, COORDSYS_CAP_CELL : COORDSYS_CAP_CELL, COORDSYS_ALBERS_CONUS : COORDSYS_ALBERS_CONUS, COORDSYS_EBMUDGRID : COORDSYS_EBMUDGRID, COORDSYS_LAMBERTCUSTOM : COORDSYS_LAMBERTCUSTOM, COORDSYS_TMCUSTOM : COORDSYS_TMCUSTOM, COORDSYS_UTM : COORDSYS_UTM, COORDSYS_WORLD_STR : COORDSYS_WORLD_STR, DATUM_HORIZ_DEFAULT : DATUM_HORIZ_DEFAULT, DATUM_HORIZ_DEFAULT_STR : DATUM_HORIZ_DEFAULT_STR, UNITS_DEFAULT : UNITS_DEFAULT, COORDSYS_DEFAULT : COORDSYS_DEFAULT, COORDSYS_TYPE_WORLD : COORDSYS_TYPE_WORLD, COORDSYS_TYPE_LAMBERT : COORDSYS_TYPE_LAMBERT, COORDSYS_TYPE_ALBERS : COORDSYS_TYPE_ALBERS, COORDSYS_TYPE_TM : COORDSYS_TYPE_TM, COORDSYS_TYPE_GRID : COORDSYS_TYPE_GRID, COORDSYS_TYPE_ATLAS : COORDSYS_TYPE_ATLAS, COORDSYS_TYPE_MERCATOR : COORDSYS_TYPE_MERCATOR, COORDSYS_TYPE_STEREO : COORDSYS_TYPE_STEREO, SPATIALREF_LATLONG_WGS84 : SPATIALREF_LATLONG_WGS84, SPATIALREF_LATLONG_NAD27 : SPATIALREF_LATLONG_NAD27, SPATIALREF_LATLONG_NAD83 : SPATIALREF_LATLONG_NAD83, SPATIALREF_UTM10_NAD83 : SPATIALREF_UTM10_NAD83, SPATIALREF_UTM10_NAD27 : SPATIALREF_UTM10_NAD2