",
8 | loadConfigErrorText: "Problemes llegint la configuració desada: ",
9 | loadConfigErrorDefaultText: "Error del servidor.",
10 | xhrTroubleText: "Problemes de comunicació. Estat ",
11 | layersText: "Capes",
12 | titleText: "Títol",
13 | bookmarkText: "URL del marcador",
14 | permakinkText: "Enllaç permanent",
15 | appInfoText: "GeoExplorer",
16 | aboutText: "Quant a GeoExplorer",
17 | mapInfoText: "Informació del mapa",
18 | descriptionText: "Descripció",
19 | contactText: "Contacte",
20 | aboutThisMapText: "Quant a aquest mapa"
21 | },
22 | "GeoExplorer.Composer.prototype": {
23 | mapText: "Mapa",
24 | tableText: "Table",
25 | queryText: "Query",
26 | exportMapText: "Exporta el Mapa",
27 | saveMapText: "Desa el Mapa",
28 | saveErrorText: "Problemes desant: ",
29 | toolsTitle: "Escolliu els elements que desitgeu incloure a la barra d'eines:",
30 | previewText: "Vista prèvia",
31 | backText: "Anterior",
32 | nextText: "Següent",
33 | loginText: "Login",
34 | loginErrorText: "Invalid username or password.",
35 | userFieldText: "User",
36 | passwordFieldText: "Password"
37 | }
38 | });
39 |
--------------------------------------------------------------------------------
/app/autoloader.js:
--------------------------------------------------------------------------------
1 | // the autoloader injects scripts into the document dynamically
2 | // only suitable for development/debug mode
3 |
4 | var {Application} = require("stick");
5 | var FS = require("fs");
6 | var CONFIG = require("buildkit").config;
7 | var MERGE = require("buildkit").merge;
8 |
9 | var template = getResource("./templates/debug-loader.js").getContent();
10 |
11 | var libLoader = function(section, order) {
12 | var paths = order.map(function(script) {
13 | return "'@" + "/" + script.root + "/" + script.path + "'";
14 | });
15 | var body = template.replace("{{paths}}", paths.join(",\n"));
16 | return function(env) {
17 | return {
18 | status: 200,
19 | headers: {"Content-Type": "text/javascript"},
20 | body: [body]
21 | };
22 | };
23 | };
24 |
25 | var App = function(config) {
26 | var sections = CONFIG.parse(config);
27 | var group, root, order;
28 | var app = Application();
29 | app.configure("mount");
30 | for (var section in sections) {
31 | group = sections[section];
32 | order = MERGE.order(group);
33 | // mount lib loader for the section
34 | app.mount("/" + section, libLoader(section, order));
35 | }
36 | // mount a script loader for all scripts
37 | var scriptLoader = Application();
38 | scriptLoader.configure("static");
39 | print(FS.directory(config));
40 | scriptLoader.static(FS.directory(config));
41 | app.mount("/@", scriptLoader);
42 | return app;
43 | };
44 |
45 | exports.App = App;
46 |
47 |
--------------------------------------------------------------------------------
/app/static/script/app/locale/app/es.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009-2010 The Open Planning Project
3 | */
4 |
5 | GeoExt.Lang.add("es", {
6 | "GeoExplorer.prototype": {
7 | zoomSliderText: "
Nivel de detalle: {zoom}
Escala: 1:{scale}
",
8 | loadConfigErrorText: "Problemas leyendo la configuración guardada: ",
9 | loadConfigErrorDefaultText: "Error del servidor.",
10 | xhrTroubleText: "Problemas de comunicación: Estado ",
11 | layersText: "Capas",
12 | titleText: "Título",
13 | bookmarkText: "URL del marcador",
14 | permakinkText: "Enlace permanente",
15 | appInfoText: "GeoExplorer",
16 | aboutText: "Acerca de GeoExplorer",
17 | mapInfoText: "Información del mapa",
18 | descriptionText: "Descripción",
19 | contactText: "Contacto",
20 | aboutThisMapText: "Acerca de este mapa"
21 | },
22 | "GeoExplorer.Composer.prototype": {
23 | mapText: "Mapa",
24 | tableText: "Table",
25 | queryText: "Query",
26 | exportMapText: "Exportar Mapa",
27 | saveMapText: "Guardar Mapa",
28 | saveErrorText: "Problemas guardando: ",
29 | toolsTitle: "Escoja los elementos que desea incluir en la barra de herramientas:",
30 | previewText: "Vista previa",
31 | backText: "Anterior",
32 | nextText: "Siguiente",
33 | loginText: "Login",
34 | loginErrorText: "Invalid username or password.",
35 | userFieldText: "User",
36 | passwordFieldText: "Password"
37 | }
38 | });
39 |
--------------------------------------------------------------------------------
/license.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2008-2010, The Open Planning Project
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright notice,
8 | this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above copyright
10 | notice, this list of conditions and the following disclaimer in the
11 | documentation and/or other materials provided with the distribution.
12 | * Neither the name of the Open Planning Project nor the names
13 | of its contributors may be used to endorse or promote products derived
14 | from this software without specific prior written permission.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/app/static/script/app/locale/app/de.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009-2010 The Open Planning Project
3 | */
4 |
5 | GeoExt.Lang.add("de", {
6 | "GeoExplorer.prototype": {
7 | zoomSliderText: "
Zoomstufe: {zoom}
Maßstab: 1:{scale}
",
8 | loadConfigErrorText: "Gespeicherte Konfiguration kann nicht gelesen werden: ",
9 | loadConfigErrorDefaultText: "Server Fehler.",
10 | xhrTroubleText: "Kommunikationsfehler: Status ",
11 | layersText: "Layer",
12 | titleText: "Titel",
13 | zoomLevelText: "Zoomstufe",
14 | bookmarkText: "Bookmark URL",
15 | permakinkText: 'Permalink',
16 | appInfoText: "GeoExplorer",
17 | aboutText: "Über GeoExplorer",
18 | mapInfoText: "Karteninfo",
19 | descriptionText: "Beschreibung",
20 | contactText: "Kontakt",
21 | aboutThisMapText: "Über diese Karte"
22 | },
23 | "GeoExplorer.Composer.prototype": {
24 | mapText: "Karte",
25 | tableText: "Tabelle",
26 | queryText: "Abfrage",
27 | exportMapText: "Karte veröffentlichen",
28 | saveMapText: "Karte speichern",
29 | saveErrorText: "Beim Speichern ist ein Problem aufgetreten: ",
30 | toolsTitle: "Werkzeuge, die in der Werkzeugleiste zur Verfügung stehen sollen:",
31 | previewText: "Vorschau",
32 | backText: "Zurück",
33 | nextText: "Weiter",
34 | loginText: "Login",
35 | loginErrorText: "Ungültiger Benutzername oder ungültiges Kennwort.",
36 | userFieldText: "Benutzer",
37 | passwordFieldText: "Kennwort"
38 | }
39 | });
40 |
--------------------------------------------------------------------------------
/app/static/externals/proj4js/lib/projCode/gauss.js:
--------------------------------------------------------------------------------
1 |
2 | Proj4js.Proj.gauss = {
3 |
4 | init : function() {
5 | sphi = Math.sin(this.lat0);
6 | cphi = Math.cos(this.lat0);
7 | cphi *= cphi;
8 | this.rc = Math.sqrt(1.0 - this.es) / (1.0 - this.es * sphi * sphi);
9 | this.C = Math.sqrt(1.0 + this.es * cphi * cphi / (1.0 - this.es));
10 | this.phic0 = Math.asin(sphi / this.C);
11 | this.ratexp = 0.5 * this.C * this.e;
12 | this.K = Math.tan(0.5 * this.phic0 + Proj4js.common.FORTPI) / (Math.pow(Math.tan(0.5*this.lat0 + Proj4js.common.FORTPI), this.C) * Proj4js.common.srat(this.e*sphi, this.ratexp));
13 | },
14 |
15 | forward : function(p) {
16 | var lon = p.x;
17 | var lat = p.y;
18 |
19 | p.y = 2.0 * Math.atan( this.K * Math.pow(Math.tan(0.5 * lat + Proj4js.common.FORTPI), this.C) * Proj4js.common.srat(this.e * Math.sin(lat), this.ratexp) ) - Proj4js.common.HALF_PI;
20 | p.x = this.C * lon;
21 | return p;
22 | },
23 |
24 | inverse : function(p) {
25 | var DEL_TOL = 1e-14;
26 | var lon = p.x / this.C;
27 | var lat = p.y;
28 | num = Math.pow(Math.tan(0.5 * lat + Proj4js.common.FORTPI)/this.K, 1./this.C);
29 | for (var i = Proj4js.common.MAX_ITER; i>0; --i) {
30 | lat = 2.0 * Math.atan(num * Proj4js.common.srat(this.e * Math.sin(p.y), -0.5 * this.e)) - Proj4js.common.HALF_PI;
31 | if (Math.abs(lat - p.y) < DEL_TOL) break;
32 | p.y = lat;
33 | }
34 | /* convergence failed */
35 | if (!i) {
36 | Proj4js.reportError("gauss:inverse:convergence failed");
37 | return null;
38 | }
39 | p.x = lon;
40 | p.y = lat;
41 | return p;
42 | }
43 | };
44 |
45 |
--------------------------------------------------------------------------------
/app/static/externals/proj4js/lib/projCode/utm.js:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | NAME TRANSVERSE MERCATOR
3 |
4 | PURPOSE: Transforms input longitude and latitude to Easting and
5 | Northing for the Transverse Mercator projection. The
6 | longitude and latitude must be in radians. The Easting
7 | and Northing values will be returned in meters.
8 |
9 | ALGORITHM REFERENCES
10 |
11 | 1. Snyder, John P., "Map Projections--A Working Manual", U.S. Geological
12 | Survey Professional Paper 1395 (Supersedes USGS Bulletin 1532), United
13 | State Government Printing Office, Washington D.C., 1987.
14 |
15 | 2. Snyder, John P. and Voxland, Philip M., "An Album of Map Projections",
16 | U.S. Geological Survey Professional Paper 1453 , United State Government
17 | Printing Office, Washington D.C., 1989.
18 | *******************************************************************************/
19 |
20 |
21 | /**
22 | Initialize Transverse Mercator projection
23 | */
24 |
25 | Proj4js.Proj.utm = {
26 | dependsOn : 'tmerc',
27 |
28 | init : function() {
29 | if (!this.zone) {
30 | Proj4js.reportError("utm:init: zone must be specified for UTM");
31 | return;
32 | }
33 | this.lat0 = 0.0;
34 | this.long0 = ((6 * Math.abs(this.zone)) - 183) * Proj4js.common.D2R;
35 | this.x0 = 500000.0;
36 | this.y0 = this.utmSouth ? 10000000.0 : 0.0;
37 | this.k0 = 0.9996;
38 |
39 | Proj4js.Proj['tmerc'].init.apply(this);
40 | this.forward = Proj4js.Proj['tmerc'].forward;
41 | this.inverse = Proj4js.Proj['tmerc'].inverse;
42 | }
43 | };
--------------------------------------------------------------------------------
/app/templates/viewer.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
40 |
41 |
--------------------------------------------------------------------------------
/app/static/externals/ext/license.txt:
--------------------------------------------------------------------------------
1 | Ext JS - JavaScript Library
2 | Copyright (c) 2006-2011, Sencha Inc.
3 | All rights reserved.
4 | licensing@sencha.com
5 |
6 | http://www.sencha.com/license
7 |
8 | Open Source License
9 | ------------------------------------------------------------------------------------------
10 | Ext JS is licensed under the terms of the Open Source GPL 3.0 license.
11 |
12 | http://www.gnu.org/licenses/gpl.html
13 |
14 | There are several FLOSS exceptions available for use with this release for
15 | open source applications that are distributed under a license other than the GPL.
16 |
17 | * Open Source License Exception for Applications
18 |
19 | http://www.sencha.com/products/floss-exception.php
20 |
21 | * Open Source License Exception for Development
22 |
23 | http://www.sencha.com/products/ux-exception.php
24 |
25 |
26 | Commercial License
27 | ------------------------------------------------------------------------------------------
28 | This is the appropriate option if you are creating proprietary applications and you are
29 | not prepared to distribute and share the source code of your application under the
30 | GPL v3 license. Please visit http://www.sencha.com/license for more details.
31 |
32 |
33 | OEM / Reseller License
34 | ------------------------------------------------------------------------------------------
35 | For more details, please visit: http://www.sencha.com/license.
36 |
37 | --
38 |
39 | This library is distributed in the hope that it will be useful,
40 | but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF THIRD-PARTY INTELLECTUAL PROPERTY RIGHTS. See the GNU
41 | General Public License for more details.
--------------------------------------------------------------------------------
/app/util.js:
--------------------------------------------------------------------------------
1 |
2 | exports.responseForStatus = function(status, msg) {
3 | return {
4 | status: status,
5 | headers: {
6 | "Content-Type": "text/plain"
7 | },
8 | body: [msg || codes[status]]
9 | };
10 | };
11 |
12 | var codes = {
13 | 100: "Continue",
14 | 101: "Switching Protocols",
15 | 102: "Processing",
16 | 200: "OK",
17 | 201: "Created",
18 | 202: "Accepted",
19 | 203: "Non-Authoritative Information",
20 | 204: "No Content",
21 | 205: "Reset Content",
22 | 206: "Partial Content",
23 | 207: "Multi-Status",
24 | 300: "Multiple Choices",
25 | 301: "Moved Permanently",
26 | 302: "Found",
27 | 303: "See Other",
28 | 304: "Not Modified",
29 | 305: "Use Proxy",
30 | 307: "Temporary Redirect",
31 | 400: "Bad Request",
32 | 401: "Unauthorized",
33 | 402: "Payment Required",
34 | 403: "Forbidden",
35 | 404: "Not Found",
36 | 405: "Method Not Allowed",
37 | 406: "Not Acceptable",
38 | 407: "Proxy Authentication Required",
39 | 408: "Request Timeout",
40 | 409: "Conflict",
41 | 410: "Gone",
42 | 411: "Length Required",
43 | 412: "Precondition Failed",
44 | 413: "Request Entity Too Large",
45 | 414: "Request-URI Too Large",
46 | 415: "Unsupported Media Type",
47 | 416: "Request Range Not Satisfiable",
48 | 417: "Expectation Failed",
49 | 422: "Unprocessable Entity",
50 | 423: "Locked",
51 | 424: "Failed Dependency",
52 | 500: "Internal Server Error",
53 | 501: "Not Implemented",
54 | 502: "Bad Gateway",
55 | 503: "Service Unavailable",
56 | 504: "Gateway Timeout",
57 | 505: "HTTP Version Not Supported",
58 | 507: "Insufficient Storage"
59 | };
60 |
--------------------------------------------------------------------------------
/app/static/externals/proj4js/lib/projCode/sterea.js:
--------------------------------------------------------------------------------
1 |
2 | Proj4js.Proj.sterea = {
3 | dependsOn : 'gauss',
4 |
5 | init : function() {
6 | Proj4js.Proj['gauss'].init.apply(this);
7 | if (!this.rc) {
8 | Proj4js.reportError("sterea:init:E_ERROR_0");
9 | return;
10 | }
11 | this.sinc0 = Math.sin(this.phic0);
12 | this.cosc0 = Math.cos(this.phic0);
13 | this.R2 = 2.0 * this.rc;
14 | if (!this.title) this.title = "Oblique Stereographic Alternative";
15 | },
16 |
17 | forward : function(p) {
18 | p.x = Proj4js.common.adjust_lon(p.x-this.long0); /* adjust del longitude */
19 | Proj4js.Proj['gauss'].forward.apply(this, [p]);
20 | sinc = Math.sin(p.y);
21 | cosc = Math.cos(p.y);
22 | cosl = Math.cos(p.x);
23 | k = this.k0 * this.R2 / (1.0 + this.sinc0 * sinc + this.cosc0 * cosc * cosl);
24 | p.x = k * cosc * Math.sin(p.x);
25 | p.y = k * (this.cosc0 * sinc - this.sinc0 * cosc * cosl);
26 | p.x = this.a * p.x + this.x0;
27 | p.y = this.a * p.y + this.y0;
28 | return p;
29 | },
30 |
31 | inverse : function(p) {
32 | var lon,lat;
33 | p.x = (p.x - this.x0) / this.a; /* descale and de-offset */
34 | p.y = (p.y - this.y0) / this.a;
35 |
36 | p.x /= this.k0;
37 | p.y /= this.k0;
38 | if ( (rho = Math.sqrt(p.x*p.x + p.y*p.y)) ) {
39 | c = 2.0 * Math.atan2(rho, this.R2);
40 | sinc = Math.sin(c);
41 | cosc = Math.cos(c);
42 | lat = Math.asin(cosc * this.sinc0 + p.y * sinc * this.cosc0 / rho);
43 | lon = Math.atan2(p.x * sinc, rho * this.cosc0 * cosc - p.y * this.sinc0 * sinc);
44 | } else {
45 | lat = this.phic0;
46 | lon = 0.;
47 | }
48 |
49 | p.x = lon;
50 | p.y = lat;
51 | Proj4js.Proj['gauss'].inverse.apply(this,[p]);
52 | p.x = Proj4js.common.adjust_lon(p.x + this.long0); /* adjust longitude to CM */
53 | return p;
54 | }
55 | };
56 |
57 |
--------------------------------------------------------------------------------
/app/static/externals/proj4js/lib/projCode/gstmerc.js:
--------------------------------------------------------------------------------
1 | Proj4js.Proj.gstmerc = {
2 | init : function() {
3 |
4 | // array of: a, b, lon0, lat0, k0, x0, y0
5 | var temp= this.b / this.a;
6 | this.e= Math.sqrt(1.0 - temp*temp);
7 | this.lc= this.long0;
8 | this.rs= Math.sqrt(1.0+this.e*this.e*Math.pow(Math.cos(this.lat0),4.0)/(1.0-this.e*this.e));
9 | var sinz= Math.sin(this.lat0);
10 | var pc= Math.asin(sinz/this.rs);
11 | var sinzpc= Math.sin(pc);
12 | this.cp= Proj4js.common.latiso(0.0,pc,sinzpc)-this.rs*Proj4js.common.latiso(this.e,this.lat0,sinz);
13 | this.n2= this.k0*this.a*Math.sqrt(1.0-this.e*this.e)/(1.0-this.e*this.e*sinz*sinz);
14 | this.xs= this.x0;
15 | this.ys= this.y0-this.n2*pc;
16 |
17 | if (!this.title) this.title = "Gauss Schreiber transverse mercator";
18 | },
19 |
20 |
21 | // forward equations--mapping lat,long to x,y
22 | // -----------------------------------------------------------------
23 | forward : function(p) {
24 |
25 | var lon= p.x;
26 | var lat= p.y;
27 |
28 | var L= this.rs*(lon-this.lc);
29 | var Ls= this.cp+(this.rs*Proj4js.common.latiso(this.e,lat,Math.sin(lat)));
30 | var lat1= Math.asin(Math.sin(L)/Proj4js.common.cosh(Ls));
31 | var Ls1= Proj4js.common.latiso(0.0,lat1,Math.sin(lat1));
32 | p.x= this.xs+(this.n2*Ls1);
33 | p.y= this.ys+(this.n2*Math.atan(Proj4js.common.sinh(Ls)/Math.cos(L)));
34 | return p;
35 | },
36 |
37 | // inverse equations--mapping x,y to lat/long
38 | // -----------------------------------------------------------------
39 | inverse : function(p) {
40 |
41 | var x= p.x;
42 | var y= p.y;
43 |
44 | var L= Math.atan(Proj4js.common.sinh((x-this.xs)/this.n2)/Math.cos((y-this.ys)/this.n2));
45 | var lat1= Math.asin(Math.sin((y-this.ys)/this.n2)/Proj4js.common.cosh((x-this.xs)/this.n2));
46 | var LC= Proj4js.common.latiso(0.0,lat1,Math.sin(lat1));
47 | p.x= this.lc+L/this.rs;
48 | p.y= Proj4js.common.invlatiso(this.e,(LC-this.cp)/this.rs);
49 | return p;
50 | }
51 |
52 | };
53 |
--------------------------------------------------------------------------------
/app/auth.js:
--------------------------------------------------------------------------------
1 | var clientRequest = require("./httpclient").request;
2 | var Headers = require("ringo/utils/http").Headers;
3 | var objects = require("ringo/utils/objects");
4 |
5 | function getGeoServerUrl(request) {
6 | var url = java.lang.System.getProperty("app.proxy.geoserver");
7 | if (url) {
8 | if (url.charAt(url.length-1) !== "/") {
9 | url = url + "/";
10 | }
11 | } else {
12 | url = request.scheme + "://" + request.host + (request.port ? ":" + request.port : "") + "/geoserver/";
13 | }
14 | return url;
15 | }
16 |
17 | function getLoginUrl(request) {
18 | return getGeoServerUrl(request) + "j_spring_security_check";
19 | }
20 |
21 | function getAuthUrl(request) {
22 | return getGeoServerUrl(request) + "rest";
23 | }
24 |
25 | // get status (ACK!) by parsing Location header
26 | function parseStatus(exchange) {
27 | var status = 200;
28 | var location = exchange.headers.get("Location");
29 | if (/error=true/.test(location)) {
30 | status = 401;
31 | }
32 | return status;
33 | }
34 |
35 | exports.getStatus = function(request) {
36 | var url = getAuthUrl(request);
37 | var status = 401;
38 | var headers = new Headers(request.headers);
39 | var token = headers.get("Cookie");
40 | var exchange = clientRequest({
41 | url: url,
42 | method: "GET",
43 | async: false,
44 | headers: headers
45 | });
46 | exchange.wait();
47 | return exchange.status;
48 | };
49 |
50 | exports.authenticate = function(request) {
51 | var params = request.postParams;
52 | var status = 401;
53 | var token;
54 | if (params.username && params.password) {
55 | var url = getLoginUrl(request);
56 | var exchange = clientRequest({
57 | url: url,
58 | method: "post",
59 | async: false,
60 | data: {
61 | username: params.username,
62 | password: params.password
63 | }
64 | });
65 | exchange.wait();
66 | status = parseStatus(exchange);
67 | if (status === 200) {
68 | var cookie = exchange.headers.get("Set-Cookie");
69 | if (cookie) {
70 | token = cookie.split(";").shift();
71 | }
72 | }
73 | }
74 | return {
75 | token: token,
76 | status: status
77 | }
78 | };
79 |
80 |
--------------------------------------------------------------------------------
/app/static/theme/ux/colorpicker/color-picker.ux.css:
--------------------------------------------------------------------------------
1 | .x-cp-panel {
2 | width: 386px;
3 | height: 262px;
4 | }
5 | .x-cp-rgb-msk {
6 | background-image: url(mask.png);
7 | background-color: #FF0000;
8 | width: 256px;
9 | height: 256px;
10 | float: left;
11 | cursor: crosshair;
12 | _cursor: hand;
13 | _background-image:none;
14 | _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='mask.png',sizingMethod='scale');
15 | }
16 | .x-cp-rgb-picker {
17 | width: 5px;
18 | height: 5px;
19 | cursor: crosshair;
20 | _cursor: hand;
21 | background: url(picker.gif) transparent;
22 | background-repeat: no-repeat;
23 | }
24 | .x-cp-hue-picker {
25 | width: 5px;
26 | height: 5px;
27 | cursor: crosshair;
28 | _cursor: hand;
29 | background: url(picker.gif) transparent;
30 | background-repeat: no-repeat;
31 | }
32 | .x-cp-hue-msk {
33 | margin: 0px 0px 0px 3px;
34 | background-image: url(side_slider.jpg);
35 | background-color: #FF0000;
36 | width: 14px;
37 | height: 256px;
38 | float: left;
39 | cursor: crosshair;
40 | _cursor: hand;
41 | }
42 | .x-cp-control-container {
43 | float: left;
44 | margin: 0 0 0 3px;
45 | padding: 0;
46 | width: 98px;
47 | }
48 | .x-cp-color-container, .x-cp-coloro-container {
49 | margin: 5px 0;
50 | border: 1px solid gray;
51 | height: 16px;
52 | line-height: 16px;
53 | padding: 1px;
54 | font-size: 9px;
55 | text-align: center;
56 | vertical-align: middle;
57 | cursor: pointer;
58 | _cursor: hand;
59 | }
60 | .x-cp-coloro-container {
61 | cursor: default;
62 | }
63 | .x-cp-panel .x-form-item-label {
64 | font-size: 9px;
65 | width: 45px;
66 | float: left;
67 | margin: 5px 0;
68 | }
69 | .x-cp-rgb-container {
70 | font-size: 10px;
71 | }
72 | .x-cp-form .x-form-field, .x-cp-form .x-form-element {
73 | height: 12px;
74 | line-height: 10px;
75 | width: 40px;
76 | font-size: 10px;
77 | text-align: center;
78 | float: left;
79 | padding: 0;
80 | }
81 | .x-cp-clear {
82 | clear: both;
83 | }
84 | .x-cp-hexa-panel {
85 | height: 30px;
86 | float: left;
87 | }
88 | .x-cp-form .x-fieldset, .x-cp-form .x-form-item, .x-cp-form .x-fieldset {
89 | margin: 0;
90 | padding: 0;
91 | }
92 | .x-cp-form .x-form-item-label {
93 | width: 30px;
94 | margin: 0 0 0 3px;
95 | padding-top: 0px;
96 | }
97 |
98 | .x-cp-colors-container {
99 | margin: 5px 0;
100 | clear: both;
101 | height: auto;
102 | }
--------------------------------------------------------------------------------
/app/static/externals/proj4js/lib/projCode/equi.js:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | NAME EQUIRECTANGULAR
3 |
4 | PURPOSE: Transforms input longitude and latitude to Easting and
5 | Northing for the Equirectangular projection. The
6 | longitude and latitude must be in radians. The Easting
7 | and Northing values will be returned in meters.
8 |
9 | PROGRAMMER DATE
10 | ---------- ----
11 | T. Mittan Mar, 1993
12 |
13 | ALGORITHM REFERENCES
14 |
15 | 1. Snyder, John P., "Map Projections--A Working Manual", U.S. Geological
16 | Survey Professional Paper 1395 (Supersedes USGS Bulletin 1532), United
17 | State Government Printing Office, Washington D.C., 1987.
18 |
19 | 2. Snyder, John P. and Voxland, Philip M., "An Album of Map Projections",
20 | U.S. Geological Survey Professional Paper 1453 , United State Government
21 | Printing Office, Washington D.C., 1989.
22 | *******************************************************************************/
23 | Proj4js.Proj.equi = {
24 |
25 | init: function() {
26 | if(!this.x0) this.x0=0;
27 | if(!this.y0) this.y0=0;
28 | if(!this.lat0) this.lat0=0;
29 | if(!this.long0) this.long0=0;
30 | ///this.t2;
31 | },
32 |
33 |
34 |
35 | /* Equirectangular forward equations--mapping lat,long to x,y
36 | ---------------------------------------------------------*/
37 | forward: function(p) {
38 |
39 | var lon=p.x;
40 | var lat=p.y;
41 |
42 | var dlon = Proj4js.common.adjust_lon(lon - this.long0);
43 | var x = this.x0 +this. a * dlon *Math.cos(this.lat0);
44 | var y = this.y0 + this.a * lat;
45 |
46 | this.t1=x;
47 | this.t2=Math.cos(this.lat0);
48 | p.x=x;
49 | p.y=y;
50 | return p;
51 | }, //equiFwd()
52 |
53 |
54 |
55 | /* Equirectangular inverse equations--mapping x,y to lat/long
56 | ---------------------------------------------------------*/
57 | inverse: function(p) {
58 |
59 | p.x -= this.x0;
60 | p.y -= this.y0;
61 | var lat = p.y /this. a;
62 |
63 | if ( Math.abs(lat) > Proj4js.common.HALF_PI) {
64 | Proj4js.reportError("equi:Inv:DataError");
65 | }
66 | var lon = Proj4js.common.adjust_lon(this.long0 + p.x / (this.a * Math.cos(this.lat0)));
67 | p.x=lon;
68 | p.y=lat;
69 | }//equiInv()
70 | };
71 |
72 |
73 |
--------------------------------------------------------------------------------
/app/static/externals/proj4js/lib/projCode/aeqd.js:
--------------------------------------------------------------------------------
1 | Proj4js.Proj.aeqd = {
2 |
3 | init : function() {
4 | this.sin_p12=Math.sin(this.lat0);
5 | this.cos_p12=Math.cos(this.lat0);
6 | },
7 |
8 | forward: function(p) {
9 | var lon=p.x;
10 | var lat=p.y;
11 | var ksp;
12 |
13 | var sinphi=Math.sin(p.y);
14 | var cosphi=Math.cos(p.y);
15 | var dlon = Proj4js.common.adjust_lon(lon - this.long0);
16 | var coslon = Math.cos(dlon);
17 | var g = this.sin_p12 * sinphi + this.cos_p12 * cosphi * coslon;
18 | if (Math.abs(Math.abs(g) - 1.0) < Proj4js.common.EPSLN) {
19 | ksp = 1.0;
20 | if (g < 0.0) {
21 | Proj4js.reportError("aeqd:Fwd:PointError");
22 | return;
23 | }
24 | } else {
25 | var z = Math.acos(g);
26 | ksp = z/Math.sin(z);
27 | }
28 | p.x = this.x0 + this.a * ksp * cosphi * Math.sin(dlon);
29 | p.y = this.y0 + this.a * ksp * (this.cos_p12 * sinphi - this.sin_p12 * cosphi * coslon);
30 | return p;
31 | },
32 |
33 | inverse: function(p){
34 | p.x -= this.x0;
35 | p.y -= this.y0;
36 |
37 | var rh = Math.sqrt(p.x * p.x + p.y *p.y);
38 | if (rh > (2.0 * Proj4js.common.HALF_PI * this.a)) {
39 | Proj4js.reportError("aeqdInvDataError");
40 | return;
41 | }
42 | var z = rh / this.a;
43 |
44 | var sinz=Math.sin(z);
45 | var cosz=Math.cos(z);
46 |
47 | var lon = this.long0;
48 | var lat;
49 | if (Math.abs(rh) <= Proj4js.common.EPSLN) {
50 | lat = this.lat0;
51 | } else {
52 | lat = Proj4js.common.asinz(cosz * this.sin_p12 + (p.y * sinz * this.cos_p12) / rh);
53 | var con = Math.abs(this.lat0) - Proj4js.common.HALF_PI;
54 | if (Math.abs(con) <= Proj4js.common.EPSLN) {
55 | if (lat0 >= 0.0) {
56 | lon = Proj4js.common.adjust_lon(this.long0 + Math.atan2(p.x , -p.y));
57 | } else {
58 | lon = Proj4js.common.adjust_lon(this.long0 - Math.atan2(-p.x , p.y));
59 | }
60 | } else {
61 | con = cosz - this.sin_p12 * Math.sin(lat);
62 | if ((Math.abs(con) < Proj4js.common.EPSLN) && (Math.abs(p.x) < Proj4js.common.EPSLN)) {
63 | //no-op, just keep the lon value as is
64 | } else {
65 | var temp = Math.atan2((p.x * sinz * this.cos_p12), (con * rh));
66 | lon = Proj4js.common.adjust_lon(this.long0 + Math.atan2((p.x * sinz * this.cos_p12), (con * rh)));
67 | }
68 | }
69 | }
70 |
71 | p.x = lon;
72 | p.y = lat;
73 | return p;
74 | }
75 | };
76 |
--------------------------------------------------------------------------------
/app/static/externals/proj4js/lib/projCode/mill.js:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | NAME MILLER CYLINDRICAL
3 |
4 | PURPOSE: Transforms input longitude and latitude to Easting and
5 | Northing for the Miller Cylindrical projection. The
6 | longitude and latitude must be in radians. The Easting
7 | and Northing values will be returned in meters.
8 |
9 | PROGRAMMER DATE
10 | ---------- ----
11 | T. Mittan March, 1993
12 |
13 | This function was adapted from the Lambert Azimuthal Equal Area projection
14 | code (FORTRAN) in the General Cartographic Transformation Package software
15 | which is available from the U.S. Geological Survey National Mapping Division.
16 |
17 | ALGORITHM REFERENCES
18 |
19 | 1. "New Equal-Area Map Projections for Noncircular Regions", John P. Snyder,
20 | The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.
21 |
22 | 2. Snyder, John P., "Map Projections--A Working Manual", U.S. Geological
23 | Survey Professional Paper 1395 (Supersedes USGS Bulletin 1532), United
24 | State Government Printing Office, Washington D.C., 1987.
25 |
26 | 3. "Software Documentation for GCTP General Cartographic Transformation
27 | Package", U.S. Geological Survey National Mapping Division, May 1982.
28 | *******************************************************************************/
29 |
30 | Proj4js.Proj.mill = {
31 |
32 | /* Initialize the Miller Cylindrical projection
33 | -------------------------------------------*/
34 | init: function() {
35 | //no-op
36 | },
37 |
38 |
39 | /* Miller Cylindrical forward equations--mapping lat,long to x,y
40 | ------------------------------------------------------------*/
41 | forward: function(p) {
42 | var lon=p.x;
43 | var lat=p.y;
44 | /* Forward equations
45 | -----------------*/
46 | var dlon = Proj4js.common.adjust_lon(lon -this.long0);
47 | var x = this.x0 + this.a * dlon;
48 | var y = this.y0 + this.a * Math.log(Math.tan((Proj4js.common.PI / 4.0) + (lat / 2.5))) * 1.25;
49 |
50 | p.x=x;
51 | p.y=y;
52 | return p;
53 | },//millFwd()
54 |
55 | /* Miller Cylindrical inverse equations--mapping x,y to lat/long
56 | ------------------------------------------------------------*/
57 | inverse: function(p) {
58 | p.x -= this.x0;
59 | p.y -= this.y0;
60 |
61 | var lon = Proj4js.common.adjust_lon(this.long0 + p.x /this.a);
62 | var lat = 2.5 * (Math.atan(Math.exp(0.8*p.y/this.a)) - Proj4js.common.PI / 4.0);
63 |
64 | p.x=lon;
65 | p.y=lat;
66 | return p;
67 | }//millInv()
68 | };
69 |
--------------------------------------------------------------------------------
/app/static/externals/proj4js/lib/projCode/sinu.js:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | NAME SINUSOIDAL
3 |
4 | PURPOSE: Transforms input longitude and latitude to Easting and
5 | Northing for the Sinusoidal projection. The
6 | longitude and latitude must be in radians. The Easting
7 | and Northing values will be returned in meters.
8 |
9 | PROGRAMMER DATE
10 | ---------- ----
11 | D. Steinwand, EROS May, 1991
12 |
13 | This function was adapted from the Sinusoidal projection code (FORTRAN) in the
14 | General Cartographic Transformation Package software which is available from
15 | the U.S. Geological Survey National Mapping Division.
16 |
17 | ALGORITHM REFERENCES
18 |
19 | 1. Snyder, John P., "Map Projections--A Working Manual", U.S. Geological
20 | Survey Professional Paper 1395 (Supersedes USGS Bulletin 1532), United
21 | State Government Printing Office, Washington D.C., 1987.
22 |
23 | 2. "Software Documentation for GCTP General Cartographic Transformation
24 | Package", U.S. Geological Survey National Mapping Division, May 1982.
25 | *******************************************************************************/
26 |
27 | Proj4js.Proj.sinu = {
28 |
29 | /* Initialize the Sinusoidal projection
30 | ------------------------------------*/
31 | init: function() {
32 | /* Place parameters in static storage for common use
33 | -------------------------------------------------*/
34 | this.R = 6370997.0; //Radius of earth
35 | },
36 |
37 | /* Sinusoidal forward equations--mapping lat,long to x,y
38 | -----------------------------------------------------*/
39 | forward: function(p) {
40 | var x,y,delta_lon;
41 | var lon=p.x;
42 | var lat=p.y;
43 | /* Forward equations
44 | -----------------*/
45 | delta_lon = Proj4js.common.adjust_lon(lon - this.long0);
46 | x = this.R * delta_lon * Math.cos(lat) + this.x0;
47 | y = this.R * lat + this.y0;
48 |
49 | p.x=x;
50 | p.y=y;
51 | return p;
52 | },
53 |
54 | inverse: function(p) {
55 | var lat,temp,lon;
56 |
57 | /* Inverse equations
58 | -----------------*/
59 | p.x -= this.x0;
60 | p.y -= this.y0;
61 | lat = p.y / this.R;
62 | if (Math.abs(lat) > Proj4js.common.HALF_PI) {
63 | Proj4js.reportError("sinu:Inv:DataError");
64 | }
65 | temp = Math.abs(lat) - Proj4js.common.HALF_PI;
66 | if (Math.abs(temp) > Proj4js.common.EPSLN) {
67 | temp = this.long0+ p.x / (this.R *Math.cos(lat));
68 | lon = Proj4js.common.adjust_lon(temp);
69 | } else {
70 | lon = this.long0;
71 | }
72 |
73 | p.x=lon;
74 | p.y=lat;
75 | return p;
76 | }
77 | };
78 |
79 |
80 |
--------------------------------------------------------------------------------
/app/main.js:
--------------------------------------------------------------------------------
1 | var {Application} = require("stick");
2 |
3 | var app = Application();
4 | app.configure("notfound", "error", "static", "params", "mount");
5 | app.static(module.resolve("static"));
6 |
7 | app.mount("/", function(request) {
8 | if (request.pathInfo.length > 1) {
9 | throw {notfound: true};
10 | }
11 | var target = request.scheme + "://" + request.host + ":" + request.port + request.scriptName + "/composer/";
12 | return {
13 | status: 303,
14 | headers: {"Location": target},
15 | body: []
16 | };
17 | });
18 | app.mount("/composer", require("./root/composer").app);
19 | app.mount("/login", require("./root/login").app);
20 | app.mount("/maps/", require("./root/maps").app);
21 | app.mount("/proxy", require("./root/proxy").app);
22 | // TODO: remove workaround for added slashes
23 | app.mount("/viewer/proxy", require("./root/proxy").app);
24 | app.mount("/composer/proxy", require("./root/proxy").app);
25 | app.mount("/viewer", require("./root/viewer").app);
26 |
27 |
28 | // debug mode loads unminified scripts
29 | // assumes markup pulls in scripts under the path /servlet_name/script/
30 | if (java.lang.System.getProperty("app.debug")) {
31 | var fs = require("fs");
32 | var config = fs.normal(fs.join(module.directory, "..", "buildjs.cfg"));
33 | app.mount("/script/", require("./autoloader").App(config));
34 |
35 | // proxy a remote geoserver on /geoserver by setting app.proxy.geoserver to remote URL
36 | // only recommended for debug mode
37 | var geoserver = java.lang.System.getProperty("app.proxy.geoserver");
38 | if (geoserver) {
39 | if (geoserver.charAt(geoserver.length-1) !== "/") {
40 | geoserver = geoserver + "/";
41 | }
42 | // debug specific proxy
43 | app.mount("/geoserver/", require("./root/proxy").pass({url: geoserver, preserveHost: true, allowAuth: true}));
44 | }
45 | }
46 |
47 | // Redirect requests for servlet name without a trailing slash.
48 | // Jetty does this automatically for /servlet_name, Tomcat does not.
49 | function slash(app) {
50 | return function(request) {
51 | var servletRequest = request.env.servletRequest;
52 | var pathInfo = servletRequest.getPathInfo();
53 | if (pathInfo === "/") {
54 | var uri = servletRequest.getRequestURI();
55 | if (uri.charAt(uri.length-1) !== "/") {
56 | var location = servletRequest.getScheme() + "://" +
57 | servletRequest.getServerName() + ":" + servletRequest.getServerPort() +
58 | uri + "/";
59 | return {
60 | status: 301,
61 | headers: {"Location": location},
62 | body: []
63 | };
64 | }
65 | }
66 | return app(request);
67 | };
68 | }
69 |
70 | exports.app = slash(app);
71 |
72 | // main script to start application
73 | if (require.main === module) {
74 | require("ringo/httpserver").main(module.id);
75 | }
76 |
--------------------------------------------------------------------------------
/app/static/externals/proj4js/demo/ProjPane.js:
--------------------------------------------------------------------------------
1 | var panes = {
2 | mapL: {},
3 | mapLL: {},
4 | mapR: {}
5 | };
6 |
7 | ProjPane = Class.create();
8 | ProjPane.prototype = {
9 | id: null,
10 | map: null,
11 | proj: null,
12 |
13 | initialize: function(pane, code) {
14 | this.id = pane;
15 | if (code) this.setProj(code);
16 | },
17 |
18 | updateCoords: function(coords) {
19 | document.getElementById(this.id+'_coords').innerHTML = coords.toString();
20 | var pt = this.map.getLayerPxFromLonLat(coords);
21 | this.marker.moveTo(pt);
22 | },
23 |
24 | setProj: function(code) {
25 | document.getElementById(this.id+'_proj').value = code;
26 |
27 | this.proj = new Proj4js.Proj(code);
28 | var mapDef = Proj4js.maps[this.proj.srsCode];
29 |
30 | if (this.map) this.map.destroy();
31 | this.map = new OpenLayers.Map(this.id, mapDef.mapOptions);
32 | this.mapLayer = new OpenLayers.Layer.WMS(mapDef.layerName, mapDef.layerUrl, mapDef.layerParams, mapDef.layerOptions);
33 | this.map.addLayer(this.mapLayer);
34 |
35 | this.map.addLayer(new OpenLayers.Layer.Markers(''));
36 | this.marker = new OpenLayers.Marker(new OpenLayers.LonLat(0,0));
37 | this.map.layers[1].addMarker(this.marker);
38 | this.marker.map = this.map;
39 | if (window.bounds) {
40 | this.map.addLayer(new OpenLayers.Layer.Boxes());
41 | this.map.layers[2].addMarker(new OpenLayers.Marker.Box(bounds));
42 | this.map.setCenter(bounds.getCenterLonLat());
43 | } else {
44 | this.map.zoomToMaxExtent();
45 | }
46 | this.map.events.register('click', this.map, this.mapClicked.bind(this));
47 |
48 | document.getElementById(this.id+'_units').innerHTML = this.proj.units;
49 | document.getElementById(this.id+'_title').innerHTML = this.proj.title;
50 | document.getElementById(this.id+'_class').innerHTML = this.proj.projName;
51 | },
52 |
53 | mapClicked: function(ev) {
54 | var olc = this.map.getLonLatFromViewPortPx(ev.xy);
55 | c = new Proj4js.Point(olc.lon, olc.lat);
56 | this.updateCoords(c);
57 |
58 | if (this.opposite && this.opposite.proj) {
59 | var newCoords = this.proj.transform(c, this.opposite.proj);
60 | this.opposite.updateCoords(newCoords);
61 | }
62 | if (this.common) {
63 | var newCoords = this.proj.inverse(c);
64 | this.common.updateCoords(newCoords);
65 | }
66 | if (this.projected1 && this.projected1.proj) {
67 | var newCoords = this.projected1.proj.forward(c);
68 | this.projected1.updateCoords(newCoords);
69 | }
70 | if (this.projected2 && this.projected2.proj) {
71 | var newCoords = this.projected2.proj.forward(c);
72 | this.projected2.updateCoords(newCoords);
73 | }
74 | }
75 | };
76 |
77 |
78 | function init() {
79 | panes['mapLL'] = new ProjPane('mapLL',Proj4js.defaultDatum);
80 | panes['mapL'] = new ProjPane('mapL');
81 | panes['mapR'] = new ProjPane('mapR');
82 |
83 | panes['mapLL'].projected1 = panes['mapL'];
84 | panes['mapLL'].projected2 = panes['mapR'];
85 | panes['mapL'].opposite = panes['mapR'];
86 | panes['mapR'].opposite = panes['mapL'];
87 | panes['mapL'].common = panes['mapLL'];
88 | panes['mapR'].common = panes['mapLL'];
89 |
90 | };
91 |
92 |
--------------------------------------------------------------------------------
/app/static/externals/proj4js/test/runtests.js:
--------------------------------------------------------------------------------
1 | /* Loop through the test points and create a Proj object for each
2 | */
3 | function runTests() {
4 | for (var i=0; i < Proj4js.testPoints.length; ++i) {
5 | var test = Proj4js.testPoints[i];
6 | var proj = new Proj4js.Proj(test.code);
7 | checkProjLoaded.call(proj, test);
8 | }
9 | }
10 |
11 | /* a timer that waits for the readyToUse flag to be set. This gets called in
12 | * the context of the Proj4js.Proj object
13 | */
14 | function checkProjLoaded(test) {
15 | if (!this.readyToUse) {
16 | window.setTimeout(Proj4js.bind(checkProjLoaded, this, test), 500);
17 | } else {
18 | showResults(this, test);
19 | }
20 |
21 | }
22 |
23 | /* a callback function to run the test for this test point since we are using
24 | the dynamic load capabilities in the test page
25 | */
26 | function showResults(proj, test) {
27 | //var test = proj.testPoint;
28 | var xyEPSLN = 1.0e-2;
29 | var llEPSLN = 1.0e-6;
30 | var row = document.createElement('tr');
31 | var td = document.createElement('td');
32 | td.innerHTML = test.code;
33 | row.appendChild(td);
34 | var td = document.createElement('td');
35 | td.innerHTML = proj.projName;
36 | row.appendChild(td);
37 |
38 | //transform from lon/lat to projected x/y and cmopare
39 | var xyResult = Proj4js.transform(Proj4js.WGS84, proj, new Proj4js.Point(test.ll));
40 | if (xyResult) {
41 | var deltaX = Math.abs(xyResult.x - test.xy[0]);
42 | var deltaY = Math.abs(xyResult.y - test.xy[1]);
43 | td = document.createElement('td');
44 | td.innerHTML = "in:"+test.ll[0]+","+test.ll[1];
45 | row.appendChild(td);
46 | td = document.createElement('td');
47 | td.innerHTML = "out:"+xyResult.x+","+xyResult.y;
48 | row.appendChild(td);
49 | td = document.createElement('td');
50 | td.innerHTML = "dx:"+deltaX+ " dy:"+deltaY;
51 | if ( deltaX>xyEPSLN || deltaY>xyEPSLN ) td.style.backgroundColor='red';
52 | row.appendChild(td);
53 | } else {
54 | td = document.createElement('td');
55 | td.innerHTML = "proj undefined";
56 | row.appendChild(td);
57 | }
58 |
59 | //transform from map x/y to lon/lat and compare
60 | var llResult = Proj4js.transform(proj, Proj4js.WGS84, new Proj4js.Point(test.xy));
61 | if (llResult) {
62 | var deltaX = Math.abs(llResult.x - test.ll[0]);
63 | var deltaY = Math.abs(llResult.y - test.ll[1]);
64 | td = document.createElement('td');
65 | td.innerHTML = "in:"+test.xy[0]+","+test.xy[1];
66 | row.appendChild(td);
67 | td = document.createElement('td');
68 | td.innerHTML = "out:"+llResult.x+","+llResult.y;
69 | row.appendChild(td);
70 | td = document.createElement('td');
71 | td.innerHTML = "dx:"+deltaX+ " dy:"+deltaY;
72 | if ( deltaX>llEPSLN || deltaY>llEPSLN ) td.style.backgroundColor='red';
73 | row.appendChild(td);
74 | } else {
75 | td = document.createElement('td');
76 | td.innerHTML = "proj undefined";
77 | row.appendChild(td);
78 | }
79 |
80 | var testTable = document.getElementById('testResult');
81 | testTable.tBodies[0].appendChild(row);
82 | };
83 |
84 |
--------------------------------------------------------------------------------
/app/static/externals/proj4js/lib/projCode/cea.js:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | NAME LAMBERT CYLINDRICAL EQUAL AREA
3 |
4 | PURPOSE: Transforms input longitude and latitude to Easting and
5 | Northing for the Lambert Cylindrical Equal Area projection.
6 | This class of projection includes the Behrmann and
7 | Gall-Peters Projections. The
8 | longitude and latitude must be in radians. The Easting
9 | and Northing values will be returned in meters.
10 |
11 | PROGRAMMER DATE
12 | ---------- ----
13 | R. Marsden August 2009
14 | Winwaed Software Tech LLC, http://www.winwaed.com
15 |
16 | This function was adapted from the Miller Cylindrical Projection in the Proj4JS
17 | library.
18 |
19 | Note: This implementation assumes a Spherical Earth. The (commented) code
20 | has been included for the ellipsoidal forward transform, but derivation of
21 | the ellispoidal inverse transform is beyond me. Note that most of the
22 | Proj4JS implementations do NOT currently support ellipsoidal figures.
23 | Therefore this is not seen as a problem - especially this lack of support
24 | is explicitly stated here.
25 |
26 | ALGORITHM REFERENCES
27 |
28 | 1. "Cartographic Projection Procedures for the UNIX Environment -
29 | A User's Manual" by Gerald I. Evenden, USGS Open File Report 90-284
30 | and Release 4 Interim Reports (2003)
31 |
32 | 2. Snyder, John P., "Flattening the Earth - Two Thousand Years of Map
33 | Projections", Univ. Chicago Press, 1993
34 | *******************************************************************************/
35 |
36 | Proj4js.Proj.cea = {
37 |
38 | /* Initialize the Cylindrical Equal Area projection
39 | -------------------------------------------*/
40 | init: function() {
41 | //no-op
42 | },
43 |
44 |
45 | /* Cylindrical Equal Area forward equations--mapping lat,long to x,y
46 | ------------------------------------------------------------*/
47 | forward: function(p) {
48 | var lon=p.x;
49 | var lat=p.y;
50 | /* Forward equations
51 | -----------------*/
52 | dlon = Proj4js.common.adjust_lon(lon -this.long0);
53 | var x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);
54 | var y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts);
55 | /* Elliptical Forward Transform
56 | Not implemented due to a lack of a matchign inverse function
57 | {
58 | var Sin_Lat = Math.sin(lat);
59 | var Rn = this.a * (Math.sqrt(1.0e0 - this.es * Sin_Lat * Sin_Lat ));
60 | x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);
61 | y = this.y0 + Rn * Math.sin(lat) / Math.cos(this.lat_ts);
62 | }
63 | */
64 |
65 |
66 | p.x=x;
67 | p.y=y;
68 | return p;
69 | },//ceaFwd()
70 |
71 | /* Cylindrical Equal Area inverse equations--mapping x,y to lat/long
72 | ------------------------------------------------------------*/
73 | inverse: function(p) {
74 | p.x -= this.x0;
75 | p.y -= this.y0;
76 |
77 | var lon = Proj4js.common.adjust_lon( this.long0 + (p.x / this.a) / Math.cos(this.lat_ts) );
78 |
79 | var lat = Math.asin( (p.y/this.a) * Math.cos(this.lat_ts) );
80 |
81 | p.x=lon;
82 | p.y=lat;
83 | return p;
84 | }//ceaInv()
85 | };
86 |
--------------------------------------------------------------------------------
/app/static/externals/proj4js/tools/pjjs.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #
3 | # TODO explain
4 | #
5 | # -- Copyright 2007 IGN France / Geoportail project --
6 | #
7 |
8 | import sys
9 | import os
10 | import re
11 |
12 | SUFFIX_JAVASCRIPT = ".js"
13 |
14 | def _pjcat2js_remove(rezDirectory,catName,targetDirectory):
15 | pjCatFilename = os.path.join(rezDirectory, catName)
16 | pjCat = open(pjCatFilename,'r')
17 | comment_re = re.compile("^#")
18 | srsdef_re = re.compile("^<([^>]*)>.* <>$")
19 | l = pjCat.readline()
20 | while len(l) != 0:
21 | if comment_re.search(l) is None:
22 | srsdef_mo = srsdef_re.match(l)
23 | srsdef_fn = os.path.join(targetDirectory, catName+srsdef_mo.group(1)+".js")
24 | if os.path.exists(srsdef_fn):
25 | os.remove(srsdef_fn)
26 | l = pjCat.readline()
27 | pjCat.close()
28 |
29 | def _pjcat2js_make(rezDirectory,catName,targetDirectory):
30 | pjCatFilename = os.path.join(rezDirectory, catName)
31 | pjCat = open(pjCatFilename,'r')
32 | comment_re = re.compile("^#")
33 | srsdef_re = re.compile("^<([^>]*)> *(.*) <>$")
34 | l = pjCat.readline()
35 | while len(l) != 0:
36 | if comment_re.search(l) is None:
37 | srsdef_mo = srsdef_re.match(l)
38 | srsdef_fn = os.path.join(targetDirectory, catName+srsdef_mo.group(1)+".js")
39 | srsdef = 'Proj4js.defs["'+catName+':'+srsdef_mo.group(1)+'"]="'+srsdef_mo.group(2)+'";'
40 | file(srsdef_fn,'w').write(srsdef)
41 | l = pjCat.readline()
42 | pjCat.close()
43 |
44 | def pjcat2js_clean(rezDirectory,targetDirectory):
45 | if not os.path.isdir(rezDirectory):
46 | return
47 | if not os.path.isdir(targetDirectory):
48 | return
49 | if os.path.abspath(rezDirectory) == '/':
50 | return
51 | if os.path.abspath(targetDirectory) == '/':
52 | return
53 | rezDirectory_name_len = len(rezDirectory)
54 | for root, dirs, filenames in os.walk(rezDirectory):
55 | if 'CVS' in dirs:
56 | dirs.remove('CVS')
57 | if '.svn' in dirs:
58 | dirs.remove('.svn')
59 | for filename in filenames:
60 | if not filename.endswith(SUFFIX_JAVASCRIPT) and not filename.startswith("."):
61 | filepath = os.path.join(root, filename)[rezDirectory_name_len+1:]
62 | filepath = filepath.replace("\\", "/")
63 | _pjcat2js_remove(rezDirectory,filepath,targetDirectory)
64 |
65 | def pjcat2js_run(rezDirectory,targetDirectory):
66 | if not os.path.isdir(rezDirectory):
67 | return
68 | if not os.path.isdir(targetDirectory):
69 | return
70 | if os.path.abspath(rezDirectory) == '/':
71 | return
72 | if os.path.abspath(targetDirectory) == '/':
73 | return
74 | rezDirectory_name_len = len(rezDirectory)
75 | for root, dirs, filenames in os.walk(rezDirectory):
76 | if 'CVS' in dirs:
77 | dirs.remove('CVS')
78 | if '.svn' in dirs:
79 | dirs.remove('.svn')
80 | for filename in filenames:
81 | if not filename.endswith(SUFFIX_JAVASCRIPT) and not filename.startswith("."):
82 | filepath = os.path.join(root, filename)[rezDirectory_name_len+1:]
83 | filepath = filepath.replace("\\", "/")
84 | _pjcat2js_make(rezDirectory,filepath,targetDirectory)
85 |
86 |
--------------------------------------------------------------------------------
/app/static/script/app/GeoExplorer/Viewer.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009-2010 The Open Planning Project
3 | *
4 | * @requires GeoExplorer.js
5 | */
6 |
7 | /** api: (define)
8 | * module = GeoExplorer
9 | * class = Embed
10 | * base_link = GeoExplorer
11 | */
12 | Ext.namespace("GeoExplorer");
13 |
14 | /** api: constructor
15 | * ..class:: GeoExplorer.Viewer(config)
16 | *
17 | * Create a GeoExplorer application suitable for embedding in larger pages.
18 | */
19 | GeoExplorer.Viewer = Ext.extend(GeoExplorer, {
20 |
21 | applyConfig: function(config) {
22 | var allTools = config.viewerTools || this.viewerTools;
23 | var tools = [];
24 | var toolConfig;
25 | for (var i=0, len=allTools.length; i
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
85 |
--------------------------------------------------------------------------------