1801 lines
824 KiB
JavaScript
1801 lines
824 KiB
JavaScript
var COMPILED=!0,goog=goog||{};goog.global=this;goog.exportPath_=function(a,b,c){a=a.split(".");c=c||goog.global;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c=c[d]?c[d]:c[d]={}:c[d]=b};goog.define=function(a,b){var c=b;COMPILED||goog.global.CLOSURE_DEFINES&&Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_DEFINES,a)&&(c=goog.global.CLOSURE_DEFINES[a]);goog.exportPath_(a,c)};goog.DEBUG=!1;goog.LOCALE="en";goog.TRUSTED_SITE=!0;
|
|
goog.provide=function(a){if(!COMPILED){if(goog.isProvided_(a))throw Error('Namespace "'+a+'" already declared.');delete goog.implicitNamespaces_[a];for(var b=a;(b=b.substring(0,b.lastIndexOf(".")))&&!goog.getObjectByName(b);)goog.implicitNamespaces_[b]=!0}goog.exportPath_(a)};goog.setTestOnly=function(a){if(COMPILED&&!goog.DEBUG)throw a=a||"",Error("Importing test-only code into non-debug environment"+a?": "+a:".");};
|
|
COMPILED||(goog.isProvided_=function(a){return!goog.implicitNamespaces_[a]&&!!goog.getObjectByName(a)},goog.implicitNamespaces_={});goog.getObjectByName=function(a,b){for(var c=a.split("."),d=b||goog.global,e;e=c.shift();)if(goog.isDefAndNotNull(d[e]))d=d[e];else return null;return d};goog.globalize=function(a,b){var c=b||goog.global,d;for(d in a)c[d]=a[d]};
|
|
goog.addDependency=function(a,b,c){if(goog.DEPENDENCIES_ENABLED){var d;a=a.replace(/\\/g,"/");for(var e=goog.dependencies_,f=0;d=b[f];f++)e.nameToPath[d]=a,a in e.pathToNames||(e.pathToNames[a]={}),e.pathToNames[a][d]=!0;for(d=0;b=c[d];d++)a in e.requires||(e.requires[a]={}),e.requires[a][b]=!0}};goog.ENABLE_DEBUG_LOADER=!0;
|
|
goog.require=function(a){if(!COMPILED&&!goog.isProvided_(a)){if(goog.ENABLE_DEBUG_LOADER){var b=goog.getPathFromDeps_(a);if(b){goog.included_[b]=!0;goog.writeScripts_();return}}a="goog.require could not find: "+a;goog.global.console&&goog.global.console.error(a);throw Error(a);}};goog.basePath="";goog.nullFunction=function(){};goog.identityFunction=function(a,b){return a};goog.abstractMethod=function(){throw Error("unimplemented abstract method");};
|
|
goog.addSingletonGetter=function(a){a.getInstance=function(){if(a.instance_)return a.instance_;goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=a);return a.instance_=new a}};goog.instantiatedSingletons_=[];goog.DEPENDENCIES_ENABLED=!COMPILED&&goog.ENABLE_DEBUG_LOADER;
|
|
goog.DEPENDENCIES_ENABLED&&(goog.included_={},goog.dependencies_={pathToNames:{},nameToPath:{},requires:{},visited:{},written:{}},goog.inHtmlDocument_=function(){var a=goog.global.document;return"undefined"!=typeof a&&"write"in a},goog.findBasePath_=function(){if(goog.global.CLOSURE_BASE_PATH)goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_())for(var a=goog.global.document.getElementsByTagName("script"),b=a.length-1;0<=b;--b){var c=a[b].src,d=c.lastIndexOf("?"),d=-1==d?c.length:
|
|
d;if("base.js"==c.substr(d-7,7)){goog.basePath=c.substr(0,d-7);break}}},goog.importScript_=function(a){var b=goog.global.CLOSURE_IMPORT_SCRIPT||goog.writeScriptTag_;!goog.dependencies_.written[a]&&b(a)&&(goog.dependencies_.written[a]=!0)},goog.writeScriptTag_=function(a){if(goog.inHtmlDocument_()){var b=goog.global.document;if("complete"==b.readyState){if(/\bdeps.js$/.test(a))return!1;throw Error('Cannot write "'+a+'" after document load');}b.write('\x3cscript type\x3d"text/javascript" src\x3d"'+
|
|
a+'"\x3e\x3c/script\x3e');return!0}return!1},goog.writeScripts_=function(){function a(e){if(!(e in d.written)){if(!(e in d.visited)&&(d.visited[e]=!0,e in d.requires))for(var g in d.requires[e])if(!goog.isProvided_(g))if(g in d.nameToPath)a(d.nameToPath[g]);else throw Error("Undefined nameToPath for "+g);e in c||(c[e]=!0,b.push(e))}}var b=[],c={},d=goog.dependencies_,e;for(e in goog.included_)d.written[e]||a(e);for(e=0;e<b.length;e++)if(b[e])goog.importScript_(goog.basePath+b[e]);else throw Error("Undefined script input");
|
|
},goog.getPathFromDeps_=function(a){return a in goog.dependencies_.nameToPath?goog.dependencies_.nameToPath[a]:null},goog.findBasePath_(),goog.global.CLOSURE_NO_DEPS||goog.importScript_(goog.basePath+"deps.js"));
|
|
goog.typeOf=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
|
|
else if("function"==b&&"undefined"==typeof a.call)return"object";return b};goog.isDef=function(a){return void 0!==a};goog.isNull=function(a){return null===a};goog.isDefAndNotNull=function(a){return null!=a};goog.isArray=function(a){return"array"==goog.typeOf(a)};goog.isArrayLike=function(a){var b=goog.typeOf(a);return"array"==b||"object"==b&&"number"==typeof a.length};goog.isDateLike=function(a){return goog.isObject(a)&&"function"==typeof a.getFullYear};goog.isString=function(a){return"string"==typeof a};
|
|
goog.isBoolean=function(a){return"boolean"==typeof a};goog.isNumber=function(a){return"number"==typeof a};goog.isFunction=function(a){return"function"==goog.typeOf(a)};goog.isObject=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b};goog.getUid=function(a){return a[goog.UID_PROPERTY_]||(a[goog.UID_PROPERTY_]=++goog.uidCounter_)};goog.removeUid=function(a){"removeAttribute"in a&&a.removeAttribute(goog.UID_PROPERTY_);try{delete a[goog.UID_PROPERTY_]}catch(b){}};
|
|
goog.UID_PROPERTY_="closure_uid_"+(1E9*Math.random()>>>0);goog.uidCounter_=0;goog.getHashCode=goog.getUid;goog.removeHashCode=goog.removeUid;goog.cloneObject=function(a){var b=goog.typeOf(a);if("object"==b||"array"==b){if(a.clone)return a.clone();var b="array"==b?[]:{},c;for(c in a)b[c]=goog.cloneObject(a[c]);return b}return a};goog.bindNative_=function(a,b,c){return a.call.apply(a.bind,arguments)};
|
|
goog.bindJs_=function(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}};goog.bind=function(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_;return goog.bind.apply(null,arguments)};
|
|
goog.partial=function(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=Array.prototype.slice.call(arguments);b.unshift.apply(b,c);return a.apply(this,b)}};goog.mixin=function(a,b){for(var c in b)a[c]=b[c]};goog.now=goog.TRUSTED_SITE&&Date.now||function(){return+new Date};
|
|
goog.globalEval=function(a){if(goog.global.execScript)goog.global.execScript(a,"JavaScript");else if(goog.global.eval)if(null==goog.evalWorksForGlobals_&&(goog.global.eval("var _et_ \x3d 1;"),"undefined"!=typeof goog.global._et_?(delete goog.global._et_,goog.evalWorksForGlobals_=!0):goog.evalWorksForGlobals_=!1),goog.evalWorksForGlobals_)goog.global.eval(a);else{var b=goog.global.document,c=b.createElement("script");c.type="text/javascript";c.defer=!1;c.appendChild(b.createTextNode(a));b.body.appendChild(c);
|
|
b.body.removeChild(c)}else throw Error("goog.globalEval not available");};goog.evalWorksForGlobals_=null;goog.getCssName=function(a,b){var c=function(a){return goog.cssNameMapping_[a]||a},d=function(a){a=a.split("-");for(var b=[],d=0;d<a.length;d++)b.push(c(a[d]));return b.join("-")},d=goog.cssNameMapping_?"BY_WHOLE"==goog.cssNameMappingStyle_?c:d:function(a){return a};return b?a+"-"+d(b):d(a)};goog.setCssNameMapping=function(a,b){goog.cssNameMapping_=a;goog.cssNameMappingStyle_=b};
|
|
!COMPILED&&goog.global.CLOSURE_CSS_NAME_MAPPING&&(goog.cssNameMapping_=goog.global.CLOSURE_CSS_NAME_MAPPING);goog.getMsg=function(a,b){var c=b||{},d;for(d in c){var e=(""+c[d]).replace(/\$/g,"$$$$");a=a.replace(RegExp("\\{\\$"+d+"\\}","gi"),e)}return a};goog.getMsgWithFallback=function(a,b){return a};goog.exportSymbol=function(a,b,c){goog.exportPath_(a,b,c)};goog.exportProperty=function(a,b,c){a[b]=c};
|
|
goog.inherits=function(a,b){function c(){}c.prototype=b.prototype;a.superClass_=b.prototype;a.prototype=new c;a.prototype.constructor=a};
|
|
goog.base=function(a,b,c){var d=arguments.callee.caller;if(goog.DEBUG&&!d)throw Error("arguments.caller not defined. goog.base() expects not to be running in strict mode. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(d.superClass_)return d.superClass_.constructor.apply(a,Array.prototype.slice.call(arguments,1));for(var e=Array.prototype.slice.call(arguments,2),f=!1,g=a.constructor;g;g=g.superClass_&&g.superClass_.constructor)if(g.prototype[b]===d)f=!0;else if(f)return g.prototype[b].apply(a,
|
|
e);if(a[b]===d)return a.constructor.prototype[b].apply(a,e);throw Error("goog.base called from a method of one name to a method of a different name");};goog.scope=function(a){a.call(goog.global)};var libtess={DEBUG:!1,assert:function(a,b){if(libtess.DEBUG&&!a)throw Error("Assertion failed"+(b?": "+b:""));},sweepDebugEvent:function(a){},GLU_TESS_MAX_COORD:1E150,TRUE_PROJECT:!1,TESS_MAX_CACHE:100,GLU_TESS_DEFAULT_TOLERANCE:0,tessState:{T_DORMANT:0,T_IN_POLYGON:1,T_IN_CONTOUR:2},windingRule:{GLU_TESS_WINDING_ODD:100130,GLU_TESS_WINDING_NONZERO:100131,GLU_TESS_WINDING_POSITIVE:100132,GLU_TESS_WINDING_NEGATIVE:100133,GLU_TESS_WINDING_ABS_GEQ_TWO:100134},primitiveType:{GL_LINE_LOOP:2,GL_TRIANGLES:4,
|
|
GL_TRIANGLE_STRIP:5,GL_TRIANGLE_FAN:6},errorType:{GLU_TESS_MISSING_BEGIN_POLYGON:100151,GLU_TESS_MISSING_END_POLYGON:100153,GLU_TESS_MISSING_BEGIN_CONTOUR:100152,GLU_TESS_MISSING_END_CONTOUR:100154,GLU_TESS_COORD_TOO_LARGE:100155,GLU_TESS_NEED_COMBINE_CALLBACK:100156},gluEnum:{GLU_TESS_MESH:100112,GLU_TESS_TOLERANCE:100142,GLU_TESS_WINDING_RULE:100140,GLU_TESS_BOUNDARY_ONLY:100141,GLU_INVALID_ENUM:100900,GLU_INVALID_VALUE:100901,GLU_TESS_BEGIN:100100,GLU_TESS_VERTEX:100101,GLU_TESS_END:100102,GLU_TESS_ERROR:100103,
|
|
GLU_TESS_EDGE_FLAG:100104,GLU_TESS_COMBINE:100105,GLU_TESS_BEGIN_DATA:100106,GLU_TESS_VERTEX_DATA:100107,GLU_TESS_END_DATA:100108,GLU_TESS_ERROR_DATA:100109,GLU_TESS_EDGE_FLAG_DATA:100110,GLU_TESS_COMBINE_DATA:100111}};libtess.DictNode=function(){this.prev=this.next=this.key=null};libtess.DictNode.prototype.getKey=function(){return this.key};libtess.DictNode.prototype.getSucc=function(){return this.next};libtess.DictNode.prototype.getPred=function(){return this.prev};libtess.ActiveRegion=function(){this.nodeUp=this.eUp=null;this.windingNumber=0;this.fixUpperEdge=this.dirty=this.sentinel=this.inside=!1};libtess.ActiveRegion.prototype.regionBelow=function(){return this.nodeUp.getPred().getKey()};libtess.ActiveRegion.prototype.regionAbove=function(){return this.nodeUp.getSucc().getKey()};libtess.CachedVertex=function(){this.coords=[0,0,0];this.data=null};libtess.Dict=function(a,b){this.head=new libtess.DictNode;this.head.next=this.head;this.head.prev=this.head;this.frame=a;this.leq_=b};libtess.Dict.prototype.deleteDict=function(){};libtess.Dict.prototype.insertBefore=function(a,b){do a=a.prev;while(null!==a.key&&!this.leq_(this.frame,a.key,b));var c=new libtess.DictNode;c.key=b;c.next=a.next;a.next.prev=c;c.prev=a;return a.next=c};libtess.Dict.prototype.insert=function(a){return this.insertBefore(this.head,a)};
|
|
libtess.Dict.prototype.deleteNode=function(a){a.next.prev=a.prev;a.prev.next=a.next};libtess.Dict.prototype.search=function(a){var b=this.head;do b=b.next;while(null!==b.key&&!this.leq_(this.frame,a,b.key));return b};libtess.Dict.prototype.getMin=function(){return this.head.next};libtess.Dict.prototype.getMax=function(){return this.head.prev};libtess.FaceCount=function(a,b,c){this.size=a;this.eStart=b;this.render=c};libtess.GluFace=function(a,b){this.next=a||this;this.prev=b||this;this.trail=this.data=this.anEdge=null;this.inside=this.marked=!1};libtess.GluHalfEdge=function(a){this.next=a||this;this.activeRegion=this.lFace=this.org=this.lNext=this.oNext=this.sym=null;this.winding=0};libtess.GluHalfEdge.prototype.rFace=function(){return this.sym.lFace};libtess.GluHalfEdge.prototype.dst=function(){return this.sym.org};libtess.GluHalfEdge.prototype.oPrev=function(){return this.sym.lNext};libtess.GluHalfEdge.prototype.lPrev=function(){return this.oNext.sym};libtess.GluHalfEdge.prototype.dPrev=function(){return this.lNext.sym};
|
|
libtess.GluHalfEdge.prototype.rPrev=function(){return this.sym.oNext};libtess.GluHalfEdge.prototype.dNext=function(){return this.rPrev().sym};libtess.GluHalfEdge.prototype.rNext=function(){return this.oPrev().sym};libtess.GluVertex=function(a,b){this.next=a||this;this.prev=b||this;this.data=this.anEdge=null;this.coords=[0,0,0];this.t=this.s=0;this.pqHandle=null};libtess.GluMesh=function(){this.vHead=new libtess.GluVertex;this.fHead=new libtess.GluFace;this.eHead=new libtess.GluHalfEdge;this.eHeadSym=new libtess.GluHalfEdge;this.eHead.sym=this.eHeadSym;this.eHeadSym.sym=this.eHead};
|
|
libtess.GluMesh.prototype.checkMesh=function(){if(libtess.DEBUG){var a=this.fHead,b=this.vHead,c=this.eHead,d,e;for(d=d=a;(e=d.next)!==a;d=e){libtess.assert(e.prev===d);d=e.anEdge;do libtess.assert(d.sym!==d),libtess.assert(d.sym.sym===d),libtess.assert(d.lNext.oNext.sym===d),libtess.assert(d.oNext.sym.lNext===d),libtess.assert(d.lFace===e),d=d.lNext;while(d!==e.anEdge)}libtess.assert(e.prev===d&&null===e.anEdge&&null===e.data);for(d=d=b;(a=d.next)!==b;d=a){libtess.assert(a.prev===d);d=a.anEdge;do libtess.assert(d.sym!==
|
|
d),libtess.assert(d.sym.sym===d),libtess.assert(d.lNext.oNext.sym===d),libtess.assert(d.oNext.sym.lNext===d),libtess.assert(d.org===a),d=d.oNext;while(d!==a.anEdge)}libtess.assert(a.prev===d&&null===a.anEdge&&null===a.data);for(b=b=c;(d=b.next)!==c;b=d)libtess.assert(d.sym.next===b.sym),libtess.assert(d.sym!==d),libtess.assert(d.sym.sym===d),libtess.assert(null!==d.org),libtess.assert(null!==d.dst()),libtess.assert(d.lNext.oNext.sym===d),libtess.assert(d.oNext.sym.lNext===d);libtess.assert(d.sym.next===
|
|
b.sym&&d.sym===this.eHeadSym&&d.sym.sym===d&&null===d.org&&null===d.dst()&&null===d.lFace&&null===d.rFace())}};libtess.mesh={};libtess.mesh.makeEdge=function(a){var b=libtess.mesh.makeEdgePair_(a.eHead);libtess.mesh.makeVertex_(b,a.vHead);libtess.mesh.makeVertex_(b.sym,a.vHead);libtess.mesh.makeFace_(b,a.fHead);return b};
|
|
libtess.mesh.meshSplice=function(a,b){var c=!1,d=!1;a!==b&&(b.org!==a.org&&(d=!0,libtess.mesh.killVertex_(b.org,a.org)),b.lFace!==a.lFace&&(c=!0,libtess.mesh.killFace_(b.lFace,a.lFace)),libtess.mesh.splice_(b,a),d||(libtess.mesh.makeVertex_(b,a.org),a.org.anEdge=a),c||(libtess.mesh.makeFace_(b,a.lFace),a.lFace.anEdge=a))};
|
|
libtess.mesh.deleteEdge=function(a){var b=a.sym,c=!1;a.lFace!==a.rFace()&&(c=!0,libtess.mesh.killFace_(a.lFace,a.rFace()));a.oNext===a?libtess.mesh.killVertex_(a.org,null):(a.rFace().anEdge=a.oPrev(),a.org.anEdge=a.oNext,libtess.mesh.splice_(a,a.oPrev()),c||libtess.mesh.makeFace_(a,a.lFace));b.oNext===b?(libtess.mesh.killVertex_(b.org,null),libtess.mesh.killFace_(b.lFace,null)):(a.lFace.anEdge=b.oPrev(),b.org.anEdge=b.oNext,libtess.mesh.splice_(b,b.oPrev()));libtess.mesh.killEdge_(a)};
|
|
libtess.mesh.addEdgeVertex=function(a){var b=libtess.mesh.makeEdgePair_(a),c=b.sym;libtess.mesh.splice_(b,a.lNext);b.org=a.dst();libtess.mesh.makeVertex_(c,b.org);b.lFace=c.lFace=a.lFace;return b};libtess.mesh.splitEdge=function(a){var b=libtess.mesh.addEdgeVertex(a).sym;libtess.mesh.splice_(a.sym,a.sym.oPrev());libtess.mesh.splice_(a.sym,b);a.sym.org=b.org;b.dst().anEdge=b.sym;b.sym.lFace=a.rFace();b.winding=a.winding;b.sym.winding=a.sym.winding;return b};
|
|
libtess.mesh.connect=function(a,b){var c=!1,d=libtess.mesh.makeEdgePair_(a),e=d.sym;b.lFace!==a.lFace&&(c=!0,libtess.mesh.killFace_(b.lFace,a.lFace));libtess.mesh.splice_(d,a.lNext);libtess.mesh.splice_(e,b);d.org=a.dst();e.org=b.org;d.lFace=e.lFace=a.lFace;a.lFace.anEdge=e;c||libtess.mesh.makeFace_(d,a.lFace);return d};
|
|
libtess.mesh.zapFace=function(a){var b=a.anEdge,c=b.lNext,d;do if(d=c,c=d.lNext,d.lFace=null,null===d.rFace()){d.oNext===d?libtess.mesh.killVertex_(d.org,null):(d.org.anEdge=d.oNext,libtess.mesh.splice_(d,d.oPrev()));var e=d.sym;e.oNext===e?libtess.mesh.killVertex_(e.org,null):(e.org.anEdge=e.oNext,libtess.mesh.splice_(e,e.oPrev()));libtess.mesh.killEdge_(d)}while(d!==b);b=a.prev;a=a.next;a.prev=b;b.next=a};
|
|
libtess.mesh.meshUnion=function(a,b){var c=a.fHead,d=a.vHead,e=a.eHead,f=b.fHead,g=b.vHead,h=b.eHead;f.next!==f&&(c.prev.next=f.next,f.next.prev=c.prev,f.prev.next=c,c.prev=f.prev);g.next!==g&&(d.prev.next=g.next,g.next.prev=d.prev,g.prev.next=d,d.prev=g.prev);h.next!==h&&(e.sym.next.sym.next=h.next,h.next.sym.next=e.sym.next,h.sym.next.sym.next=e,e.sym.next=h.sym.next);return a};libtess.mesh.deleteMesh=function(a){};
|
|
libtess.mesh.makeEdgePair_=function(a){var b=new libtess.GluHalfEdge,c=new libtess.GluHalfEdge,d=a.sym.next;c.next=d;d.sym.next=b;b.next=a;a.sym.next=c;b.sym=c;b.oNext=b;b.lNext=c;c.sym=b;c.oNext=c;return c.lNext=b};libtess.mesh.splice_=function(a,b){var c=a.oNext,d=b.oNext;c.sym.lNext=b;d.sym.lNext=a;a.oNext=d;b.oNext=c};libtess.mesh.makeVertex_=function(a,b){var c=b.prev,d=new libtess.GluVertex(b,c);c.next=d;b.prev=d;c=d.anEdge=a;do c.org=d,c=c.oNext;while(c!==a)};
|
|
libtess.mesh.makeFace_=function(a,b){var c=b.prev,d=new libtess.GluFace(b,c);c.next=d;b.prev=d;d.anEdge=a;d.inside=b.inside;c=a;do c.lFace=d,c=c.lNext;while(c!==a)};libtess.mesh.killEdge_=function(a){var b=a.next;a=a.sym.next;b.sym.next=a;a.sym.next=b};libtess.mesh.killVertex_=function(a,b){var c=a.anEdge,d=c;do d.org=b,d=d.oNext;while(d!==c);c=a.prev;d=a.next;d.prev=c;c.next=d};
|
|
libtess.mesh.killFace_=function(a,b){var c=a.anEdge,d=c;do d.lFace=b,d=d.lNext;while(d!==c);c=a.prev;d=a.next;d.prev=c;c.next=d};libtess.normal={};libtess.normal.S_UNIT_X_=1;libtess.normal.S_UNIT_Y_=0;
|
|
libtess.normal.projectPolygon=function(a){var b=!1,c=[0,0,0];c[0]=a.normal[0];c[1]=a.normal[1];c[2]=a.normal[2];0===c[0]&&(0===c[1]&&0===c[2])&&(libtess.normal.computeNormal_(a,c),b=!0);var d=a.sUnit,e=a.tUnit,f=libtess.normal.longAxis_(c);libtess.TRUE_PROJECT?(libtess.normal.normalize_(c),d[f]=0,d[(f+1)%3]=libtess.normal.S_UNIT_X_,d[(f+2)%3]=libtess.normal.S_UNIT_Y_,f=libtess.normal.dot_(d,c),d[0]-=f*c[0],d[1]-=f*c[1],d[2]-=f*c[2],libtess.normal.normalize_(d),e[0]=c[1]*d[2]-c[2]*d[1],e[1]=c[2]*d[0]-
|
|
c[0]*d[2],e[2]=c[0]*d[1]-c[1]*d[0],libtess.normal.normalize_(e)):(d[f]=0,d[(f+1)%3]=libtess.normal.S_UNIT_X_,d[(f+2)%3]=libtess.normal.S_UNIT_Y_,e[f]=0,e[(f+1)%3]=0<c[f]?-libtess.normal.S_UNIT_Y_:libtess.normal.S_UNIT_Y_,e[(f+2)%3]=0<c[f]?libtess.normal.S_UNIT_X_:-libtess.normal.S_UNIT_X_);c=a.mesh.vHead;for(f=c.next;f!==c;f=f.next)f.s=libtess.normal.dot_(f.coords,d),f.t=libtess.normal.dot_(f.coords,e);b&&libtess.normal.checkOrientation_(a)};
|
|
libtess.normal.dot_=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]};libtess.normal.normalize_=function(a){var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];libtess.assert(0<b);b=Math.sqrt(b);a[0]/=b;a[1]/=b;a[2]/=b};libtess.normal.longAxis_=function(a){var b=0;Math.abs(a[1])>Math.abs(a[0])&&(b=1);Math.abs(a[2])>Math.abs(a[b])&&(b=2);return b};
|
|
libtess.normal.computeNormal_=function(a,b){var c=[0,0,0],d=[0,0,0],e=[0,0,0],f=[0,0,0],g=[0,0,0];c[0]=c[1]=c[2]=-2*libtess.GLU_TESS_MAX_COORD;d[0]=d[1]=d[2]=2*libtess.GLU_TESS_MAX_COORD;var h=Array(3),k=Array(3),l,m,n=a.mesh.vHead;for(m=n.next;m!==n;m=m.next)for(l=0;3>l;++l){var p=m.coords[l];p<d[l]&&(d[l]=p,k[l]=m);p>c[l]&&(c[l]=p,h[l]=m)}l=0;c[1]-d[1]>c[0]-d[0]&&(l=1);c[2]-d[2]>c[l]-d[l]&&(l=2);if(d[l]>=c[l])b[0]=0,b[1]=0,b[2]=1;else{c=0;m=k[l];h=h[l];e[0]=m.coords[0]-h.coords[0];e[1]=m.coords[1]-
|
|
h.coords[1];e[2]=m.coords[2]-h.coords[2];for(m=n.next;m!==n;m=m.next)f[0]=m.coords[0]-h.coords[0],f[1]=m.coords[1]-h.coords[1],f[2]=m.coords[2]-h.coords[2],g[0]=e[1]*f[2]-e[2]*f[1],g[1]=e[2]*f[0]-e[0]*f[2],g[2]=e[0]*f[1]-e[1]*f[0],l=g[0]*g[0]+g[1]*g[1]+g[2]*g[2],l>c&&(c=l,b[0]=g[0],b[1]=g[1],b[2]=g[2]);0>=c&&(b[0]=b[1]=b[2]=0,b[libtess.normal.longAxis_(e)]=1)}};
|
|
libtess.normal.checkOrientation_=function(a){for(var b=0,c=a.mesh.fHead,d=c.next;d!==c;d=d.next){var e=d.anEdge;if(!(0>=e.winding)){do b+=(e.org.s-e.dst().s)*(e.org.t+e.dst().t),e=e.lNext;while(e!==d.anEdge)}}if(0>b){b=a.mesh.vHead;for(c=b.next;c!==b;c=c.next)c.t=-c.t;a.tUnit[0]=-a.tUnit[0];a.tUnit[1]=-a.tUnit[1];a.tUnit[2]=-a.tUnit[2]}};libtess.render={};libtess.render.SIGN_INCONSISTENT_=2;libtess.render.renderMesh=function(a,b){a.lonelyTriList=null;var c;for(c=b.fHead.next;c!==b.fHead;c=c.next)c.marked=!1;for(c=b.fHead.next;c!==b.fHead;c=c.next)c.inside&&!c.marked&&(libtess.render.renderMaximumFaceGroup_(a,c),libtess.assert(c.marked));null!==a.lonelyTriList&&(libtess.render.renderLonelyTriangles_(a,a.lonelyTriList),a.lonelyTriList=null)};
|
|
libtess.render.renderBoundary=function(a,b){for(var c=b.fHead.next;c!==b.fHead;c=c.next)if(c.inside){a.callBeginOrBeginData(libtess.primitiveType.GL_LINE_LOOP);var d=c.anEdge;do a.callVertexOrVertexData(d.org.data),d=d.lNext;while(d!==c.anEdge);a.callEndOrEndData()}};
|
|
libtess.render.renderCache=function(a){if(3>a.cacheCount)return!0;var b=[0,0,0];b[0]=a.normal[0];b[1]=a.normal[1];b[2]=a.normal[2];0===b[0]&&(0===b[1]&&0===b[2])&&libtess.render.computeNormal_(a,b,!1);var c=libtess.render.computeNormal_(a,b,!0);if(c===libtess.render.SIGN_INCONSISTENT_)return!1;if(0===c)return!0;switch(a.windingRule){case libtess.windingRule.GLU_TESS_WINDING_POSITIVE:if(0>c)return!0;break;case libtess.windingRule.GLU_TESS_WINDING_NEGATIVE:if(0<c)return!0;break;case libtess.windingRule.GLU_TESS_WINDING_ABS_GEQ_TWO:return!0}a.callBeginOrBeginData(a.boundaryOnly?
|
|
libtess.primitiveType.GL_LINE_LOOP:3<a.cacheCount?libtess.primitiveType.GL_TRIANGLE_FAN:libtess.primitiveType.GL_TRIANGLES);b=0+a.cacheCount;a.callVertexOrVertexData(a.cache[0].data);if(0<c)for(c=1;c<b;++c)a.callVertexOrVertexData(a.cache[c].data);else for(c=b-1;0<c;--c)a.callVertexOrVertexData(a.cache[c].data);a.callEndOrEndData();return!0};libtess.render.marked_=function(a){return!a.inside||a.marked};libtess.render.freeTrail_=function(a){for(;null!==a;)a.marked=!1,a=a.trail};
|
|
libtess.render.maximumFan_=function(a){var b=new libtess.FaceCount(0,null,libtess.render.renderFan_),c=null,d;for(d=a;!libtess.render.marked_(d.lFace);d=d.oNext)d.lFace.trail=c,c=d.lFace,d.lFace.marked=!0,++b.size;for(d=a;!libtess.render.marked_(d.rFace());d=d.oPrev())d.rFace().trail=c,c=d.rFace(),d.rFace().marked=!0,++b.size;b.eStart=d;libtess.render.freeTrail_(c);return b};
|
|
libtess.render.maximumStrip_=function(a){var b=new libtess.FaceCount(0,null,libtess.render.renderStrip_),c=0,d=0,e=null,f,g;for(f=a;!libtess.render.marked_(f.lFace);++d,f=f.oNext){f.lFace.trail=e;e=f.lFace;f.lFace.marked=!0;++d;f=f.dPrev();if(libtess.render.marked_(f.lFace))break;f.lFace.trail=e;e=f.lFace;f.lFace.marked=!0}g=f;for(f=a;!libtess.render.marked_(f.rFace());++c,f=f.dNext()){f.rFace().trail=e;e=f.rFace();f.rFace().marked=!0;++c;f=f.oPrev();if(libtess.render.marked_(f.rFace()))break;f.rFace().trail=
|
|
e;e=f.rFace();f.rFace().marked=!0}a=f;b.size=d+c;0===(d&1)?b.eStart=g.sym:0===(c&1)?b.eStart=a:(--b.size,b.eStart=a.oNext);libtess.render.freeTrail_(e);return b};libtess.render.renderFan_=function(a,b,c){a.callBeginOrBeginData(libtess.primitiveType.GL_TRIANGLE_FAN);a.callVertexOrVertexData(b.org.data);for(a.callVertexOrVertexData(b.dst().data);!libtess.render.marked_(b.lFace);)b.lFace.marked=!0,--c,b=b.oNext,a.callVertexOrVertexData(b.dst().data);libtess.assert(0===c);a.callEndOrEndData()};
|
|
libtess.render.renderStrip_=function(a,b,c){a.callBeginOrBeginData(libtess.primitiveType.GL_TRIANGLE_STRIP);a.callVertexOrVertexData(b.org.data);for(a.callVertexOrVertexData(b.dst().data);!libtess.render.marked_(b.lFace);){b.lFace.marked=!0;--c;b=b.dPrev();a.callVertexOrVertexData(b.org.data);if(libtess.render.marked_(b.lFace))break;b.lFace.marked=!0;--c;b=b.oNext;a.callVertexOrVertexData(b.dst().data)}libtess.assert(0===c);a.callEndOrEndData()};
|
|
libtess.render.renderTriangle_=function(a,b,c){libtess.assert(1===c);b.lFace.trail=a.lonelyTriList;a.lonelyTriList=b.lFace;b.lFace.marked=!0};
|
|
libtess.render.renderMaximumFaceGroup_=function(a,b){var c=b.anEdge,d=new libtess.FaceCount(1,c,libtess.render.renderTriangle_),e;a.flagBoundary||(e=libtess.render.maximumFan_(c),e.size>d.size&&(d=e),e=libtess.render.maximumFan_(c.lNext),e.size>d.size&&(d=e),e=libtess.render.maximumFan_(c.lPrev()),e.size>d.size&&(d=e),e=libtess.render.maximumStrip_(c),e.size>d.size&&(d=e),e=libtess.render.maximumStrip_(c.lNext),e.size>d.size&&(d=e),e=libtess.render.maximumStrip_(c.lPrev()),e.size>d.size&&(d=e));d.render(a,
|
|
d.eStart,d.size)};libtess.render.renderLonelyTriangles_=function(a,b){var c=-1,d=b;for(a.callBeginOrBeginData(libtess.primitiveType.GL_TRIANGLES);null!==d;d=d.trail){var e=d.anEdge;do{if(a.flagBoundary){var f=e.rFace().inside?0:1;c!==f&&(c=f,a.callEdgeFlagOrEdgeFlagData(!!c))}a.callVertexOrVertexData(e.org.data);e=e.lNext}while(e!==d.anEdge)}a.callEndOrEndData()};
|
|
libtess.render.computeNormal_=function(a,b,c){c||(b[0]=b[1]=b[2]=0);for(var d=0+a.cacheCount,e=1,f=a.cache[0],g=a.cache[e],h=g.coords[0]-f.coords[0],k=g.coords[1]-f.coords[1],l=g.coords[2]-f.coords[2],m=0;++e<d;){var g=a.cache[e],n=h,p=k,r=l,h=g.coords[0]-f.coords[0],k=g.coords[1]-f.coords[1],l=g.coords[2]-f.coords[2],g=[0,0,0];g[0]=p*l-r*k;g[1]=r*h-n*l;g[2]=n*k-p*h;n=g[0]*b[0]+g[1]*b[1]+g[2]*b[2];if(!c)0<=n?(b[0]+=g[0],b[1]+=g[1],b[2]+=g[2]):(b[0]-=g[0],b[1]-=g[1],b[2]-=g[2]);else if(0!==n)if(0<
|
|
n){if(0>m)return libtess.render.SIGN_INCONSISTENT_;m=1}else{if(0<m)return libtess.render.SIGN_INCONSISTENT_;m=-1}}return m};libtess.PQHandleElem=function(){this.key=null;this.node=0};libtess.PQHandleElem.realloc=function(a,b){var c=Array(b),d=0;if(null!==a)for(;d<a.length;d++)c[d]=a[d];for(;d<b;d++)c[d]=new libtess.PQHandleElem;return c};libtess.PQNode=function(){this.handle=0};libtess.PQNode.realloc=function(a,b){var c=Array(b),d=0;if(null!==a)for(;d<a.length;d++)c[d]=a[d];for(;d<b;d++)c[d]=new libtess.PQNode;return c};libtess.PriorityQHeap=function(a){this.nodes_=libtess.PQNode.realloc(null,libtess.PriorityQHeap.INIT_SIZE_+1);this.handles_=libtess.PQHandleElem.realloc(null,libtess.PriorityQHeap.INIT_SIZE_+1);this.size_=0;this.max_=libtess.PriorityQHeap.INIT_SIZE_;this.freeList_=0;this.initialized_=!1;this.leq_=a;this.nodes_[1].handle=1};libtess.PriorityQHeap.INIT_SIZE_=32;libtess.PriorityQHeap.prototype.deleteHeap=function(){this.nodes_=this.handles_=null};
|
|
libtess.PriorityQHeap.prototype.init=function(){for(var a=this.size_;1<=a;--a)this.floatDown_(a);this.initialized_=!0};
|
|
libtess.PriorityQHeap.prototype.insert=function(a){var b=++this.size_;2*b>this.max_&&(this.max_*=2,this.nodes_=libtess.PQNode.realloc(this.nodes_,this.max_+1),this.handles_=libtess.PQHandleElem.realloc(this.handles_,this.max_+1));var c;0===this.freeList_?c=b:(c=this.freeList_,this.freeList_=this.handles_[c].node);this.nodes_[b].handle=c;this.handles_[c].node=b;this.handles_[c].key=a;this.initialized_&&this.floatUp_(b);return c};libtess.PriorityQHeap.prototype.isEmpty=function(){return 0===this.size_};
|
|
libtess.PriorityQHeap.prototype.minimum=function(){return this.handles_[this.nodes_[1].handle].key};libtess.PriorityQHeap.prototype.extractMin=function(){var a=this.nodes_,b=this.handles_,c=a[1].handle,d=b[c].key;0<this.size_&&(a[1].handle=a[this.size_].handle,b[a[1].handle].node=1,b[c].key=null,b[c].node=this.freeList_,this.freeList_=c,0<--this.size_&&this.floatDown_(1));return d};
|
|
libtess.PriorityQHeap.prototype.remove=function(a){var b=this.nodes_,c=this.handles_;libtess.assert(1<=a&&a<=this.max_&&null!==c[a].key);var d=c[a].node;b[d].handle=b[this.size_].handle;c[b[d].handle].node=d;d<=--this.size_&&(1>=d||this.leq_(c[b[d>>1].handle].key,c[b[d].handle].key)?this.floatDown_(d):this.floatUp_(d));c[a].key=null;c[a].node=this.freeList_;this.freeList_=a};
|
|
libtess.PriorityQHeap.prototype.floatDown_=function(a){for(var b=this.nodes_,c=this.handles_,d=b[a].handle;;){var e=a<<1;e<this.size_&&this.leq_(c[b[e+1].handle].key,c[b[e].handle].key)&&++e;libtess.assert(e<=this.max_);var f=b[e].handle;if(e>this.size_||this.leq_(c[d].key,c[f].key)){b[a].handle=d;c[d].node=a;break}b[a].handle=f;c[f].node=a;a=e}};
|
|
libtess.PriorityQHeap.prototype.floatUp_=function(a){for(var b=this.nodes_,c=this.handles_,d=b[a].handle;;){var e=a>>1,f=b[e].handle;if(0===e||this.leq_(c[f].key,c[d].key)){b[a].handle=d;c[d].node=a;break}b[a].handle=f;c[f].node=a;a=e}};libtess.PriorityQ=function(a){this.keys_=libtess.PriorityQ.prototype.PQKeyRealloc_(null,libtess.PriorityQ.INIT_SIZE_);this.order_=null;this.size_=0;this.max_=libtess.PriorityQ.INIT_SIZE_;this.initialized_=!1;this.leq_=a;this.heap_=new libtess.PriorityQHeap(this.leq_)};libtess.PriorityQ.INIT_SIZE_=32;libtess.PriorityQ.prototype.deleteQ=function(){this.heap_.deleteHeap();this.keys_=this.order_=this.heap_=null};
|
|
libtess.PriorityQ.prototype.init=function(){this.order_=[];for(var a=0;a<this.size_;a++)this.order_[a]=a;a=function(a,b){return function(e,f){return b(a[e],a[f])?1:-1}}(this.keys_,this.leq_);this.order_.sort(a);this.max_=this.size_;this.initialized_=!0;this.heap_.init();if(libtess.DEBUG)for(var b=0+this.size_-1,a=0;a<b;++a)libtess.assert(this.leq_(this.keys_[this.order_[a+1]],this.keys_[this.order_[a]]))};
|
|
libtess.PriorityQ.prototype.insert=function(a){if(this.initialized_)return this.heap_.insert(a);var b=this.size_;++this.size_>=this.max_&&(this.max_*=2,this.keys_=libtess.PriorityQ.prototype.PQKeyRealloc_(this.keys_,this.max_));this.keys_[b]=a;return-(b+1)};libtess.PriorityQ.prototype.PQKeyRealloc_=function(a,b){var c=Array(b),d=0;if(null!==a)for(;d<a.length;d++)c[d]=a[d];for(;d<b;d++)c[d]=null;return c};libtess.PriorityQ.prototype.keyLessThan_=function(a,b){return!this.leq_(this.keys_[b],this.keys_[a])};
|
|
libtess.PriorityQ.prototype.keyGreaterThan_=function(a,b){return!this.leq_(this.keys_[a],this.keys_[b])};libtess.PriorityQ.prototype.extractMin=function(){if(0===this.size_)return this.heap_.extractMin();var a=this.keys_[this.order_[this.size_-1]];if(!this.heap_.isEmpty()){var b=this.heap_.minimum();if(this.leq_(b,a))return this.heap_.extractMin()}do--this.size_;while(0<this.size_&&null===this.keys_[this.order_[this.size_-1]]);return a};
|
|
libtess.PriorityQ.prototype.minimum=function(){if(0===this.size_)return this.heap_.minimum();var a=this.keys_[this.order_[this.size_-1]];if(!this.heap_.isEmpty()){var b=this.heap_.minimum();if(this.leq_(b,a))return b}return a};libtess.PriorityQ.prototype.isEmpty=function(){return 0===this.size_&&this.heap_.isEmpty()};
|
|
libtess.PriorityQ.prototype.remove=function(a){if(0<=a)this.heap_.remove(a);else for(a=-(a+1),libtess.assert(a<this.max_&&null!==this.keys_[a]),this.keys_[a]=null;0<this.size_&&null===this.keys_[this.order_[this.size_-1]];)--this.size_};libtess.geom={};libtess.geom.vertEq=function(a,b){return a.s===b.s&&a.t===b.t};libtess.geom.vertLeq=function(a,b){return a.s<b.s||a.s===b.s&&a.t<=b.t};libtess.geom.edgeEval=function(a,b,c){var d,e;libtess.assert(libtess.geom.vertLeq(a,b)&&libtess.geom.vertLeq(b,c));d=b.s-a.s;e=c.s-b.s;return 0<d+e?d<e?b.t-a.t+(a.t-c.t)*(d/(d+e)):b.t-c.t+(c.t-a.t)*(e/(d+e)):0};
|
|
libtess.geom.edgeSign=function(a,b,c){var d,e;libtess.assert(libtess.geom.vertLeq(a,b)&&libtess.geom.vertLeq(b,c));d=b.s-a.s;e=c.s-b.s;return 0<d+e?(b.t-c.t)*d+(b.t-a.t)*e:0};libtess.geom.transLeq=function(a,b){return a.t<b.t||a.t===b.t&&a.s<=b.s};libtess.geom.transEval=function(a,b,c){var d,e;libtess.assert(libtess.geom.transLeq(a,b)&&libtess.geom.transLeq(b,c));d=b.t-a.t;e=c.t-b.t;return 0<d+e?d<e?b.s-a.s+(a.s-c.s)*(d/(d+e)):b.s-c.s+(c.s-a.s)*(e/(d+e)):0};
|
|
libtess.geom.transSign=function(a,b,c){var d,e;libtess.assert(libtess.geom.transLeq(a,b)&&libtess.geom.transLeq(b,c));d=b.t-a.t;e=c.t-b.t;return 0<d+e?(b.s-c.s)*d+(b.s-a.s)*e:0};libtess.geom.edgeGoesLeft=function(a){return libtess.geom.vertLeq(a.dst(),a.org)};libtess.geom.edgeGoesRight=function(a){return libtess.geom.vertLeq(a.org,a.dst())};libtess.geom.vertL1dist=function(a,b){return Math.abs(a.s-b.s)+Math.abs(a.t-b.t)};
|
|
libtess.geom.vertCCW=function(a,b,c){return 0<=a.s*(b.t-c.t)+b.s*(c.t-a.t)+c.s*(a.t-b.t)};libtess.geom.interpolate_=function(a,b,c,d){a=0>a?0:a;c=0>c?0:c;return a<=c?0===c?(b+d)/2:b+(d-b)*(a/(a+c)):d+(b-d)*(c/(a+c))};
|
|
libtess.geom.edgeIntersect=function(a,b,c,d,e){var f,g;libtess.geom.vertLeq(a,b)||(f=a,a=b,b=f);libtess.geom.vertLeq(c,d)||(f=c,c=d,d=f);libtess.geom.vertLeq(a,c)||(f=a,a=c,c=f,f=b,b=d,d=f);libtess.geom.vertLeq(c,b)?libtess.geom.vertLeq(b,d)?(f=libtess.geom.edgeEval(a,c,b),g=libtess.geom.edgeEval(c,b,d),0>f+g&&(f=-f,g=-g),e.s=libtess.geom.interpolate_(f,c.s,g,b.s)):(f=libtess.geom.edgeSign(a,c,b),g=-libtess.geom.edgeSign(a,d,b),0>f+g&&(f=-f,g=-g),e.s=libtess.geom.interpolate_(f,c.s,g,d.s)):e.s=(c.s+
|
|
b.s)/2;libtess.geom.transLeq(a,b)||(f=a,a=b,b=f);libtess.geom.transLeq(c,d)||(f=c,c=d,d=f);libtess.geom.transLeq(a,c)||(f=a,a=c,c=f,f=b,b=d,d=f);libtess.geom.transLeq(c,b)?libtess.geom.transLeq(b,d)?(f=libtess.geom.transEval(a,c,b),g=libtess.geom.transEval(c,b,d),0>f+g&&(f=-f,g=-g),e.t=libtess.geom.interpolate_(f,c.t,g,b.t)):(f=libtess.geom.transSign(a,c,b),g=-libtess.geom.transSign(a,d,b),0>f+g&&(f=-f,g=-g),e.t=libtess.geom.interpolate_(f,c.t,g,d.t)):e.t=(c.t+b.t)/2};libtess.sweep={};libtess.sweep.SENTINEL_COORD_=4*libtess.GLU_TESS_MAX_COORD;libtess.sweep.TOLERANCE_NONZERO_=!1;
|
|
libtess.sweep.computeInterior=function(a){a.fatalError=!1;libtess.sweep.removeDegenerateEdges_(a);libtess.sweep.initPriorityQ_(a);libtess.sweep.initEdgeDict_(a);for(var b;null!==(b=a.pq.extractMin());){for(;;){var c=a.pq.minimum();if(null===c||!libtess.geom.vertEq(c,b))break;c=a.pq.extractMin();libtess.sweep.spliceMergeVertices_(a,b.anEdge,c.anEdge)}libtess.sweep.sweepEvent_(a,b)}b=a.dict.getMin().getKey();a.event=b.eUp.org;libtess.sweepDebugEvent(a);libtess.sweep.doneEdgeDict_(a);libtess.sweep.donePriorityQ_(a);
|
|
libtess.sweep.removeDegenerateFaces_(a.mesh);a.mesh.checkMesh()};libtess.sweep.addWinding_=function(a,b){a.winding+=b.winding;a.sym.winding+=b.sym.winding};
|
|
libtess.sweep.edgeLeq_=function(a,b,c){a=a.event;b=b.eUp;c=c.eUp;if(b.dst()===a)return c.dst()===a?libtess.geom.vertLeq(b.org,c.org)?0>=libtess.geom.edgeSign(c.dst(),b.org,c.org):0<=libtess.geom.edgeSign(b.dst(),c.org,b.org):0>=libtess.geom.edgeSign(c.dst(),a,c.org);if(c.dst()===a)return 0<=libtess.geom.edgeSign(b.dst(),a,b.org);b=libtess.geom.edgeEval(b.dst(),a,b.org);a=libtess.geom.edgeEval(c.dst(),a,c.org);return b>=a};
|
|
libtess.sweep.deleteRegion_=function(a,b){b.fixUpperEdge&&libtess.assert(0===b.eUp.winding);b.eUp.activeRegion=null;a.dict.deleteNode(b.nodeUp);b.nodeUp=null};libtess.sweep.fixUpperEdge_=function(a,b){libtess.assert(a.fixUpperEdge);libtess.mesh.deleteEdge(a.eUp);a.fixUpperEdge=!1;a.eUp=b;b.activeRegion=a};
|
|
libtess.sweep.topLeftRegion_=function(a){var b=a.eUp.org;do a=a.regionAbove();while(a.eUp.org===b);a.fixUpperEdge&&(b=libtess.mesh.connect(a.regionBelow().eUp.sym,a.eUp.lNext),libtess.sweep.fixUpperEdge_(a,b),a=a.regionAbove());return a};libtess.sweep.topRightRegion_=function(a){var b=a.eUp.dst();do a=a.regionAbove();while(a.eUp.dst()===b);return a};libtess.sweep.addRegionBelow_=function(a,b,c){var d=new libtess.ActiveRegion;d.eUp=c;d.nodeUp=a.dict.insertBefore(b.nodeUp,d);return c.activeRegion=d};
|
|
libtess.sweep.isWindingInside_=function(a,b){switch(a.windingRule){case libtess.windingRule.GLU_TESS_WINDING_ODD:return 0!==(b&1);case libtess.windingRule.GLU_TESS_WINDING_NONZERO:return 0!==b;case libtess.windingRule.GLU_TESS_WINDING_POSITIVE:return 0<b;case libtess.windingRule.GLU_TESS_WINDING_NEGATIVE:return 0>b;case libtess.windingRule.GLU_TESS_WINDING_ABS_GEQ_TWO:return 2<=b||-2>=b}libtess.assert(!1);return!1};
|
|
libtess.sweep.computeWinding_=function(a,b){b.windingNumber=b.regionAbove().windingNumber+b.eUp.winding;b.inside=libtess.sweep.isWindingInside_(a,b.windingNumber)};libtess.sweep.finishRegion_=function(a,b){var c=b.eUp,d=c.lFace;d.inside=b.inside;d.anEdge=c;libtess.sweep.deleteRegion_(a,b)};
|
|
libtess.sweep.finishLeftRegions_=function(a,b,c){var d=b;for(b=b.eUp;d!==c;){d.fixUpperEdge=!1;var e=d.regionBelow(),f=e.eUp;if(f.org!==b.org){if(!e.fixUpperEdge){libtess.sweep.finishRegion_(a,d);break}f=libtess.mesh.connect(b.lPrev(),f.sym);libtess.sweep.fixUpperEdge_(e,f)}b.oNext!==f&&(libtess.mesh.meshSplice(f.oPrev(),f),libtess.mesh.meshSplice(b,f));libtess.sweep.finishRegion_(a,d);b=e.eUp;d=e}return b};
|
|
libtess.sweep.addRightEdges_=function(a,b,c,d,e,f){var g=!0;do libtess.assert(libtess.geom.vertLeq(c.org,c.dst())),libtess.sweep.addRegionBelow_(a,b,c.sym),c=c.oNext;while(c!==d);null===e&&(e=b.regionBelow().eUp.rPrev());for(var h;;){h=b.regionBelow();c=h.eUp.sym;if(c.org!==e.org)break;c.oNext!==e&&(libtess.mesh.meshSplice(c.oPrev(),c),libtess.mesh.meshSplice(e.oPrev(),c));h.windingNumber=b.windingNumber-c.winding;h.inside=libtess.sweep.isWindingInside_(a,h.windingNumber);b.dirty=!0;!g&&libtess.sweep.checkForRightSplice_(a,
|
|
b)&&(libtess.sweep.addWinding_(c,e),libtess.sweep.deleteRegion_(a,b),libtess.mesh.deleteEdge(e));g=!1;b=h;e=c}b.dirty=!0;libtess.assert(b.windingNumber-c.winding===h.windingNumber);f&&libtess.sweep.walkDirtyRegions_(a,b)};libtess.sweep.callCombine_=function(a,b,c,d,e){var f=[b.coords[0],b.coords[1],b.coords[2]];b.data=null;b.data=a.callCombineOrCombineData(f,c,d);null===b.data&&(e?a.fatalError||(a.callErrorOrErrorData(libtess.errorType.GLU_TESS_NEED_COMBINE_CALLBACK),a.fatalError=!0):b.data=c[0])};
|
|
libtess.sweep.spliceMergeVertices_=function(a,b,c){var d=[null,null,null,null];d[0]=b.org.data;d[1]=c.org.data;libtess.sweep.callCombine_(a,b.org,d,[0.5,0.5,0,0],!1);libtess.mesh.meshSplice(b,c)};libtess.sweep.vertexWeights_=function(a,b,c,d,e){var f=libtess.geom.vertL1dist(b,a),g=libtess.geom.vertL1dist(c,a),h=e+1;d[e]=0.5*g/(f+g);d[h]=0.5*f/(f+g);a.coords[0]+=d[e]*b.coords[0]+d[h]*c.coords[0];a.coords[1]+=d[e]*b.coords[1]+d[h]*c.coords[1];a.coords[2]+=d[e]*b.coords[2]+d[h]*c.coords[2]};
|
|
libtess.sweep.getIntersectData_=function(a,b,c,d,e,f){var g=[0,0,0,0],h=[c.data,d.data,e.data,f.data];b.coords[0]=b.coords[1]=b.coords[2]=0;libtess.sweep.vertexWeights_(b,c,d,g,0);libtess.sweep.vertexWeights_(b,e,f,g,2);libtess.sweep.callCombine_(a,b,h,g,!0)};
|
|
libtess.sweep.checkForRightSplice_=function(a,b){var c=b.regionBelow(),d=b.eUp,e=c.eUp;if(libtess.geom.vertLeq(d.org,e.org)){if(0<libtess.geom.edgeSign(e.dst(),d.org,e.org))return!1;libtess.geom.vertEq(d.org,e.org)?d.org!==e.org&&(a.pq.remove(d.org.pqHandle),libtess.sweep.spliceMergeVertices_(a,e.oPrev(),d)):(libtess.mesh.splitEdge(e.sym),libtess.mesh.meshSplice(d,e.oPrev()),b.dirty=c.dirty=!0)}else{if(0>libtess.geom.edgeSign(d.dst(),e.org,d.org))return!1;b.regionAbove().dirty=b.dirty=!0;libtess.mesh.splitEdge(d.sym);
|
|
libtess.mesh.meshSplice(e.oPrev(),d)}return!0};
|
|
libtess.sweep.checkForLeftSplice_=function(a,b){var c=b.regionBelow(),d=b.eUp,e=c.eUp;libtess.assert(!libtess.geom.vertEq(d.dst(),e.dst()));if(libtess.geom.vertLeq(d.dst(),e.dst())){if(0>libtess.geom.edgeSign(d.dst(),e.dst(),d.org))return!1;b.regionAbove().dirty=b.dirty=!0;c=libtess.mesh.splitEdge(d);libtess.mesh.meshSplice(e.sym,c);c.lFace.inside=b.inside}else{if(0<libtess.geom.edgeSign(e.dst(),d.dst(),e.org))return!1;b.dirty=c.dirty=!0;c=libtess.mesh.splitEdge(e);libtess.mesh.meshSplice(d.lNext,
|
|
e.sym);c.rFace().inside=b.inside}return!0};
|
|
libtess.sweep.checkForIntersect_=function(a,b){var c=b.regionBelow(),d=b.eUp,e=c.eUp,f=d.org,g=e.org,h=d.dst(),k=e.dst(),l=new libtess.GluVertex;libtess.assert(!libtess.geom.vertEq(k,h));libtess.assert(0>=libtess.geom.edgeSign(h,a.event,f));libtess.assert(0<=libtess.geom.edgeSign(k,a.event,g));libtess.assert(f!==a.event&&g!==a.event);libtess.assert(!b.fixUpperEdge&&!c.fixUpperEdge);if(f===g)return!1;var m=Math.min(f.t,h.t),n=Math.max(g.t,k.t);if(m>n)return!1;if(libtess.geom.vertLeq(f,g)){if(0<libtess.geom.edgeSign(k,
|
|
f,g))return!1}else if(0>libtess.geom.edgeSign(h,g,f))return!1;libtess.sweepDebugEvent(a);libtess.geom.edgeIntersect(h,f,k,g,l);libtess.assert(Math.min(f.t,h.t)<=l.t);libtess.assert(l.t<=Math.max(g.t,k.t));libtess.assert(Math.min(k.s,h.s)<=l.s);libtess.assert(l.s<=Math.max(g.s,f.s));libtess.geom.vertLeq(l,a.event)&&(l.s=a.event.s,l.t=a.event.t);m=libtess.geom.vertLeq(f,g)?f:g;libtess.geom.vertLeq(m,l)&&(l.s=m.s,l.t=m.t);if(libtess.geom.vertEq(l,f)||libtess.geom.vertEq(l,g))return libtess.sweep.checkForRightSplice_(a,
|
|
b),!1;if(!libtess.geom.vertEq(h,a.event)&&0<=libtess.geom.edgeSign(h,a.event,l)||!libtess.geom.vertEq(k,a.event)&&0>=libtess.geom.edgeSign(k,a.event,l)){if(k===a.event)return libtess.mesh.splitEdge(d.sym),libtess.mesh.meshSplice(e.sym,d),b=libtess.sweep.topLeftRegion_(b),d=b.regionBelow().eUp,libtess.sweep.finishLeftRegions_(a,b.regionBelow(),c),libtess.sweep.addRightEdges_(a,b,d.oPrev(),d,d,!0),!0;if(h===a.event)return libtess.mesh.splitEdge(e.sym),libtess.mesh.meshSplice(d.lNext,e.oPrev()),c=b,
|
|
b=libtess.sweep.topRightRegion_(b),f=b.regionBelow().eUp.rPrev(),c.eUp=e.oPrev(),e=libtess.sweep.finishLeftRegions_(a,c,null),libtess.sweep.addRightEdges_(a,b,e.oNext,d.rPrev(),f,!0),!0;0<=libtess.geom.edgeSign(h,a.event,l)&&(b.regionAbove().dirty=b.dirty=!0,libtess.mesh.splitEdge(d.sym),d.org.s=a.event.s,d.org.t=a.event.t);0>=libtess.geom.edgeSign(k,a.event,l)&&(b.dirty=c.dirty=!0,libtess.mesh.splitEdge(e.sym),e.org.s=a.event.s,e.org.t=a.event.t);return!1}libtess.mesh.splitEdge(d.sym);libtess.mesh.splitEdge(e.sym);
|
|
libtess.mesh.meshSplice(e.oPrev(),d);d.org.s=l.s;d.org.t=l.t;d.org.pqHandle=a.pq.insert(d.org);libtess.sweep.getIntersectData_(a,d.org,f,h,g,k);b.regionAbove().dirty=b.dirty=c.dirty=!0;return!1};
|
|
libtess.sweep.walkDirtyRegions_=function(a,b){for(var c=b.regionBelow();;){for(;c.dirty;)b=c,c=c.regionBelow();if(!b.dirty&&(c=b,b=b.regionAbove(),null===b||!b.dirty))break;b.dirty=!1;var d=b.eUp,e=c.eUp;d.dst()!==e.dst()&&libtess.sweep.checkForLeftSplice_(a,b)&&(c.fixUpperEdge?(libtess.sweep.deleteRegion_(a,c),libtess.mesh.deleteEdge(e),c=b.regionBelow(),e=c.eUp):b.fixUpperEdge&&(libtess.sweep.deleteRegion_(a,b),libtess.mesh.deleteEdge(d),b=c.regionAbove(),d=b.eUp));if(d.org!==e.org)if(d.dst()===
|
|
e.dst()||b.fixUpperEdge||c.fixUpperEdge||d.dst()!==a.event&&e.dst()!==a.event)libtess.sweep.checkForRightSplice_(a,b);else if(libtess.sweep.checkForIntersect_(a,b))break;d.org===e.org&&d.dst()===e.dst()&&(libtess.sweep.addWinding_(e,d),libtess.sweep.deleteRegion_(a,b),libtess.mesh.deleteEdge(d),b=c.regionAbove())}};
|
|
libtess.sweep.connectRightVertex_=function(a,b,c){var d=c.oNext,e=b.regionBelow(),f=b.eUp,g=e.eUp,h=!1;f.dst()!==g.dst()&&libtess.sweep.checkForIntersect_(a,b);libtess.geom.vertEq(f.org,a.event)&&(libtess.mesh.meshSplice(d.oPrev(),f),b=libtess.sweep.topLeftRegion_(b),d=b.regionBelow().eUp,libtess.sweep.finishLeftRegions_(a,b.regionBelow(),e),h=!0);libtess.geom.vertEq(g.org,a.event)&&(libtess.mesh.meshSplice(c,g.oPrev()),c=libtess.sweep.finishLeftRegions_(a,e,null),h=!0);h?libtess.sweep.addRightEdges_(a,
|
|
b,c.oNext,d,d,!0):(d=libtess.geom.vertLeq(g.org,f.org)?g.oPrev():f,d=libtess.mesh.connect(c.lPrev(),d),libtess.sweep.addRightEdges_(a,b,d,d.oNext,d.oNext,!1),d.sym.activeRegion.fixUpperEdge=!0,libtess.sweep.walkDirtyRegions_(a,b))};
|
|
libtess.sweep.connectLeftDegenerate_=function(a,b,c){var d=b.eUp;if(libtess.geom.vertEq(d.org,c))libtess.assert(libtess.sweep.TOLERANCE_NONZERO_),libtess.sweep.spliceMergeVertices_(a,d,c.anEdge);else if(libtess.geom.vertEq(d.dst(),c)){libtess.assert(libtess.sweep.TOLERANCE_NONZERO_);b=libtess.sweep.topRightRegion_(b);var d=b.regionBelow(),e=d.eUp.sym,f=e.oNext,g=f;d.fixUpperEdge&&(libtess.assert(f!==e),libtess.sweep.deleteRegion_(a,d),libtess.mesh.deleteEdge(e),e=f.oPrev());libtess.mesh.meshSplice(c.anEdge,
|
|
e);libtess.geom.edgeGoesLeft(f)||(f=null);libtess.sweep.addRightEdges_(a,b,e.oNext,g,f,!0)}else libtess.mesh.splitEdge(d.sym),b.fixUpperEdge&&(libtess.mesh.deleteEdge(d.oNext),b.fixUpperEdge=!1),libtess.mesh.meshSplice(c.anEdge,d),libtess.sweep.sweepEvent_(a,c)};
|
|
libtess.sweep.connectLeftVertex_=function(a,b){var c=new libtess.ActiveRegion;c.eUp=b.anEdge.sym;var c=a.dict.search(c).getKey(),d=c.regionBelow(),e=c.eUp,f=d.eUp;0===libtess.geom.edgeSign(e.dst(),b,e.org)?libtess.sweep.connectLeftDegenerate_(a,c,b):(d=libtess.geom.vertLeq(f.dst(),e.dst())?c:d,c.inside||d.fixUpperEdge?(e=d===c?libtess.mesh.connect(b.anEdge.sym,e.lNext):libtess.mesh.connect(f.dNext(),b.anEdge).sym,d.fixUpperEdge?libtess.sweep.fixUpperEdge_(d,e):libtess.sweep.computeWinding_(a,libtess.sweep.addRegionBelow_(a,
|
|
c,e)),libtess.sweep.sweepEvent_(a,b)):libtess.sweep.addRightEdges_(a,c,b.anEdge,b.anEdge,null,!0))};
|
|
libtess.sweep.sweepEvent_=function(a,b){a.event=b;libtess.sweepDebugEvent(a);for(var c=b.anEdge;null===c.activeRegion;)if(c=c.oNext,c===b.anEdge){libtess.sweep.connectLeftVertex_(a,b);return}var c=libtess.sweep.topLeftRegion_(c.activeRegion),d=c.regionBelow(),e=d.eUp,d=libtess.sweep.finishLeftRegions_(a,d,null);d.oNext===e?libtess.sweep.connectRightVertex_(a,c,d):libtess.sweep.addRightEdges_(a,c,d.oNext,e,e,!0)};
|
|
libtess.sweep.addSentinel_=function(a,b){var c=new libtess.ActiveRegion,d=libtess.mesh.makeEdge(a.mesh);d.org.s=libtess.sweep.SENTINEL_COORD_;d.org.t=b;d.dst().s=-libtess.sweep.SENTINEL_COORD_;d.dst().t=b;a.event=d.dst();c.eUp=d;c.windingNumber=0;c.inside=!1;c.fixUpperEdge=!1;c.sentinel=!0;c.dirty=!1;c.nodeUp=a.dict.insert(c)};
|
|
libtess.sweep.initEdgeDict_=function(a){a.dict=new libtess.Dict(a,libtess.sweep.edgeLeq_);libtess.sweep.addSentinel_(a,-libtess.sweep.SENTINEL_COORD_);libtess.sweep.addSentinel_(a,libtess.sweep.SENTINEL_COORD_)};libtess.sweep.doneEdgeDict_=function(a){for(var b=0,c;null!==(c=a.dict.getMin().getKey());)c.sentinel||(libtess.assert(c.fixUpperEdge),libtess.assert(1===++b)),libtess.assert(0===c.windingNumber),libtess.sweep.deleteRegion_(a,c);a.dict.deleteDict();a.dict=null};
|
|
libtess.sweep.removeDegenerateEdges_=function(a){for(var b=a.mesh.eHead,c,d=b.next;d!==b;d=c){c=d.next;var e=d.lNext;libtess.geom.vertEq(d.org,d.dst())&&d.lNext.lNext!==d&&(libtess.sweep.spliceMergeVertices_(a,e,d),libtess.mesh.deleteEdge(d),d=e,e=d.lNext);if(e.lNext===d){if(e!==d){if(e===c||e===c.sym)c=c.next;libtess.mesh.deleteEdge(e)}if(d===c||d===c.sym)c=c.next;libtess.mesh.deleteEdge(d)}}};
|
|
libtess.sweep.initPriorityQ_=function(a){var b=new libtess.PriorityQ(libtess.geom.vertLeq);a.pq=b;a=a.mesh.vHead;var c;for(c=a.next;c!==a;c=c.next)c.pqHandle=b.insert(c);b.init()};libtess.sweep.donePriorityQ_=function(a){a.pq.deleteQ();a.pq=null};libtess.sweep.removeDegenerateFaces_=function(a){for(var b,c=a.fHead.next;c!==a.fHead;c=b)b=c.next,c=c.anEdge,libtess.assert(c.lNext!==c),c.lNext.lNext===c&&(libtess.sweep.addWinding_(c.oNext,c),libtess.mesh.deleteEdge(c))};libtess.tessmono={};
|
|
libtess.tessmono.tessellateMonoRegion_=function(a){a=a.anEdge;for(libtess.assert(a.lNext!==a&&a.lNext.lNext!==a);libtess.geom.vertLeq(a.dst(),a.org);a=a.lPrev());for(;libtess.geom.vertLeq(a.org,a.dst());a=a.lNext);for(var b=a.lPrev(),c;a.lNext!==b;)if(libtess.geom.vertLeq(a.dst(),b.org)){for(;b.lNext!==a&&(libtess.geom.edgeGoesLeft(b.lNext)||0>=libtess.geom.edgeSign(b.org,b.dst(),b.lNext.dst()));)c=libtess.mesh.connect(b.lNext,b),b=c.sym;b=b.lPrev()}else{for(;b.lNext!==a&&(libtess.geom.edgeGoesRight(a.lPrev())||0<=
|
|
libtess.geom.edgeSign(a.dst(),a.org,a.lPrev().org));)c=libtess.mesh.connect(a,a.lPrev()),a=c.sym;a=a.lNext}for(libtess.assert(b.lNext!==a);b.lNext.lNext!==a;)c=libtess.mesh.connect(b.lNext,b),b=c.sym};libtess.tessmono.tessellateInterior=function(a){for(var b,c=a.fHead.next;c!==a.fHead;c=b)b=c.next,c.inside&&libtess.tessmono.tessellateMonoRegion_(c)};libtess.tessmono.discardExterior=function(a){for(var b,c=a.fHead.next;c!==a.fHead;c=b)b=c.next,c.inside||libtess.mesh.zapFace(c)};
|
|
libtess.tessmono.setWindingNumber=function(a,b,c){for(var d,e=a.eHead.next;e!==a.eHead;e=d)d=e.next,e.rFace().inside!==e.lFace.inside?e.winding=e.lFace.inside?b:-b:c?libtess.mesh.deleteEdge(e):e.winding=0};libtess.GluTesselator=function(){this.state=libtess.tessState.T_DORMANT;this.callError_=this.mesh=this.lastEdge_=null;this.normal=[0,0,0];this.sUnit=[0,0,0];this.tUnit=[0,0,0];this.relTolerance=libtess.GLU_TESS_DEFAULT_TOLERANCE;this.windingRule=libtess.windingRule.GLU_TESS_WINDING_ODD;this.fatalError=!1;this.callCombine_=this.event=this.pq=this.dict=null;this.boundaryOnly=this.flagBoundary=!1;this.polygonData_=this.callCombineData_=this.callErrorData_=this.callEndData_=this.callVertexData_=this.callEdgeFlagData_=
|
|
this.callBeginData_=this.callMesh_=this.callEnd_=this.callVertex_=this.callEdgeFlag_=this.callBegin_=this.lonelyTriList=null;this.emptyCache=!1;this.cacheCount=0;this.cache=Array(libtess.TESS_MAX_CACHE);for(var a=0;a<libtess.TESS_MAX_CACHE;a++)this.cache[a]=new libtess.CachedVertex};libtess.GluTesselator.prototype.gluDeleteTess=function(){this.requireState_(libtess.tessState.T_DORMANT)};
|
|
libtess.GluTesselator.prototype.gluTessProperty=function(a,b){switch(a){case libtess.gluEnum.GLU_TESS_TOLERANCE:if(0>b||1<b)break;this.relTolerance=b;return;case libtess.gluEnum.GLU_TESS_WINDING_RULE:switch(b){case libtess.windingRule.GLU_TESS_WINDING_ODD:case libtess.windingRule.GLU_TESS_WINDING_NONZERO:case libtess.windingRule.GLU_TESS_WINDING_POSITIVE:case libtess.windingRule.GLU_TESS_WINDING_NEGATIVE:case libtess.windingRule.GLU_TESS_WINDING_ABS_GEQ_TWO:this.windingRule=b;return}break;case libtess.gluEnum.GLU_TESS_BOUNDARY_ONLY:this.boundaryOnly=
|
|
!!b;return;default:this.callErrorOrErrorData(libtess.gluEnum.GLU_INVALID_ENUM);return}this.callErrorOrErrorData(libtess.gluEnum.GLU_INVALID_VALUE)};
|
|
libtess.GluTesselator.prototype.gluGetTessProperty=function(a){switch(a){case libtess.gluEnum.GLU_TESS_TOLERANCE:return libtess.assert(0<=this.relTolerance&&1>=this.relTolerance),this.relTolerance;case libtess.gluEnum.GLU_TESS_WINDING_RULE:return a=this.windingRule,libtess.assert(a===libtess.windingRule.GLU_TESS_WINDING_ODD||a===libtess.windingRule.GLU_TESS_WINDING_NONZERO||a===libtess.windingRule.GLU_TESS_WINDING_POSITIVE||a===libtess.windingRule.GLU_TESS_WINDING_NEGATIVE||a===libtess.windingRule.GLU_TESS_WINDING_ABS_GEQ_TWO),
|
|
a;case libtess.gluEnum.GLU_TESS_BOUNDARY_ONLY:return libtess.assert(!0===this.boundaryOnly||!1===this.boundaryOnly),this.boundaryOnly;default:this.callErrorOrErrorData(libtess.gluEnum.GLU_INVALID_ENUM)}return!1};libtess.GluTesselator.prototype.gluTessNormal=function(a,b,c){this.normal[0]=a;this.normal[1]=b;this.normal[2]=c};
|
|
libtess.GluTesselator.prototype.gluTessCallback=function(a,b){var c=b?b:null;switch(a){case libtess.gluEnum.GLU_TESS_BEGIN:this.callBegin_=c;break;case libtess.gluEnum.GLU_TESS_BEGIN_DATA:this.callBeginData_=c;break;case libtess.gluEnum.GLU_TESS_EDGE_FLAG:this.callEdgeFlag_=c;this.flagBoundary=!!c;break;case libtess.gluEnum.GLU_TESS_EDGE_FLAG_DATA:this.callEdgeFlagData_=c;this.flagBoundary=!!c;break;case libtess.gluEnum.GLU_TESS_VERTEX:this.callVertex_=c;break;case libtess.gluEnum.GLU_TESS_VERTEX_DATA:this.callVertexData_=
|
|
c;break;case libtess.gluEnum.GLU_TESS_END:this.callEnd_=c;break;case libtess.gluEnum.GLU_TESS_END_DATA:this.callEndData_=c;break;case libtess.gluEnum.GLU_TESS_ERROR:this.callError_=c;break;case libtess.gluEnum.GLU_TESS_ERROR_DATA:this.callErrorData_=c;break;case libtess.gluEnum.GLU_TESS_COMBINE:this.callCombine_=c;break;case libtess.gluEnum.GLU_TESS_COMBINE_DATA:this.callCombineData_=c;break;case libtess.gluEnum.GLU_TESS_MESH:this.callMesh_=c;break;default:this.callErrorOrErrorData(libtess.gluEnum.GLU_INVALID_ENUM)}};
|
|
libtess.GluTesselator.prototype.gluTessVertex=function(a,b){var c=!1,d=[0,0,0];this.requireState_(libtess.tessState.T_IN_CONTOUR);this.emptyCache&&(this.emptyCache_(),this.lastEdge_=null);for(var e=0;3>e;++e){var f=a[e];f<-libtess.GLU_TESS_MAX_COORD&&(f=-libtess.GLU_TESS_MAX_COORD,c=!0);f>libtess.GLU_TESS_MAX_COORD&&(f=libtess.GLU_TESS_MAX_COORD,c=!0);d[e]=f}c&&this.callErrorOrErrorData(libtess.errorType.GLU_TESS_COORD_TOO_LARGE);if(null===this.mesh){if(this.cacheCount<libtess.TESS_MAX_CACHE){this.cacheVertex_(d,
|
|
b);return}this.emptyCache_()}this.addVertex_(d,b)};libtess.GluTesselator.prototype.gluTessBeginPolygon=function(a){this.requireState_(libtess.tessState.T_DORMANT);this.state=libtess.tessState.T_IN_POLYGON;this.cacheCount=0;this.emptyCache=!1;this.mesh=null;this.polygonData_=a};libtess.GluTesselator.prototype.gluTessBeginContour=function(){this.requireState_(libtess.tessState.T_IN_POLYGON);this.state=libtess.tessState.T_IN_CONTOUR;this.lastEdge_=null;0<this.cacheCount&&(this.emptyCache=!0)};
|
|
libtess.GluTesselator.prototype.gluTessEndContour=function(){this.requireState_(libtess.tessState.T_IN_CONTOUR);this.state=libtess.tessState.T_IN_POLYGON};
|
|
libtess.GluTesselator.prototype.gluTessEndPolygon=function(){this.requireState_(libtess.tessState.T_IN_POLYGON);this.state=libtess.tessState.T_DORMANT;if(null===this.mesh){if(!this.flagBoundary&&!this.callMesh_&&libtess.render.renderCache(this)){this.polygonData_=null;return}this.emptyCache_()}libtess.normal.projectPolygon(this);libtess.sweep.computeInterior(this);if(!this.fatalError){this.boundaryOnly?libtess.tessmono.setWindingNumber(this.mesh,1,!0):libtess.tessmono.tessellateInterior(this.mesh);
|
|
this.mesh.checkMesh();if(this.callBegin_||this.callEnd_||this.callVertex_||this.callEdgeFlag_||this.callBeginData_||this.callEndData_||this.callVertexData_||this.callEdgeFlagData_)this.boundaryOnly?libtess.render.renderBoundary(this,this.mesh):libtess.render.renderMesh(this,this.mesh);if(this.callMesh_){libtess.tessmono.discardExterior(this.mesh);this.callMesh_(this.mesh);this.polygonData_=this.mesh=null;return}}libtess.mesh.deleteMesh(this.mesh);this.mesh=this.polygonData_=null};
|
|
libtess.GluTesselator.prototype.makeDormant_=function(){this.mesh&&libtess.mesh.deleteMesh(this.mesh);this.state=libtess.tessState.T_DORMANT;this.mesh=this.lastEdge_=null};libtess.GluTesselator.prototype.requireState_=function(a){this.state!==a&&this.gotoState_(a)};
|
|
libtess.GluTesselator.prototype.gotoState_=function(a){for(;this.state!==a;)if(this.state<a)switch(this.state){case libtess.tessState.T_DORMANT:this.callErrorOrErrorData(libtess.errorType.GLU_TESS_MISSING_BEGIN_POLYGON);this.gluTessBeginPolygon(null);break;case libtess.tessState.T_IN_POLYGON:this.callErrorOrErrorData(libtess.errorType.GLU_TESS_MISSING_BEGIN_CONTOUR),this.gluTessBeginContour()}else switch(this.state){case libtess.tessState.T_IN_CONTOUR:this.callErrorOrErrorData(libtess.errorType.GLU_TESS_MISSING_END_CONTOUR);
|
|
this.gluTessEndContour();break;case libtess.tessState.T_IN_POLYGON:this.callErrorOrErrorData(libtess.errorType.GLU_TESS_MISSING_END_POLYGON),this.makeDormant_()}};libtess.GluTesselator.prototype.addVertex_=function(a,b){var c=this.lastEdge_;null===c?(c=libtess.mesh.makeEdge(this.mesh),libtess.mesh.meshSplice(c,c.sym)):(libtess.mesh.splitEdge(c),c=c.lNext);c.org.data=b;c.org.coords[0]=a[0];c.org.coords[1]=a[1];c.org.coords[2]=a[2];c.winding=1;c.sym.winding=-1;this.lastEdge_=c};
|
|
libtess.GluTesselator.prototype.cacheVertex_=function(a,b){var c=this.cache[this.cacheCount];c.data=b;c.coords[0]=a[0];c.coords[1]=a[1];c.coords[2]=a[2];++this.cacheCount};libtess.GluTesselator.prototype.emptyCache_=function(){this.mesh=new libtess.GluMesh;for(var a=0;a<this.cacheCount;a++){var b=this.cache[a];this.addVertex_(b.coords,b.data)}this.cacheCount=0;this.emptyCache=!1};
|
|
libtess.GluTesselator.prototype.callBeginOrBeginData=function(a){this.callBeginData_?this.callBeginData_(a,this.polygonData_):this.callBegin_&&this.callBegin_(a)};libtess.GluTesselator.prototype.callVertexOrVertexData=function(a){this.callVertexData_?this.callVertexData_(a,this.polygonData_):this.callVertex_&&this.callVertex_(a)};libtess.GluTesselator.prototype.callEdgeFlagOrEdgeFlagData=function(a){this.callEdgeFlagData_?this.callEdgeFlagData_(a,this.polygonData_):this.callEdgeFlag_&&this.callEdgeFlag_(a)};
|
|
libtess.GluTesselator.prototype.callEndOrEndData=function(){this.callEndData_?this.callEndData_(this.polygonData_):this.callEnd_&&this.callEnd_()};libtess.GluTesselator.prototype.callCombineOrCombineData=function(a,b,c){var d;this.callCombineData_?d=this.callCombineData_(a,b,c,this.polygonData_):this.callCombine_&&(d=this.callCombine_(a,b,c));void 0===d&&(d=null);return d};
|
|
libtess.GluTesselator.prototype.callErrorOrErrorData=function(a){this.callErrorData_?this.callErrorData_(a,this.polygonData_):this.callError_&&this.callError_(a)};var ol={};ol.inherits=goog.inherits;goog.debug={};goog.debug.Error=function(a){Error.captureStackTrace?Error.captureStackTrace(this,goog.debug.Error):this.stack=Error().stack||"";a&&(this.message=String(a))};goog.inherits(goog.debug.Error,Error);goog.debug.Error.prototype.name="CustomError";goog.string={};goog.string.Unicode={NBSP:"\u00a0"};goog.string.startsWith=function(a,b){return 0==a.lastIndexOf(b,0)};goog.string.endsWith=function(a,b){var c=a.length-b.length;return 0<=c&&a.indexOf(b,c)==c};goog.string.caseInsensitiveStartsWith=function(a,b){return 0==goog.string.caseInsensitiveCompare(b,a.substr(0,b.length))};goog.string.caseInsensitiveEndsWith=function(a,b){return 0==goog.string.caseInsensitiveCompare(b,a.substr(a.length-b.length,b.length))};
|
|
goog.string.caseInsensitiveEquals=function(a,b){return a.toLowerCase()==b.toLowerCase()};goog.string.subs=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")};goog.string.collapseWhitespace=function(a){return a.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")};goog.string.isEmpty=function(a){return/^[\s\xa0]*$/.test(a)};goog.string.isEmptySafe=function(a){return goog.string.isEmpty(goog.string.makeSafe(a))};
|
|
goog.string.isBreakingWhitespace=function(a){return!/[^\t\n\r ]/.test(a)};goog.string.isAlpha=function(a){return!/[^a-zA-Z]/.test(a)};goog.string.isNumeric=function(a){return!/[^0-9]/.test(a)};goog.string.isAlphaNumeric=function(a){return!/[^a-zA-Z0-9]/.test(a)};goog.string.isSpace=function(a){return" "==a};goog.string.isUnicodeChar=function(a){return 1==a.length&&" "<=a&&"~">=a||"\u0080"<=a&&"\ufffd">=a};goog.string.stripNewlines=function(a){return a.replace(/(\r\n|\r|\n)+/g," ")};
|
|
goog.string.canonicalizeNewlines=function(a){return a.replace(/(\r\n|\r|\n)/g,"\n")};goog.string.normalizeWhitespace=function(a){return a.replace(/\xa0|\s/g," ")};goog.string.normalizeSpaces=function(a){return a.replace(/\xa0|[ \t]+/g," ")};goog.string.collapseBreakingSpaces=function(a){return a.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")};goog.string.trim=function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};
|
|
goog.string.trimLeft=function(a){return a.replace(/^[\s\xa0]+/,"")};goog.string.trimRight=function(a){return a.replace(/[\s\xa0]+$/,"")};goog.string.caseInsensitiveCompare=function(a,b){var c=String(a).toLowerCase(),d=String(b).toLowerCase();return c<d?-1:c==d?0:1};goog.string.numerateCompareRegExp_=/(\.\d+)|(\d+)|(\D+)/g;
|
|
goog.string.numerateCompare=function(a,b){if(a==b)return 0;if(!a)return-1;if(!b)return 1;for(var c=a.toLowerCase().match(goog.string.numerateCompareRegExp_),d=b.toLowerCase().match(goog.string.numerateCompareRegExp_),e=Math.min(c.length,d.length),f=0;f<e;f++){var g=c[f],h=d[f];if(g!=h)return c=parseInt(g,10),!isNaN(c)&&(d=parseInt(h,10),!isNaN(d)&&c-d)?c-d:g<h?-1:1}return c.length!=d.length?c.length-d.length:a<b?-1:1};goog.string.urlEncode=function(a){return encodeURIComponent(String(a))};
|
|
goog.string.urlDecode=function(a){return decodeURIComponent(a.replace(/\+/g," "))};goog.string.newLineToBr=function(a,b){return a.replace(/(\r\n|\r|\n)/g,b?"\x3cbr /\x3e":"\x3cbr\x3e")};
|
|
goog.string.htmlEscape=function(a,b){if(b)return a.replace(goog.string.amperRe_,"\x26amp;").replace(goog.string.ltRe_,"\x26lt;").replace(goog.string.gtRe_,"\x26gt;").replace(goog.string.quotRe_,"\x26quot;");if(!goog.string.allRe_.test(a))return a;-1!=a.indexOf("\x26")&&(a=a.replace(goog.string.amperRe_,"\x26amp;"));-1!=a.indexOf("\x3c")&&(a=a.replace(goog.string.ltRe_,"\x26lt;"));-1!=a.indexOf("\x3e")&&(a=a.replace(goog.string.gtRe_,"\x26gt;"));-1!=a.indexOf('"')&&(a=a.replace(goog.string.quotRe_,
|
|
"\x26quot;"));return a};goog.string.amperRe_=/&/g;goog.string.ltRe_=/</g;goog.string.gtRe_=/>/g;goog.string.quotRe_=/\"/g;goog.string.allRe_=/[&<>\"]/;goog.string.unescapeEntities=function(a){return goog.string.contains(a,"\x26")?"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(a):goog.string.unescapePureXmlEntities_(a):a};
|
|
goog.string.unescapeEntitiesUsingDom_=function(a){var b={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26quot;":'"'},c=document.createElement("div");return a.replace(goog.string.HTML_ENTITY_PATTERN_,function(a,e){var f=b[a];if(f)return f;if("#"==e.charAt(0)){var g=Number("0"+e.substr(1));isNaN(g)||(f=String.fromCharCode(g))}f||(c.innerHTML=a+" ",f=c.firstChild.nodeValue.slice(0,-1));return b[a]=f})};
|
|
goog.string.unescapePureXmlEntities_=function(a){return a.replace(/&([^;]+);/g,function(a,c){switch(c){case "amp":return"\x26";case "lt":return"\x3c";case "gt":return"\x3e";case "quot":return'"';default:if("#"==c.charAt(0)){var d=Number("0"+c.substr(1));if(!isNaN(d))return String.fromCharCode(d)}return a}})};goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g;goog.string.whitespaceEscape=function(a,b){return goog.string.newLineToBr(a.replace(/ /g," \x26#160;"),b)};
|
|
goog.string.stripQuotes=function(a,b){for(var c=b.length,d=0;d<c;d++){var e=1==c?b:b.charAt(d);if(a.charAt(0)==e&&a.charAt(a.length-1)==e)return a.substring(1,a.length-1)}return a};goog.string.truncate=function(a,b,c){c&&(a=goog.string.unescapeEntities(a));a.length>b&&(a=a.substring(0,b-3)+"...");c&&(a=goog.string.htmlEscape(a));return a};
|
|
goog.string.truncateMiddle=function(a,b,c,d){c&&(a=goog.string.unescapeEntities(a));if(d&&a.length>b){d>b&&(d=b);var e=a.length-d;a=a.substring(0,b-d)+"..."+a.substring(e)}else a.length>b&&(d=Math.floor(b/2),e=a.length-d,a=a.substring(0,d+b%2)+"..."+a.substring(e));c&&(a=goog.string.htmlEscape(a));return a};goog.string.specialEscapeChars_={"\x00":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\x0B",'"':'\\"',"\\":"\\\\"};goog.string.jsEscapeCache_={"'":"\\'"};
|
|
goog.string.quote=function(a){a=String(a);if(a.quote)return a.quote();for(var b=['"'],c=0;c<a.length;c++){var d=a.charAt(c),e=d.charCodeAt(0);b[c+1]=goog.string.specialEscapeChars_[d]||(31<e&&127>e?d:goog.string.escapeChar(d))}b.push('"');return b.join("")};goog.string.escapeString=function(a){for(var b=[],c=0;c<a.length;c++)b[c]=goog.string.escapeChar(a.charAt(c));return b.join("")};
|
|
goog.string.escapeChar=function(a){if(a in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[a];if(a in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[a]=goog.string.specialEscapeChars_[a];var b=a,c=a.charCodeAt(0);if(31<c&&127>c)b=a;else{if(256>c){if(b="\\x",16>c||256<c)b+="0"}else b="\\u",4096>c&&(b+="0");b+=c.toString(16).toUpperCase()}return goog.string.jsEscapeCache_[a]=b};goog.string.toMap=function(a){for(var b={},c=0;c<a.length;c++)b[a.charAt(c)]=!0;return b};
|
|
goog.string.contains=function(a,b){return-1!=a.indexOf(b)};goog.string.countOf=function(a,b){return a&&b?a.split(b).length-1:0};goog.string.removeAt=function(a,b,c){var d=a;0<=b&&(b<a.length&&0<c)&&(d=a.substr(0,b)+a.substr(b+c,a.length-b-c));return d};goog.string.remove=function(a,b){var c=RegExp(goog.string.regExpEscape(b),"");return a.replace(c,"")};goog.string.removeAll=function(a,b){var c=RegExp(goog.string.regExpEscape(b),"g");return a.replace(c,"")};
|
|
goog.string.regExpEscape=function(a){return String(a).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")};goog.string.repeat=function(a,b){return Array(b+1).join(a)};goog.string.padNumber=function(a,b,c){a=goog.isDef(c)?a.toFixed(c):String(a);c=a.indexOf(".");-1==c&&(c=a.length);return goog.string.repeat("0",Math.max(0,b-c))+a};goog.string.makeSafe=function(a){return null==a?"":String(a)};goog.string.buildString=function(a){return Array.prototype.join.call(arguments,"")};
|
|
goog.string.getRandomString=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^goog.now()).toString(36)};
|
|
goog.string.compareVersions=function(a,b){for(var c=0,d=goog.string.trim(String(a)).split("."),e=goog.string.trim(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var h=d[g]||"",k=e[g]||"",l=RegExp("(\\d*)(\\D*)","g"),m=RegExp("(\\d*)(\\D*)","g");do{var n=l.exec(h)||["","",""],p=m.exec(k)||["","",""];if(0==n[0].length&&0==p[0].length)break;var c=0==n[1].length?0:parseInt(n[1],10),r=0==p[1].length?0:parseInt(p[1],10),c=goog.string.compareElements_(c,r)||goog.string.compareElements_(0==
|
|
n[2].length,0==p[2].length)||goog.string.compareElements_(n[2],p[2])}while(0==c)}return c};goog.string.compareElements_=function(a,b){return a<b?-1:a>b?1:0};goog.string.HASHCODE_MAX_=4294967296;goog.string.hashCode=function(a){for(var b=0,c=0;c<a.length;++c)b=31*b+a.charCodeAt(c),b%=goog.string.HASHCODE_MAX_;return b};goog.string.uniqueStringCounter_=2147483648*Math.random()|0;goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++};
|
|
goog.string.toNumber=function(a){var b=Number(a);return 0==b&&goog.string.isEmpty(a)?NaN:b};goog.string.isLowerCamelCase=function(a){return/^[a-z]+([A-Z][a-z]*)*$/.test(a)};goog.string.isUpperCamelCase=function(a){return/^([A-Z][a-z]*)+$/.test(a)};goog.string.toCamelCase=function(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};goog.string.toSelectorCase=function(a){return String(a).replace(/([A-Z])/g,"-$1").toLowerCase()};
|
|
goog.string.toTitleCase=function(a,b){var c=goog.isString(b)?goog.string.regExpEscape(b):"\\s";return a.replace(RegExp("(^"+(c?"|["+c+"]+":"")+")([a-z])","g"),function(a,b,c){return b+c.toUpperCase()})};goog.string.parseInt=function(a){isFinite(a)&&(a=String(a));return goog.isString(a)?/^\s*-?0x/i.test(a)?parseInt(a,16):parseInt(a,10):NaN};goog.string.splitLimit=function(a,b,c){a=a.split(b);for(var d=[];0<c&&a.length;)d.push(a.shift()),c--;a.length&&d.push(a.join(b));return d};ol.size={};ol.size.equals=function(a,b){return a[0]==b[0]&&a[1]==b[1]};goog.array={};goog.NATIVE_ARRAY_PROTOTYPES=goog.TRUSTED_SITE;goog.array.peek=function(a){return a[a.length-1]};goog.array.ARRAY_PROTOTYPE_=Array.prototype;goog.array.indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.indexOf?function(a,b,c){return goog.array.ARRAY_PROTOTYPE_.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(goog.isString(a))return goog.isString(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1};
|
|
goog.array.lastIndexOf=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.lastIndexOf?function(a,b,c){return goog.array.ARRAY_PROTOTYPE_.lastIndexOf.call(a,b,null==c?a.length-1:c)}:function(a,b,c){c=null==c?a.length-1:c;0>c&&(c=Math.max(0,a.length+c));if(goog.isString(a))return goog.isString(b)&&1==b.length?a.lastIndexOf(b,c):-1;for(;0<=c;c--)if(c in a&&a[c]===b)return c;return-1};
|
|
goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.forEach?function(a,b,c){goog.array.ARRAY_PROTOTYPE_.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)};goog.array.forEachRight=function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,d=d-1;0<=d;--d)d in e&&b.call(c,e[d],d,a)};
|
|
goog.array.filter=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.filter?function(a,b,c){return goog.array.ARRAY_PROTOTYPE_.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],f=0,g=goog.isString(a)?a.split(""):a,h=0;h<d;h++)if(h in g){var k=g[h];b.call(c,k,h,a)&&(e[f++]=k)}return e};
|
|
goog.array.map=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.map?function(a,b,c){return goog.array.ARRAY_PROTOTYPE_.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=Array(d),f=goog.isString(a)?a.split(""):a,g=0;g<d;g++)g in f&&(e[g]=b.call(c,f[g],g,a));return e};goog.array.reduce=function(a,b,c,d){if(a.reduce)return d?a.reduce(goog.bind(b,d),c):a.reduce(b,c);var e=c;goog.array.forEach(a,function(c,g){e=b.call(d,e,c,g,a)});return e};
|
|
goog.array.reduceRight=function(a,b,c,d){if(a.reduceRight)return d?a.reduceRight(goog.bind(b,d),c):a.reduceRight(b,c);var e=c;goog.array.forEachRight(a,function(c,g){e=b.call(d,e,c,g,a)});return e};goog.array.some=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.some?function(a,b,c){return goog.array.ARRAY_PROTOTYPE_.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return!0;return!1};
|
|
goog.array.every=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.every?function(a,b,c){return goog.array.ARRAY_PROTOTYPE_.every.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&!b.call(c,e[f],f,a))return!1;return!0};goog.array.count=function(a,b,c){var d=0;goog.array.forEach(a,function(a,f,g){b.call(c,a,f,g)&&++d},c);return d};
|
|
goog.array.find=function(a,b,c){b=goog.array.findIndex(a,b,c);return 0>b?null:goog.isString(a)?a.charAt(b):a[b]};goog.array.findIndex=function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return f;return-1};goog.array.findRight=function(a,b,c){b=goog.array.findIndexRight(a,b,c);return 0>b?null:goog.isString(a)?a.charAt(b):a[b]};
|
|
goog.array.findIndexRight=function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,d=d-1;0<=d;d--)if(d in e&&b.call(c,e[d],d,a))return d;return-1};goog.array.contains=function(a,b){return 0<=goog.array.indexOf(a,b)};goog.array.isEmpty=function(a){return 0==a.length};goog.array.clear=function(a){if(!goog.isArray(a))for(var b=a.length-1;0<=b;b--)delete a[b];a.length=0};goog.array.insert=function(a,b){goog.array.contains(a,b)||a.push(b)};
|
|
goog.array.insertAt=function(a,b,c){goog.array.splice(a,c,0,b)};goog.array.insertArrayAt=function(a,b,c){goog.partial(goog.array.splice,a,c,0).apply(null,b)};goog.array.insertBefore=function(a,b,c){var d;2==arguments.length||0>(d=goog.array.indexOf(a,c))?a.push(b):goog.array.insertAt(a,b,d)};goog.array.remove=function(a,b){var c=goog.array.indexOf(a,b),d;(d=0<=c)&&goog.array.removeAt(a,c);return d};goog.array.removeAt=function(a,b){return 1==goog.array.ARRAY_PROTOTYPE_.splice.call(a,b,1).length};
|
|
goog.array.removeIf=function(a,b,c){b=goog.array.findIndex(a,b,c);return 0<=b?(goog.array.removeAt(a,b),!0):!1};goog.array.concat=function(a){return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_,arguments)};goog.array.toArray=function(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]};goog.array.clone=goog.array.toArray;
|
|
goog.array.extend=function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c],e;if(goog.isArray(d)||(e=goog.isArrayLike(d))&&Object.prototype.hasOwnProperty.call(d,"callee"))a.push.apply(a,d);else if(e)for(var f=a.length,g=d.length,h=0;h<g;h++)a[f+h]=d[h];else a.push(d)}};goog.array.splice=function(a,b,c,d){return goog.array.ARRAY_PROTOTYPE_.splice.apply(a,goog.array.slice(arguments,1))};
|
|
goog.array.slice=function(a,b,c){return 2>=arguments.length?goog.array.ARRAY_PROTOTYPE_.slice.call(a,b):goog.array.ARRAY_PROTOTYPE_.slice.call(a,b,c)};goog.array.removeDuplicates=function(a,b){for(var c=b||a,d={},e=0,f=0;f<a.length;){var g=a[f++],h=goog.isObject(g)?"o"+goog.getUid(g):(typeof g).charAt(0)+g;Object.prototype.hasOwnProperty.call(d,h)||(d[h]=!0,c[e++]=g)}c.length=e};goog.array.binarySearch=function(a,b,c){return goog.array.binarySearch_(a,c||goog.array.defaultCompare,!1,b)};
|
|
goog.array.binarySelect=function(a,b,c){return goog.array.binarySearch_(a,b,!0,void 0,c)};goog.array.binarySearch_=function(a,b,c,d,e){for(var f=0,g=a.length,h;f<g;){var k=f+g>>1,l;l=c?b.call(e,a[k],k,a):b(d,a[k]);0<l?f=k+1:(g=k,h=!l)}return h?f:~f};goog.array.sort=function(a,b){goog.array.ARRAY_PROTOTYPE_.sort.call(a,b||goog.array.defaultCompare)};
|
|
goog.array.stableSort=function(a,b){for(var c=0;c<a.length;c++)a[c]={index:c,value:a[c]};var d=b||goog.array.defaultCompare;goog.array.sort(a,function(a,b){return d(a.value,b.value)||a.index-b.index});for(c=0;c<a.length;c++)a[c]=a[c].value};goog.array.sortObjectsByKey=function(a,b,c){var d=c||goog.array.defaultCompare;goog.array.sort(a,function(a,c){return d(a[b],c[b])})};
|
|
goog.array.isSorted=function(a,b,c){b=b||goog.array.defaultCompare;for(var d=1;d<a.length;d++){var e=b(a[d-1],a[d]);if(0<e||0==e&&c)return!1}return!0};goog.array.equals=function(a,b,c){if(!goog.isArrayLike(a)||!goog.isArrayLike(b)||a.length!=b.length)return!1;var d=a.length;c=c||goog.array.defaultCompareEquality;for(var e=0;e<d;e++)if(!c(a[e],b[e]))return!1;return!0};goog.array.compare=function(a,b,c){return goog.array.equals(a,b,c)};
|
|
goog.array.compare3=function(a,b,c){c=c||goog.array.defaultCompare;for(var d=Math.min(a.length,b.length),e=0;e<d;e++){var f=c(a[e],b[e]);if(0!=f)return f}return goog.array.defaultCompare(a.length,b.length)};goog.array.defaultCompare=function(a,b){return a>b?1:a<b?-1:0};goog.array.defaultCompareEquality=function(a,b){return a===b};goog.array.binaryInsert=function(a,b,c){c=goog.array.binarySearch(a,b,c);return 0>c?(goog.array.insertAt(a,b,-(c+1)),!0):!1};
|
|
goog.array.binaryRemove=function(a,b,c){b=goog.array.binarySearch(a,b,c);return 0<=b?goog.array.removeAt(a,b):!1};goog.array.bucket=function(a,b,c){for(var d={},e=0;e<a.length;e++){var f=a[e],g=b.call(c,f,e,a);goog.isDef(g)&&(d[g]||(d[g]=[])).push(f)}return d};goog.array.toObject=function(a,b,c){var d={};goog.array.forEach(a,function(e,f){d[b.call(c,e,f,a)]=e});return d};
|
|
goog.array.range=function(a,b,c){var d=[],e=0,f=a;c=c||1;void 0!==b&&(e=a,f=b);if(0>c*(f-e))return[];if(0<c)for(a=e;a<f;a+=c)d.push(a);else for(a=e;a>f;a+=c)d.push(a);return d};goog.array.repeat=function(a,b){for(var c=[],d=0;d<b;d++)c[d]=a;return c};goog.array.flatten=function(a){for(var b=[],c=0;c<arguments.length;c++){var d=arguments[c];goog.isArray(d)?b.push.apply(b,goog.array.flatten.apply(null,d)):b.push(d)}return b};
|
|
goog.array.rotate=function(a,b){a.length&&(b%=a.length,0<b?goog.array.ARRAY_PROTOTYPE_.unshift.apply(a,a.splice(-b,b)):0>b&&goog.array.ARRAY_PROTOTYPE_.push.apply(a,a.splice(0,-b)));return a};goog.array.moveItem=function(a,b,c){b=goog.array.ARRAY_PROTOTYPE_.splice.call(a,b,1);goog.array.ARRAY_PROTOTYPE_.splice.call(a,c,0,b[0])};goog.array.zip=function(a){if(!arguments.length)return[];for(var b=[],c=0;;c++){for(var d=[],e=0;e<arguments.length;e++){var f=arguments[e];if(c>=f.length)return b;d.push(f[c])}b.push(d)}};
|
|
goog.array.shuffle=function(a,b){for(var c=b||Math.random,d=a.length-1;0<d;d--){var e=Math.floor(c()*(d+1)),f=a[d];a[d]=a[e];a[e]=f}};ol.QuadKeyCharCode={ZERO:48,ONE:49,TWO:50,THREE:51};ol.TileCoord=function(a,b,c){this.z=a;this.x=b;this.y=c};ol.TileCoord.createFromQuadKey=function(a){var b=a.length,c=0,d=0,e=1<<b-1,f;for(f=0;f<b;++f){switch(a.charCodeAt(f)){case ol.QuadKeyCharCode.ONE:c+=e;break;case ol.QuadKeyCharCode.TWO:d+=e;break;case ol.QuadKeyCharCode.THREE:c+=e,d+=e}e>>=1}return new ol.TileCoord(b,c,d)};
|
|
ol.TileCoord.createFromString=function(a){a=a.split("/");a=goog.array.map(a,function(a,c,d){return parseInt(a,10)});return new ol.TileCoord(a[0],a[1],a[2])};ol.TileCoord.createOrUpdate=function(a,b,c,d){return goog.isDef(d)?(d.z=a,d.x=b,d.y=c,d):new ol.TileCoord(a,b,c)};ol.TileCoord.getKeyZXY=function(a,b,c){return a+"/"+b+"/"+c};ol.TileCoord.prototype.getZXY=function(a){return goog.isDef(a)?(a[0]=this.z,a[1]=this.x,a[2]=this.y,a):[this.z,this.x,this.y]};
|
|
ol.TileCoord.prototype.hash=function(){return(this.x<<this.z)+this.y};ol.TileCoord.prototype.quadKey=function(){var a=Array(this.z),b=1<<this.z-1,c,d;for(c=0;c<this.z;++c)d=ol.QuadKeyCharCode.ZERO,this.x&b&&(d+=1),this.y&b&&(d+=2),a[c]=String.fromCharCode(d),b>>=1;return a.join("")};ol.TileCoord.prototype.toString=function(){return ol.TileCoord.getKeyZXY(this.z,this.x,this.y)};ol.TileRange=function(a,b,c,d){this.minX=a;this.maxX=b;this.minY=c;this.maxY=d};ol.TileRange.boundingTileRange=function(a){var b=arguments[0],b=new ol.TileRange(b.x,b.x,b.y,b.y),c,d,e;c=1;for(d=arguments.length;c<d;++c)e=arguments[c],b.minX=Math.min(b.minX,e.x),b.maxX=Math.max(b.maxX,e.x),b.minY=Math.min(b.minY,e.y),b.maxY=Math.max(b.maxY,e.y);return b};ol.TileRange.createOrUpdate=function(a,b,c,d,e){return goog.isDef(e)?(e.minX=a,e.maxX=b,e.minY=c,e.maxY=d,e):new ol.TileRange(a,b,c,d)};
|
|
ol.TileRange.prototype.contains=function(a){return this.minX<=a.x&&a.x<=this.maxX&&this.minY<=a.y&&a.y<=this.maxY};ol.TileRange.prototype.containsTileRange=function(a){return this.minX<=a.minX&&a.maxX<=this.maxX&&this.minY<=a.minY&&a.maxY<=this.maxY};ol.TileRange.prototype.equals=function(a){return this.minX==a.minX&&this.minY==a.minY&&this.maxX==a.maxX&&this.maxY==a.maxY};
|
|
ol.TileRange.prototype.extend=function(a){a.minX<this.minX&&(this.minX=a.minX);a.maxX>this.maxX&&(this.maxX=a.maxX);a.minY<this.minY&&(this.minY=a.minY);a.maxY>this.maxY&&(this.maxY=a.maxY)};ol.TileRange.prototype.getHeight=function(){return this.maxY-this.minY+1};ol.TileRange.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]};ol.TileRange.prototype.getWidth=function(){return this.maxX-this.minX+1};
|
|
ol.TileRange.prototype.intersects=function(a){return this.minX<=a.maxX&&this.maxX>=a.minX&&this.minY<=a.maxY&&this.maxY>=a.minY};ol.Attribution=function(a){this.html_=a.html;this.tileRanges_=goog.isDef(a.tileRanges)?a.tileRanges:null};ol.Attribution.prototype.getHTML=function(){return this.html_};ol.Attribution.prototype.intersectsAnyTileRange=function(a){if(goog.isNull(this.tileRanges_))return!0;var b,c,d,e;for(e in a)if(e in this.tileRanges_)for(d=a[e],b=0,c=this.tileRanges_[e].length;b<c;++b)if(this.tileRanges_[e][b].intersects(d))return!0;return!1};goog.userAgent={};goog.userAgent.ASSUME_IE=!1;goog.userAgent.ASSUME_GECKO=!1;goog.userAgent.ASSUME_WEBKIT=!1;goog.userAgent.ASSUME_MOBILE_WEBKIT=!1;goog.userAgent.ASSUME_OPERA=!1;goog.userAgent.ASSUME_ANY_VERSION=!1;goog.userAgent.BROWSER_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_GECKO||goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_OPERA;
|
|
goog.userAgent.getUserAgentString=function(){return goog.global.navigator?goog.global.navigator.userAgent:null};goog.userAgent.getNavigator=function(){return goog.global.navigator};
|
|
goog.userAgent.init_=function(){goog.userAgent.detectedOpera_=!1;goog.userAgent.detectedIe_=!1;goog.userAgent.detectedWebkit_=!1;goog.userAgent.detectedMobile_=!1;goog.userAgent.detectedGecko_=!1;var a;if(!goog.userAgent.BROWSER_KNOWN_&&(a=goog.userAgent.getUserAgentString())){var b=goog.userAgent.getNavigator();goog.userAgent.detectedOpera_=goog.string.startsWith(a,"Opera");goog.userAgent.detectedIe_=!goog.userAgent.detectedOpera_&&(goog.string.contains(a,"MSIE")||goog.string.contains(a,"Trident"));
|
|
goog.userAgent.detectedWebkit_=!goog.userAgent.detectedOpera_&&goog.string.contains(a,"WebKit");goog.userAgent.detectedMobile_=goog.userAgent.detectedWebkit_&&goog.string.contains(a,"Mobile");goog.userAgent.detectedGecko_=!goog.userAgent.detectedOpera_&&!goog.userAgent.detectedWebkit_&&!goog.userAgent.detectedIe_&&"Gecko"==b.product}};goog.userAgent.BROWSER_KNOWN_||goog.userAgent.init_();goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:goog.userAgent.detectedOpera_;
|
|
goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:goog.userAgent.detectedIe_;goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:goog.userAgent.detectedGecko_;goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:goog.userAgent.detectedWebkit_;goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.detectedMobile_;goog.userAgent.SAFARI=goog.userAgent.WEBKIT;
|
|
goog.userAgent.determinePlatform_=function(){var a=goog.userAgent.getNavigator();return a&&a.platform||""};goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_();goog.userAgent.ASSUME_MAC=!1;goog.userAgent.ASSUME_WINDOWS=!1;goog.userAgent.ASSUME_LINUX=!1;goog.userAgent.ASSUME_X11=!1;goog.userAgent.ASSUME_ANDROID=!1;goog.userAgent.ASSUME_IPHONE=!1;goog.userAgent.ASSUME_IPAD=!1;
|
|
goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11||goog.userAgent.ASSUME_ANDROID||goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD;
|
|
goog.userAgent.initPlatform_=function(){goog.userAgent.detectedMac_=goog.string.contains(goog.userAgent.PLATFORM,"Mac");goog.userAgent.detectedWindows_=goog.string.contains(goog.userAgent.PLATFORM,"Win");goog.userAgent.detectedLinux_=goog.string.contains(goog.userAgent.PLATFORM,"Linux");goog.userAgent.detectedX11_=!!goog.userAgent.getNavigator()&&goog.string.contains(goog.userAgent.getNavigator().appVersion||"","X11");var a=goog.userAgent.getUserAgentString();goog.userAgent.detectedAndroid_=!!a&&
|
|
goog.string.contains(a,"Android");goog.userAgent.detectedIPhone_=!!a&&goog.string.contains(a,"iPhone");goog.userAgent.detectedIPad_=!!a&&goog.string.contains(a,"iPad")};goog.userAgent.PLATFORM_KNOWN_||goog.userAgent.initPlatform_();goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:goog.userAgent.detectedMac_;goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:goog.userAgent.detectedWindows_;
|
|
goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.detectedLinux_;goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.detectedX11_;goog.userAgent.ANDROID=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_ANDROID:goog.userAgent.detectedAndroid_;goog.userAgent.IPHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE:goog.userAgent.detectedIPhone_;
|
|
goog.userAgent.IPAD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPAD:goog.userAgent.detectedIPad_;
|
|
goog.userAgent.determineVersion_=function(){var a="",b;goog.userAgent.OPERA&&goog.global.opera?(a=goog.global.opera.version,a="function"==typeof a?a():a):(goog.userAgent.GECKO?b=/rv\:([^\);]+)(\)|;)/:goog.userAgent.IE?b=/\b(?:MSIE|rv)\s+([^\);]+)(\)|;)/:goog.userAgent.WEBKIT&&(b=/WebKit\/(\S+)/),b&&(a=(a=b.exec(goog.userAgent.getUserAgentString()))?a[1]:""));return goog.userAgent.IE&&(b=goog.userAgent.getDocumentMode_(),b>parseFloat(a))?String(b):a};
|
|
goog.userAgent.getDocumentMode_=function(){var a=goog.global.document;return a?a.documentMode:void 0};goog.userAgent.VERSION=goog.userAgent.determineVersion_();goog.userAgent.compare=function(a,b){return goog.string.compareVersions(a,b)};goog.userAgent.isVersionOrHigherCache_={};
|
|
goog.userAgent.isVersionOrHigher=function(a){return goog.userAgent.ASSUME_ANY_VERSION||goog.userAgent.isVersionOrHigherCache_[a]||(goog.userAgent.isVersionOrHigherCache_[a]=0<=goog.string.compareVersions(goog.userAgent.VERSION,a))};goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher;goog.userAgent.isDocumentModeOrHigher=function(a){return goog.userAgent.IE&&goog.userAgent.DOCUMENT_MODE>=a};goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher;
|
|
goog.userAgent.DOCUMENT_MODE=function(){var a=goog.global.document;return a&&goog.userAgent.IE?goog.userAgent.getDocumentMode_()||("CSS1Compat"==a.compatMode?parseInt(goog.userAgent.VERSION,10):5):void 0}();goog.dom={};goog.dom.BrowserFeature={CAN_ADD_NAME_OR_TYPE_ATTRIBUTES:!goog.userAgent.IE||goog.userAgent.isDocumentModeOrHigher(9),CAN_USE_CHILDREN_ATTRIBUTE:!goog.userAgent.GECKO&&!goog.userAgent.IE||goog.userAgent.IE&&goog.userAgent.isDocumentModeOrHigher(9)||goog.userAgent.GECKO&&goog.userAgent.isVersionOrHigher("1.9.1"),CAN_USE_INNER_TEXT:goog.userAgent.IE&&!goog.userAgent.isVersionOrHigher("9"),CAN_USE_PARENT_ELEMENT_PROPERTY:goog.userAgent.IE||goog.userAgent.OPERA||goog.userAgent.WEBKIT,INNER_HTML_NEEDS_SCOPED_ELEMENT:goog.userAgent.IE};goog.dom.TagName={A:"A",ABBR:"ABBR",ACRONYM:"ACRONYM",ADDRESS:"ADDRESS",APPLET:"APPLET",AREA:"AREA",ARTICLE:"ARTICLE",ASIDE:"ASIDE",AUDIO:"AUDIO",B:"B",BASE:"BASE",BASEFONT:"BASEFONT",BDI:"BDI",BDO:"BDO",BIG:"BIG",BLOCKQUOTE:"BLOCKQUOTE",BODY:"BODY",BR:"BR",BUTTON:"BUTTON",CANVAS:"CANVAS",CAPTION:"CAPTION",CENTER:"CENTER",CITE:"CITE",CODE:"CODE",COL:"COL",COLGROUP:"COLGROUP",COMMAND:"COMMAND",DATA:"DATA",DATALIST:"DATALIST",DD:"DD",DEL:"DEL",DETAILS:"DETAILS",DFN:"DFN",DIALOG:"DIALOG",DIR:"DIR",DIV:"DIV",
|
|
DL:"DL",DT:"DT",EM:"EM",EMBED:"EMBED",FIELDSET:"FIELDSET",FIGCAPTION:"FIGCAPTION",FIGURE:"FIGURE",FONT:"FONT",FOOTER:"FOOTER",FORM:"FORM",FRAME:"FRAME",FRAMESET:"FRAMESET",H1:"H1",H2:"H2",H3:"H3",H4:"H4",H5:"H5",H6:"H6",HEAD:"HEAD",HEADER:"HEADER",HGROUP:"HGROUP",HR:"HR",HTML:"HTML",I:"I",IFRAME:"IFRAME",IMG:"IMG",INPUT:"INPUT",INS:"INS",ISINDEX:"ISINDEX",KBD:"KBD",KEYGEN:"KEYGEN",LABEL:"LABEL",LEGEND:"LEGEND",LI:"LI",LINK:"LINK",MAP:"MAP",MARK:"MARK",MATH:"MATH",MENU:"MENU",META:"META",METER:"METER",
|
|
NAV:"NAV",NOFRAMES:"NOFRAMES",NOSCRIPT:"NOSCRIPT",OBJECT:"OBJECT",OL:"OL",OPTGROUP:"OPTGROUP",OPTION:"OPTION",OUTPUT:"OUTPUT",P:"P",PARAM:"PARAM",PRE:"PRE",PROGRESS:"PROGRESS",Q:"Q",RP:"RP",RT:"RT",RUBY:"RUBY",S:"S",SAMP:"SAMP",SCRIPT:"SCRIPT",SECTION:"SECTION",SELECT:"SELECT",SMALL:"SMALL",SOURCE:"SOURCE",SPAN:"SPAN",STRIKE:"STRIKE",STRONG:"STRONG",STYLE:"STYLE",SUB:"SUB",SUMMARY:"SUMMARY",SUP:"SUP",SVG:"SVG",TABLE:"TABLE",TBODY:"TBODY",TD:"TD",TEXTAREA:"TEXTAREA",TFOOT:"TFOOT",TH:"TH",THEAD:"THEAD",
|
|
TIME:"TIME",TITLE:"TITLE",TR:"TR",TRACK:"TRACK",TT:"TT",U:"U",UL:"UL",VAR:"VAR",VIDEO:"VIDEO",WBR:"WBR"};goog.dom.classes={};goog.dom.classes.set=function(a,b){a.className=b};goog.dom.classes.get=function(a){a=a.className;return goog.isString(a)&&a.match(/\S+/g)||[]};goog.dom.classes.add=function(a,b){var c=goog.dom.classes.get(a),d=goog.array.slice(arguments,1),e=c.length+d.length;goog.dom.classes.add_(c,d);goog.dom.classes.set(a,c.join(" "));return c.length==e};
|
|
goog.dom.classes.remove=function(a,b){var c=goog.dom.classes.get(a),d=goog.array.slice(arguments,1),e=goog.dom.classes.getDifference_(c,d);goog.dom.classes.set(a,e.join(" "));return e.length==c.length-d.length};goog.dom.classes.add_=function(a,b){for(var c=0;c<b.length;c++)goog.array.contains(a,b[c])||a.push(b[c])};goog.dom.classes.getDifference_=function(a,b){return goog.array.filter(a,function(a){return!goog.array.contains(b,a)})};
|
|
goog.dom.classes.swap=function(a,b,c){for(var d=goog.dom.classes.get(a),e=!1,f=0;f<d.length;f++)d[f]==b&&(goog.array.splice(d,f--,1),e=!0);e&&(d.push(c),goog.dom.classes.set(a,d.join(" ")));return e};goog.dom.classes.addRemove=function(a,b,c){var d=goog.dom.classes.get(a);goog.isString(b)?goog.array.remove(d,b):goog.isArray(b)&&(d=goog.dom.classes.getDifference_(d,b));goog.isString(c)&&!goog.array.contains(d,c)?d.push(c):goog.isArray(c)&&goog.dom.classes.add_(d,c);goog.dom.classes.set(a,d.join(" "))};
|
|
goog.dom.classes.has=function(a,b){return goog.array.contains(goog.dom.classes.get(a),b)};goog.dom.classes.enable=function(a,b,c){c?goog.dom.classes.add(a,b):goog.dom.classes.remove(a,b)};goog.dom.classes.toggle=function(a,b){var c=!goog.dom.classes.has(a,b);goog.dom.classes.enable(a,b,c);return c};goog.math={};goog.math.randomInt=function(a){return Math.floor(Math.random()*a)};goog.math.uniformRandom=function(a,b){return a+Math.random()*(b-a)};goog.math.clamp=function(a,b,c){return Math.min(Math.max(a,b),c)};goog.math.modulo=function(a,b){var c=a%b;return 0>c*b?c+b:c};goog.math.lerp=function(a,b,c){return a+c*(b-a)};goog.math.nearlyEquals=function(a,b,c){return Math.abs(a-b)<=(c||1E-6)};goog.math.standardAngle=function(a){return goog.math.modulo(a,360)};
|
|
goog.math.toRadians=function(a){return a*Math.PI/180};goog.math.toDegrees=function(a){return 180*a/Math.PI};goog.math.angleDx=function(a,b){return b*Math.cos(goog.math.toRadians(a))};goog.math.angleDy=function(a,b){return b*Math.sin(goog.math.toRadians(a))};goog.math.angle=function(a,b,c,d){return goog.math.standardAngle(goog.math.toDegrees(Math.atan2(d-b,c-a)))};goog.math.angleDifference=function(a,b){var c=goog.math.standardAngle(b)-goog.math.standardAngle(a);180<c?c-=360:-180>=c&&(c=360+c);return c};
|
|
goog.math.sign=function(a){return 0==a?0:0>a?-1:1};goog.math.longestCommonSubsequence=function(a,b,c,d){c=c||function(a,b){return a==b};d=d||function(b,c){return a[b]};for(var e=a.length,f=b.length,g=[],h=0;h<e+1;h++)g[h]=[],g[h][0]=0;for(var k=0;k<f+1;k++)g[0][k]=0;for(h=1;h<=e;h++)for(k=1;k<=f;k++)c(a[h-1],b[k-1])?g[h][k]=g[h-1][k-1]+1:g[h][k]=Math.max(g[h-1][k],g[h][k-1]);for(var l=[],h=e,k=f;0<h&&0<k;)c(a[h-1],b[k-1])?(l.unshift(d(h-1,k-1)),h--,k--):g[h-1][k]>g[h][k-1]?h--:k--;return l};
|
|
goog.math.sum=function(a){return goog.array.reduce(arguments,function(a,c){return a+c},0)};goog.math.average=function(a){return goog.math.sum.apply(null,arguments)/arguments.length};goog.math.standardDeviation=function(a){var b=arguments.length;if(2>b)return 0;var c=goog.math.average.apply(null,arguments),b=goog.math.sum.apply(null,goog.array.map(arguments,function(a){return Math.pow(a-c,2)}))/(b-1);return Math.sqrt(b)};goog.math.isInt=function(a){return isFinite(a)&&0==a%1};
|
|
goog.math.isFiniteNumber=function(a){return isFinite(a)&&!isNaN(a)};goog.math.safeFloor=function(a,b){return Math.floor(a+(b||2E-15))};goog.math.safeCeil=function(a,b){return Math.ceil(a-(b||2E-15))};goog.math.Coordinate=function(a,b){this.x=goog.isDef(a)?a:0;this.y=goog.isDef(b)?b:0};goog.math.Coordinate.prototype.clone=function(){return new goog.math.Coordinate(this.x,this.y)};goog.DEBUG&&(goog.math.Coordinate.prototype.toString=function(){return"("+this.x+", "+this.y+")"});goog.math.Coordinate.equals=function(a,b){return a==b?!0:a&&b?a.x==b.x&&a.y==b.y:!1};goog.math.Coordinate.distance=function(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)};
|
|
goog.math.Coordinate.magnitude=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)};goog.math.Coordinate.azimuth=function(a){return goog.math.angle(0,0,a.x,a.y)};goog.math.Coordinate.squaredDistance=function(a,b){var c=a.x-b.x,d=a.y-b.y;return c*c+d*d};goog.math.Coordinate.difference=function(a,b){return new goog.math.Coordinate(a.x-b.x,a.y-b.y)};goog.math.Coordinate.sum=function(a,b){return new goog.math.Coordinate(a.x+b.x,a.y+b.y)};
|
|
goog.math.Coordinate.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};goog.math.Coordinate.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};goog.math.Coordinate.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};goog.math.Coordinate.prototype.translate=function(a,b){a instanceof goog.math.Coordinate?(this.x+=a.x,this.y+=a.y):(this.x+=a,goog.isNumber(b)&&(this.y+=b));return this};
|
|
goog.math.Coordinate.prototype.scale=function(a,b){var c=goog.isNumber(b)?b:a;this.x*=a;this.y*=c;return this};goog.math.Size=function(a,b){this.width=a;this.height=b};goog.math.Size.equals=function(a,b){return a==b?!0:a&&b?a.width==b.width&&a.height==b.height:!1};goog.math.Size.prototype.clone=function(){return new goog.math.Size(this.width,this.height)};goog.DEBUG&&(goog.math.Size.prototype.toString=function(){return"("+this.width+" x "+this.height+")"});goog.math.Size.prototype.getLongest=function(){return Math.max(this.width,this.height)};
|
|
goog.math.Size.prototype.getShortest=function(){return Math.min(this.width,this.height)};goog.math.Size.prototype.area=function(){return this.width*this.height};goog.math.Size.prototype.perimeter=function(){return 2*(this.width+this.height)};goog.math.Size.prototype.aspectRatio=function(){return this.width/this.height};goog.math.Size.prototype.isEmpty=function(){return!this.area()};goog.math.Size.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};
|
|
goog.math.Size.prototype.fitsInside=function(a){return this.width<=a.width&&this.height<=a.height};goog.math.Size.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};goog.math.Size.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};goog.math.Size.prototype.scale=function(a,b){var c=goog.isNumber(b)?b:a;this.width*=a;this.height*=c;return this};
|
|
goog.math.Size.prototype.scaleToFit=function(a){a=this.aspectRatio()>a.aspectRatio()?a.width/this.width:a.height/this.height;return this.scale(a)};goog.object={};goog.object.forEach=function(a,b,c){for(var d in a)b.call(c,a[d],d,a)};goog.object.filter=function(a,b,c){var d={},e;for(e in a)b.call(c,a[e],e,a)&&(d[e]=a[e]);return d};goog.object.map=function(a,b,c){var d={},e;for(e in a)d[e]=b.call(c,a[e],e,a);return d};goog.object.some=function(a,b,c){for(var d in a)if(b.call(c,a[d],d,a))return!0;return!1};goog.object.every=function(a,b,c){for(var d in a)if(!b.call(c,a[d],d,a))return!1;return!0};
|
|
goog.object.getCount=function(a){var b=0,c;for(c in a)b++;return b};goog.object.getAnyKey=function(a){for(var b in a)return b};goog.object.getAnyValue=function(a){for(var b in a)return a[b]};goog.object.contains=function(a,b){return goog.object.containsValue(a,b)};goog.object.getValues=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b};goog.object.getKeys=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b};
|
|
goog.object.getValueByKeys=function(a,b){for(var c=goog.isArrayLike(b),d=c?b:arguments,c=c?0:1;c<d.length&&(a=a[d[c]],goog.isDef(a));c++);return a};goog.object.containsKey=function(a,b){return b in a};goog.object.containsValue=function(a,b){for(var c in a)if(a[c]==b)return!0;return!1};goog.object.findKey=function(a,b,c){for(var d in a)if(b.call(c,a[d],d,a))return d};goog.object.findValue=function(a,b,c){return(b=goog.object.findKey(a,b,c))&&a[b]};
|
|
goog.object.isEmpty=function(a){for(var b in a)return!1;return!0};goog.object.clear=function(a){for(var b in a)delete a[b]};goog.object.remove=function(a,b){var c;(c=b in a)&&delete a[b];return c};goog.object.add=function(a,b,c){if(b in a)throw Error('The object already contains the key "'+b+'"');goog.object.set(a,b,c)};goog.object.get=function(a,b,c){return b in a?a[b]:c};goog.object.set=function(a,b,c){a[b]=c};goog.object.setIfUndefined=function(a,b,c){return b in a?a[b]:a[b]=c};
|
|
goog.object.clone=function(a){var b={},c;for(c in a)b[c]=a[c];return b};goog.object.unsafeClone=function(a){var b=goog.typeOf(a);if("object"==b||"array"==b){if(a.clone)return a.clone();var b="array"==b?[]:{},c;for(c in a)b[c]=goog.object.unsafeClone(a[c]);return b}return a};goog.object.transpose=function(a){var b={},c;for(c in a)b[a[c]]=c;return b};goog.object.PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
|
|
goog.object.extend=function(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<goog.object.PROTOTYPE_FIELDS_.length;f++)c=goog.object.PROTOTYPE_FIELDS_[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};
|
|
goog.object.create=function(a){var b=arguments.length;if(1==b&&goog.isArray(arguments[0]))return goog.object.create.apply(null,arguments[0]);if(b%2)throw Error("Uneven number of arguments");for(var c={},d=0;d<b;d+=2)c[arguments[d]]=arguments[d+1];return c};goog.object.createSet=function(a){var b=arguments.length;if(1==b&&goog.isArray(arguments[0]))return goog.object.createSet.apply(null,arguments[0]);for(var c={},d=0;d<b;d++)c[arguments[d]]=!0;return c};
|
|
goog.object.createImmutableView=function(a){var b=a;Object.isFrozen&&!Object.isFrozen(a)&&(b=Object.create(a),Object.freeze(b));return b};goog.object.isImmutableView=function(a){return!!Object.isFrozen&&Object.isFrozen(a)};goog.dom.ASSUME_QUIRKS_MODE=!1;goog.dom.ASSUME_STANDARDS_MODE=!0;goog.dom.COMPAT_MODE_KNOWN_=goog.dom.ASSUME_QUIRKS_MODE||goog.dom.ASSUME_STANDARDS_MODE;goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};goog.dom.getDomHelper=function(a){return a?new goog.dom.DomHelper(goog.dom.getOwnerDocument(a)):goog.dom.defaultDomHelper_||(goog.dom.defaultDomHelper_=new goog.dom.DomHelper)};
|
|
goog.dom.getDocument=function(){return document};goog.dom.getElement=function(a){return goog.isString(a)?document.getElementById(a):a};goog.dom.$=goog.dom.getElement;goog.dom.getElementsByTagNameAndClass=function(a,b,c){return goog.dom.getElementsByTagNameAndClass_(document,a,b,c)};
|
|
goog.dom.getElementsByClass=function(a,b){var c=b||document;return goog.dom.canUseQuerySelector_(c)?c.querySelectorAll("."+a):c.getElementsByClassName?c.getElementsByClassName(a):goog.dom.getElementsByTagNameAndClass_(document,"*",a,b)};goog.dom.getElementByClass=function(a,b){var c=b||document,d=null;return(d=goog.dom.canUseQuerySelector_(c)?c.querySelector("."+a):goog.dom.getElementsByClass(a,b)[0])||null};goog.dom.canUseQuerySelector_=function(a){return!(!a.querySelectorAll||!a.querySelector)};
|
|
goog.dom.getElementsByTagNameAndClass_=function(a,b,c,d){a=d||a;b=b&&"*"!=b?b.toUpperCase():"";if(goog.dom.canUseQuerySelector_(a)&&(b||c))return a.querySelectorAll(b+(c?"."+c:""));if(c&&a.getElementsByClassName){a=a.getElementsByClassName(c);if(b){d={};for(var e=0,f=0,g;g=a[f];f++)b==g.nodeName&&(d[e++]=g);d.length=e;return d}return a}a=a.getElementsByTagName(b||"*");if(c){d={};for(f=e=0;g=a[f];f++)b=g.className,"function"==typeof b.split&&goog.array.contains(b.split(/\s+/),c)&&(d[e++]=g);d.length=
|
|
e;return d}return a};goog.dom.$$=goog.dom.getElementsByTagNameAndClass;goog.dom.setProperties=function(a,b){goog.object.forEach(b,function(b,d){"style"==d?a.style.cssText=b:"class"==d?a.className=b:"for"==d?a.htmlFor=b:d in goog.dom.DIRECT_ATTRIBUTE_MAP_?a.setAttribute(goog.dom.DIRECT_ATTRIBUTE_MAP_[d],b):goog.string.startsWith(d,"aria-")||goog.string.startsWith(d,"data-")?a.setAttribute(d,b):a[d]=b})};
|
|
goog.dom.DIRECT_ATTRIBUTE_MAP_={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};goog.dom.getViewportSize=function(a){return goog.dom.getViewportSize_(a||window)};goog.dom.getViewportSize_=function(a){a=a.document;a=goog.dom.isCss1CompatMode_(a)?a.documentElement:a.body;return new goog.math.Size(a.clientWidth,a.clientHeight)};
|
|
goog.dom.getDocumentHeight=function(){return goog.dom.getDocumentHeight_(window)};goog.dom.getDocumentHeight_=function(a){var b=a.document,c=0;if(b){a=goog.dom.getViewportSize_(a).height;var c=b.body,d=b.documentElement;if(goog.dom.isCss1CompatMode_(b)&&d.scrollHeight)c=d.scrollHeight!=a?d.scrollHeight:d.offsetHeight;else{var b=d.scrollHeight,e=d.offsetHeight;d.clientHeight!=e&&(b=c.scrollHeight,e=c.offsetHeight);c=b>a?b>e?b:e:b<e?b:e}}return c};
|
|
goog.dom.getPageScroll=function(a){return goog.dom.getDomHelper((a||goog.global||window).document).getDocumentScroll()};goog.dom.getDocumentScroll=function(){return goog.dom.getDocumentScroll_(document)};
|
|
goog.dom.getDocumentScroll_=function(a){var b=goog.dom.getDocumentScrollElement_(a);a=goog.dom.getWindow_(a);return goog.userAgent.IE&&goog.userAgent.isVersionOrHigher("10")&&a.pageYOffset!=b.scrollTop?new goog.math.Coordinate(b.scrollLeft,b.scrollTop):new goog.math.Coordinate(a.pageXOffset||b.scrollLeft,a.pageYOffset||b.scrollTop)};goog.dom.getDocumentScrollElement=function(){return goog.dom.getDocumentScrollElement_(document)};
|
|
goog.dom.getDocumentScrollElement_=function(a){return!goog.userAgent.WEBKIT&&goog.dom.isCss1CompatMode_(a)?a.documentElement:a.body};goog.dom.getWindow=function(a){return a?goog.dom.getWindow_(a):window};goog.dom.getWindow_=function(a){return a.parentWindow||a.defaultView};goog.dom.createDom=function(a,b,c){return goog.dom.createDom_(document,arguments)};
|
|
goog.dom.createDom_=function(a,b){var c=b[0],d=b[1];if(!goog.dom.BrowserFeature.CAN_ADD_NAME_OR_TYPE_ATTRIBUTES&&d&&(d.name||d.type)){c=["\x3c",c];d.name&&c.push(' name\x3d"',goog.string.htmlEscape(d.name),'"');if(d.type){c.push(' type\x3d"',goog.string.htmlEscape(d.type),'"');var e={};goog.object.extend(e,d);delete e.type;d=e}c.push("\x3e");c=c.join("")}c=a.createElement(c);d&&(goog.isString(d)?c.className=d:goog.isArray(d)?goog.dom.classes.add.apply(null,[c].concat(d)):goog.dom.setProperties(c,
|
|
d));2<b.length&&goog.dom.append_(a,c,b,2);return c};goog.dom.append_=function(a,b,c,d){function e(c){c&&b.appendChild(goog.isString(c)?a.createTextNode(c):c)}for(;d<c.length;d++){var f=c[d];goog.isArrayLike(f)&&!goog.dom.isNodeLike(f)?goog.array.forEach(goog.dom.isNodeList(f)?goog.array.toArray(f):f,e):e(f)}};goog.dom.$dom=goog.dom.createDom;goog.dom.createElement=function(a){return document.createElement(a)};goog.dom.createTextNode=function(a){return document.createTextNode(String(a))};
|
|
goog.dom.createTable=function(a,b,c){return goog.dom.createTable_(document,a,b,!!c)};goog.dom.createTable_=function(a,b,c,d){for(var e=["\x3ctr\x3e"],f=0;f<c;f++)e.push(d?"\x3ctd\x3e\x26nbsp;\x3c/td\x3e":"\x3ctd\x3e\x3c/td\x3e");e.push("\x3c/tr\x3e");e=e.join("");c=["\x3ctable\x3e"];for(f=0;f<b;f++)c.push(e);c.push("\x3c/table\x3e");a=a.createElement(goog.dom.TagName.DIV);a.innerHTML=c.join("");return a.removeChild(a.firstChild)};
|
|
goog.dom.htmlToDocumentFragment=function(a){return goog.dom.htmlToDocumentFragment_(document,a)};goog.dom.htmlToDocumentFragment_=function(a,b){var c=a.createElement("div");goog.dom.BrowserFeature.INNER_HTML_NEEDS_SCOPED_ELEMENT?(c.innerHTML="\x3cbr\x3e"+b,c.removeChild(c.firstChild)):c.innerHTML=b;if(1==c.childNodes.length)return c.removeChild(c.firstChild);for(var d=a.createDocumentFragment();c.firstChild;)d.appendChild(c.firstChild);return d};
|
|
goog.dom.getCompatMode=function(){return goog.dom.isCss1CompatMode()?"CSS1Compat":"BackCompat"};goog.dom.isCss1CompatMode=function(){return goog.dom.isCss1CompatMode_(document)};goog.dom.isCss1CompatMode_=function(a){return goog.dom.COMPAT_MODE_KNOWN_?goog.dom.ASSUME_STANDARDS_MODE:"CSS1Compat"==a.compatMode};goog.dom.canHaveChildren=function(a){if(a.nodeType!=goog.dom.NodeType.ELEMENT)return!1;switch(a.tagName){case goog.dom.TagName.APPLET:case goog.dom.TagName.AREA:case goog.dom.TagName.BASE:case goog.dom.TagName.BR:case goog.dom.TagName.COL:case goog.dom.TagName.COMMAND:case goog.dom.TagName.EMBED:case goog.dom.TagName.FRAME:case goog.dom.TagName.HR:case goog.dom.TagName.IMG:case goog.dom.TagName.INPUT:case goog.dom.TagName.IFRAME:case goog.dom.TagName.ISINDEX:case goog.dom.TagName.KEYGEN:case goog.dom.TagName.LINK:case goog.dom.TagName.NOFRAMES:case goog.dom.TagName.NOSCRIPT:case goog.dom.TagName.META:case goog.dom.TagName.OBJECT:case goog.dom.TagName.PARAM:case goog.dom.TagName.SCRIPT:case goog.dom.TagName.SOURCE:case goog.dom.TagName.STYLE:case goog.dom.TagName.TRACK:case goog.dom.TagName.WBR:return!1}return!0};
|
|
goog.dom.appendChild=function(a,b){a.appendChild(b)};goog.dom.append=function(a,b){goog.dom.append_(goog.dom.getOwnerDocument(a),a,arguments,1)};goog.dom.removeChildren=function(a){for(var b;b=a.firstChild;)a.removeChild(b)};goog.dom.insertSiblingBefore=function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b)};goog.dom.insertSiblingAfter=function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b.nextSibling)};goog.dom.insertChildAt=function(a,b,c){a.insertBefore(b,a.childNodes[c]||null)};
|
|
goog.dom.removeNode=function(a){return a&&a.parentNode?a.parentNode.removeChild(a):null};goog.dom.replaceNode=function(a,b){var c=b.parentNode;c&&c.replaceChild(a,b)};goog.dom.flattenElement=function(a){var b,c=a.parentNode;if(c&&c.nodeType!=goog.dom.NodeType.DOCUMENT_FRAGMENT){if(a.removeNode)return a.removeNode(!1);for(;b=a.firstChild;)c.insertBefore(b,a);return goog.dom.removeNode(a)}};
|
|
goog.dom.getChildren=function(a){return goog.dom.BrowserFeature.CAN_USE_CHILDREN_ATTRIBUTE&&void 0!=a.children?a.children:goog.array.filter(a.childNodes,function(a){return a.nodeType==goog.dom.NodeType.ELEMENT})};goog.dom.getFirstElementChild=function(a){return void 0!=a.firstElementChild?a.firstElementChild:goog.dom.getNextElementNode_(a.firstChild,!0)};goog.dom.getLastElementChild=function(a){return void 0!=a.lastElementChild?a.lastElementChild:goog.dom.getNextElementNode_(a.lastChild,!1)};
|
|
goog.dom.getNextElementSibling=function(a){return void 0!=a.nextElementSibling?a.nextElementSibling:goog.dom.getNextElementNode_(a.nextSibling,!0)};goog.dom.getPreviousElementSibling=function(a){return void 0!=a.previousElementSibling?a.previousElementSibling:goog.dom.getNextElementNode_(a.previousSibling,!1)};goog.dom.getNextElementNode_=function(a,b){for(;a&&a.nodeType!=goog.dom.NodeType.ELEMENT;)a=b?a.nextSibling:a.previousSibling;return a};
|
|
goog.dom.getNextNode=function(a){if(!a)return null;if(a.firstChild)return a.firstChild;for(;a&&!a.nextSibling;)a=a.parentNode;return a?a.nextSibling:null};goog.dom.getPreviousNode=function(a){if(!a)return null;if(!a.previousSibling)return a.parentNode;for(a=a.previousSibling;a&&a.lastChild;)a=a.lastChild;return a};goog.dom.isNodeLike=function(a){return goog.isObject(a)&&0<a.nodeType};goog.dom.isElement=function(a){return goog.isObject(a)&&a.nodeType==goog.dom.NodeType.ELEMENT};
|
|
goog.dom.isWindow=function(a){return goog.isObject(a)&&a.window==a};goog.dom.getParentElement=function(a){if(goog.dom.BrowserFeature.CAN_USE_PARENT_ELEMENT_PROPERTY&&!(goog.userAgent.IE&&goog.userAgent.isVersionOrHigher("9")&&!goog.userAgent.isVersionOrHigher("10")&&goog.global.SVGElement&&a instanceof goog.global.SVGElement))return a.parentElement;a=a.parentNode;return goog.dom.isElement(a)?a:null};
|
|
goog.dom.contains=function(a,b){if(a.contains&&b.nodeType==goog.dom.NodeType.ELEMENT)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a};
|
|
goog.dom.compareNodeOrder=function(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(goog.userAgent.IE&&!goog.userAgent.isDocumentModeOrHigher(9)){if(a.nodeType==goog.dom.NodeType.DOCUMENT)return-1;if(b.nodeType==goog.dom.NodeType.DOCUMENT)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=a.nodeType==goog.dom.NodeType.ELEMENT,d=b.nodeType==goog.dom.NodeType.ELEMENT;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,
|
|
f=b.parentNode;return e==f?goog.dom.compareSiblingOrder_(a,b):!c&&goog.dom.contains(e,b)?-1*goog.dom.compareParentsDescendantNodeIe_(a,b):!d&&goog.dom.contains(f,a)?goog.dom.compareParentsDescendantNodeIe_(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=goog.dom.getOwnerDocument(a);c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(goog.global.Range.START_TO_END,d)};
|
|
goog.dom.compareParentsDescendantNodeIe_=function(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return goog.dom.compareSiblingOrder_(d,a)};goog.dom.compareSiblingOrder_=function(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};
|
|
goog.dom.findCommonAncestor=function(a){var b,c=arguments.length;if(!c)return null;if(1==c)return arguments[0];var d=[],e=Infinity;for(b=0;b<c;b++){for(var f=[],g=arguments[b];g;)f.unshift(g),g=g.parentNode;d.push(f);e=Math.min(e,f.length)}f=null;for(b=0;b<e;b++){for(var g=d[0][b],h=1;h<c;h++)if(g!=d[h][b])return f;f=g}return f};goog.dom.getOwnerDocument=function(a){return a.nodeType==goog.dom.NodeType.DOCUMENT?a:a.ownerDocument||a.document};
|
|
goog.dom.getFrameContentDocument=function(a){return a.contentDocument||a.contentWindow.document};goog.dom.getFrameContentWindow=function(a){return a.contentWindow||goog.dom.getWindow_(goog.dom.getFrameContentDocument(a))};
|
|
goog.dom.setTextContent=function(a,b){if("textContent"in a)a.textContent=b;else if(a.firstChild&&a.firstChild.nodeType==goog.dom.NodeType.TEXT){for(;a.lastChild!=a.firstChild;)a.removeChild(a.lastChild);a.firstChild.data=b}else{goog.dom.removeChildren(a);var c=goog.dom.getOwnerDocument(a);a.appendChild(c.createTextNode(String(b)))}};goog.dom.getOuterHtml=function(a){if("outerHTML"in a)return a.outerHTML;var b=goog.dom.getOwnerDocument(a).createElement("div");b.appendChild(a.cloneNode(!0));return b.innerHTML};
|
|
goog.dom.findNode=function(a,b){var c=[];return goog.dom.findNodes_(a,b,c,!0)?c[0]:void 0};goog.dom.findNodes=function(a,b){var c=[];goog.dom.findNodes_(a,b,c,!1);return c};goog.dom.findNodes_=function(a,b,c,d){if(null!=a)for(a=a.firstChild;a;){if(b(a)&&(c.push(a),d)||goog.dom.findNodes_(a,b,c,d))return!0;a=a.nextSibling}return!1};goog.dom.TAGS_TO_IGNORE_={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1};goog.dom.PREDEFINED_TAG_VALUES_={IMG:" ",BR:"\n"};
|
|
goog.dom.isFocusableTabIndex=function(a){var b=a.getAttributeNode("tabindex");return b&&b.specified?(a=a.tabIndex,goog.isNumber(a)&&0<=a&&32768>a):!1};goog.dom.setFocusableTabIndex=function(a,b){b?a.tabIndex=0:(a.tabIndex=-1,a.removeAttribute("tabIndex"))};
|
|
goog.dom.getTextContent=function(a){if(goog.dom.BrowserFeature.CAN_USE_INNER_TEXT&&"innerText"in a)a=goog.string.canonicalizeNewlines(a.innerText);else{var b=[];goog.dom.getTextContent_(a,b,!0);a=b.join("")}a=a.replace(/ \xAD /g," ").replace(/\xAD/g,"");a=a.replace(/\u200B/g,"");goog.dom.BrowserFeature.CAN_USE_INNER_TEXT||(a=a.replace(/ +/g," "));" "!=a&&(a=a.replace(/^\s*/,""));return a};goog.dom.getRawTextContent=function(a){var b=[];goog.dom.getTextContent_(a,b,!1);return b.join("")};
|
|
goog.dom.getTextContent_=function(a,b,c){if(!(a.nodeName in goog.dom.TAGS_TO_IGNORE_))if(a.nodeType==goog.dom.NodeType.TEXT)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in goog.dom.PREDEFINED_TAG_VALUES_)b.push(goog.dom.PREDEFINED_TAG_VALUES_[a.nodeName]);else for(a=a.firstChild;a;)goog.dom.getTextContent_(a,b,c),a=a.nextSibling};goog.dom.getNodeTextLength=function(a){return goog.dom.getTextContent(a).length};
|
|
goog.dom.getNodeTextOffset=function(a,b){for(var c=b||goog.dom.getOwnerDocument(a).body,d=[];a&&a!=c;){for(var e=a;e=e.previousSibling;)d.unshift(goog.dom.getTextContent(e));a=a.parentNode}return goog.string.trimLeft(d.join("")).replace(/ +/g," ").length};
|
|
goog.dom.getNodeAtOffset=function(a,b,c){a=[a];for(var d=0,e=null;0<a.length&&d<b;)if(e=a.pop(),!(e.nodeName in goog.dom.TAGS_TO_IGNORE_))if(e.nodeType==goog.dom.NodeType.TEXT)var f=e.nodeValue.replace(/(\r\n|\r|\n)/g,"").replace(/ +/g," "),d=d+f.length;else if(e.nodeName in goog.dom.PREDEFINED_TAG_VALUES_)d+=goog.dom.PREDEFINED_TAG_VALUES_[e.nodeName].length;else for(f=e.childNodes.length-1;0<=f;f--)a.push(e.childNodes[f]);goog.isObject(c)&&(c.remainder=e?e.nodeValue.length+b-d-1:0,c.node=e);return e};
|
|
goog.dom.isNodeList=function(a){if(a&&"number"==typeof a.length){if(goog.isObject(a))return"function"==typeof a.item||"string"==typeof a.item;if(goog.isFunction(a))return"function"==typeof a.item}return!1};goog.dom.getAncestorByTagNameAndClass=function(a,b,c){if(!b&&!c)return null;var d=b?b.toUpperCase():null;return goog.dom.getAncestor(a,function(a){return(!d||a.nodeName==d)&&(!c||goog.dom.classes.has(a,c))},!0)};
|
|
goog.dom.getAncestorByClass=function(a,b){return goog.dom.getAncestorByTagNameAndClass(a,null,b)};goog.dom.getAncestor=function(a,b,c,d){c||(a=a.parentNode);c=null==d;for(var e=0;a&&(c||e<=d);){if(b(a))return a;a=a.parentNode;e++}return null};goog.dom.getActiveElement=function(a){try{return a&&a.activeElement}catch(b){}return null};goog.dom.DomHelper=function(a){this.document_=a||goog.global.document||document};goog.dom.DomHelper.prototype.getDomHelper=goog.dom.getDomHelper;
|
|
goog.dom.DomHelper.prototype.setDocument=function(a){this.document_=a};goog.dom.DomHelper.prototype.getDocument=function(){return this.document_};goog.dom.DomHelper.prototype.getElement=function(a){return goog.isString(a)?this.document_.getElementById(a):a};goog.dom.DomHelper.prototype.$=goog.dom.DomHelper.prototype.getElement;goog.dom.DomHelper.prototype.getElementsByTagNameAndClass=function(a,b,c){return goog.dom.getElementsByTagNameAndClass_(this.document_,a,b,c)};
|
|
goog.dom.DomHelper.prototype.getElementsByClass=function(a,b){return goog.dom.getElementsByClass(a,b||this.document_)};goog.dom.DomHelper.prototype.getElementByClass=function(a,b){return goog.dom.getElementByClass(a,b||this.document_)};goog.dom.DomHelper.prototype.$$=goog.dom.DomHelper.prototype.getElementsByTagNameAndClass;goog.dom.DomHelper.prototype.setProperties=goog.dom.setProperties;goog.dom.DomHelper.prototype.getViewportSize=function(a){return goog.dom.getViewportSize(a||this.getWindow())};
|
|
goog.dom.DomHelper.prototype.getDocumentHeight=function(){return goog.dom.getDocumentHeight_(this.getWindow())};goog.dom.DomHelper.prototype.createDom=function(a,b,c){return goog.dom.createDom_(this.document_,arguments)};goog.dom.DomHelper.prototype.$dom=goog.dom.DomHelper.prototype.createDom;goog.dom.DomHelper.prototype.createElement=function(a){return this.document_.createElement(a)};goog.dom.DomHelper.prototype.createTextNode=function(a){return this.document_.createTextNode(String(a))};
|
|
goog.dom.DomHelper.prototype.createTable=function(a,b,c){return goog.dom.createTable_(this.document_,a,b,!!c)};goog.dom.DomHelper.prototype.htmlToDocumentFragment=function(a){return goog.dom.htmlToDocumentFragment_(this.document_,a)};goog.dom.DomHelper.prototype.getCompatMode=function(){return this.isCss1CompatMode()?"CSS1Compat":"BackCompat"};goog.dom.DomHelper.prototype.isCss1CompatMode=function(){return goog.dom.isCss1CompatMode_(this.document_)};goog.dom.DomHelper.prototype.getWindow=function(){return goog.dom.getWindow_(this.document_)};
|
|
goog.dom.DomHelper.prototype.getDocumentScrollElement=function(){return goog.dom.getDocumentScrollElement_(this.document_)};goog.dom.DomHelper.prototype.getDocumentScroll=function(){return goog.dom.getDocumentScroll_(this.document_)};goog.dom.DomHelper.prototype.getActiveElement=function(a){return goog.dom.getActiveElement(a||this.document_)};goog.dom.DomHelper.prototype.appendChild=goog.dom.appendChild;goog.dom.DomHelper.prototype.append=goog.dom.append;
|
|
goog.dom.DomHelper.prototype.canHaveChildren=goog.dom.canHaveChildren;goog.dom.DomHelper.prototype.removeChildren=goog.dom.removeChildren;goog.dom.DomHelper.prototype.insertSiblingBefore=goog.dom.insertSiblingBefore;goog.dom.DomHelper.prototype.insertSiblingAfter=goog.dom.insertSiblingAfter;goog.dom.DomHelper.prototype.insertChildAt=goog.dom.insertChildAt;goog.dom.DomHelper.prototype.removeNode=goog.dom.removeNode;goog.dom.DomHelper.prototype.replaceNode=goog.dom.replaceNode;
|
|
goog.dom.DomHelper.prototype.flattenElement=goog.dom.flattenElement;goog.dom.DomHelper.prototype.getChildren=goog.dom.getChildren;goog.dom.DomHelper.prototype.getFirstElementChild=goog.dom.getFirstElementChild;goog.dom.DomHelper.prototype.getLastElementChild=goog.dom.getLastElementChild;goog.dom.DomHelper.prototype.getNextElementSibling=goog.dom.getNextElementSibling;goog.dom.DomHelper.prototype.getPreviousElementSibling=goog.dom.getPreviousElementSibling;
|
|
goog.dom.DomHelper.prototype.getNextNode=goog.dom.getNextNode;goog.dom.DomHelper.prototype.getPreviousNode=goog.dom.getPreviousNode;goog.dom.DomHelper.prototype.isNodeLike=goog.dom.isNodeLike;goog.dom.DomHelper.prototype.isElement=goog.dom.isElement;goog.dom.DomHelper.prototype.isWindow=goog.dom.isWindow;goog.dom.DomHelper.prototype.getParentElement=goog.dom.getParentElement;goog.dom.DomHelper.prototype.contains=goog.dom.contains;goog.dom.DomHelper.prototype.compareNodeOrder=goog.dom.compareNodeOrder;
|
|
goog.dom.DomHelper.prototype.findCommonAncestor=goog.dom.findCommonAncestor;goog.dom.DomHelper.prototype.getOwnerDocument=goog.dom.getOwnerDocument;goog.dom.DomHelper.prototype.getFrameContentDocument=goog.dom.getFrameContentDocument;goog.dom.DomHelper.prototype.getFrameContentWindow=goog.dom.getFrameContentWindow;goog.dom.DomHelper.prototype.setTextContent=goog.dom.setTextContent;goog.dom.DomHelper.prototype.getOuterHtml=goog.dom.getOuterHtml;goog.dom.DomHelper.prototype.findNode=goog.dom.findNode;
|
|
goog.dom.DomHelper.prototype.findNodes=goog.dom.findNodes;goog.dom.DomHelper.prototype.isFocusableTabIndex=goog.dom.isFocusableTabIndex;goog.dom.DomHelper.prototype.setFocusableTabIndex=goog.dom.setFocusableTabIndex;goog.dom.DomHelper.prototype.getTextContent=goog.dom.getTextContent;goog.dom.DomHelper.prototype.getNodeTextLength=goog.dom.getNodeTextLength;goog.dom.DomHelper.prototype.getNodeTextOffset=goog.dom.getNodeTextOffset;goog.dom.DomHelper.prototype.getNodeAtOffset=goog.dom.getNodeAtOffset;
|
|
goog.dom.DomHelper.prototype.isNodeList=goog.dom.isNodeList;goog.dom.DomHelper.prototype.getAncestorByTagNameAndClass=goog.dom.getAncestorByTagNameAndClass;goog.dom.DomHelper.prototype.getAncestorByClass=goog.dom.getAncestorByClass;goog.dom.DomHelper.prototype.getAncestor=goog.dom.getAncestor;ol.webgl={};ol.webgl.CONTEXT_IDS_=["experimental-webgl","webgl","webkit-3d","moz-webgl"];ol.webgl.WebGLContextEventType={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"};ol.webgl.getContext=function(a,b){var c,d,e=ol.webgl.CONTEXT_IDS_.length;for(d=0;d<e;++d)try{if(c=a.getContext(ol.webgl.CONTEXT_IDS_[d],b),!goog.isNull(c))return c}catch(f){}return null};ol.BrowserFeature={};ol.ASSUME_TOUCH=!1;ol.ENABLE_CANVAS=!0;ol.ENABLE_DOM=!0;ol.ENABLE_IMAGE=!0;ol.ENABLE_TILE=!0;ol.ENABLE_VECTOR=!0;ol.ENABLE_WEBGL=!0;ol.LEGACY_IE_SUPPORT=!1;ol.IS_LEGACY_IE=goog.userAgent.IE&&!goog.userAgent.isVersionOrHigher("9.0")&&""!==goog.userAgent.VERSION;ol.BrowserFeature.DEVICE_PIXEL_RATIO=goog.global.devicePixelRatio||1;ol.BrowserFeature.HAS_ARRAY_BUFFER="ArrayBuffer"in goog.global;ol.BrowserFeature.HAS_CANVAS_LINE_DASH=!1;
|
|
ol.BrowserFeature.HAS_CANVAS=ol.ENABLE_CANVAS&&function(){if(!("HTMLCanvasElement"in goog.global))return!1;try{var a=goog.dom.createElement(goog.dom.TagName.CANVAS).getContext("2d");if(goog.isNull(a))return!1;goog.isDef(a.setLineDash)&&(ol.BrowserFeature.HAS_CANVAS_LINE_DASH=!0);return!0}catch(b){return!1}}();ol.BrowserFeature.HAS_DEVICE_ORIENTATION="DeviceOrientationEvent"in goog.global;ol.BrowserFeature.HAS_DOM=ol.ENABLE_DOM;ol.BrowserFeature.HAS_GEOLOCATION="geolocation"in goog.global.navigator;
|
|
ol.BrowserFeature.HAS_TOUCH=ol.ASSUME_TOUCH||goog.global.document&&"ontouchstart"in goog.global.document.documentElement||!!goog.global.navigator.msPointerEnabled;ol.BrowserFeature.HAS_WEBGL=ol.ENABLE_WEBGL&&function(){if(!("WebGLRenderingContext"in goog.global))return!1;try{var a=goog.dom.createElement(goog.dom.TagName.CANVAS);return!goog.isNull(ol.webgl.getContext(a,{failIfMajorPerformanceCaveat:!0}))}catch(b){return!1}}();ol.CenterConstraint={};ol.CenterConstraint.createExtent=function(a){return function(b){if(goog.isDef(b))return[goog.math.clamp(b[0],a[0],a[2]),goog.math.clamp(b[1],a[1],a[3])]}};ol.CenterConstraint.none=function(a){return a};goog.disposable={};goog.disposable.IDisposable=function(){};goog.Disposable=function(){goog.Disposable.MONITORING_MODE!=goog.Disposable.MonitoringMode.OFF&&(goog.Disposable.INCLUDE_STACK_ON_CREATION&&(this.creationStack=Error().stack),goog.Disposable.instances_[goog.getUid(this)]=this)};goog.Disposable.MonitoringMode={OFF:0,PERMANENT:1,INTERACTIVE:2};goog.Disposable.MONITORING_MODE=0;goog.Disposable.INCLUDE_STACK_ON_CREATION=!0;goog.Disposable.instances_={};
|
|
goog.Disposable.getUndisposedObjects=function(){var a=[],b;for(b in goog.Disposable.instances_)goog.Disposable.instances_.hasOwnProperty(b)&&a.push(goog.Disposable.instances_[Number(b)]);return a};goog.Disposable.clearUndisposedObjects=function(){goog.Disposable.instances_={}};goog.Disposable.prototype.disposed_=!1;goog.Disposable.prototype.isDisposed=function(){return this.disposed_};goog.Disposable.prototype.getDisposed=goog.Disposable.prototype.isDisposed;
|
|
goog.Disposable.prototype.dispose=function(){if(!this.disposed_&&(this.disposed_=!0,this.disposeInternal(),goog.Disposable.MONITORING_MODE!=goog.Disposable.MonitoringMode.OFF)){var a=goog.getUid(this);if(goog.Disposable.MONITORING_MODE==goog.Disposable.MonitoringMode.PERMANENT&&!goog.Disposable.instances_.hasOwnProperty(a))throw Error(this+" did not call the goog.Disposable base constructor or was disposed of after a clearUndisposedObjects call");delete goog.Disposable.instances_[a]}};
|
|
goog.Disposable.prototype.registerDisposable=function(a){this.addOnDisposeCallback(goog.partial(goog.dispose,a))};goog.Disposable.prototype.addOnDisposeCallback=function(a,b){this.onDisposeCallbacks_||(this.onDisposeCallbacks_=[]);this.onDisposeCallbacks_.push(goog.bind(a,b))};goog.Disposable.prototype.disposeInternal=function(){if(this.onDisposeCallbacks_)for(;this.onDisposeCallbacks_.length;)this.onDisposeCallbacks_.shift()()};
|
|
goog.Disposable.isDisposed=function(a){return a&&"function"==typeof a.isDisposed?a.isDisposed():!1};goog.dispose=function(a){a&&"function"==typeof a.dispose&&a.dispose()};goog.disposeAll=function(a){for(var b=0,c=arguments.length;b<c;++b){var d=arguments[b];goog.isArrayLike(d)?goog.disposeAll.apply(null,d):goog.dispose(d)}};goog.events={};goog.events.Event=function(a,b){this.type=a;this.currentTarget=this.target=b};goog.events.Event.prototype.disposeInternal=function(){};goog.events.Event.prototype.dispose=function(){};goog.events.Event.prototype.propagationStopped_=!1;goog.events.Event.prototype.defaultPrevented=!1;goog.events.Event.prototype.returnValue_=!0;goog.events.Event.prototype.stopPropagation=function(){this.propagationStopped_=!0};
|
|
goog.events.Event.prototype.preventDefault=function(){this.defaultPrevented=!0;this.returnValue_=!1};goog.events.Event.stopPropagation=function(a){a.stopPropagation()};goog.events.Event.preventDefault=function(a){a.preventDefault()};goog.events.BrowserFeature={HAS_W3C_BUTTON:!goog.userAgent.IE||goog.userAgent.isDocumentModeOrHigher(9),HAS_W3C_EVENT_SUPPORT:!goog.userAgent.IE||goog.userAgent.isDocumentModeOrHigher(9),SET_KEY_CODE_TO_PREVENT_DEFAULT:goog.userAgent.IE&&!goog.userAgent.isVersionOrHigher("9"),HAS_NAVIGATOR_ONLINE_PROPERTY:!goog.userAgent.WEBKIT||goog.userAgent.isVersionOrHigher("528"),HAS_HTML5_NETWORK_EVENT_SUPPORT:goog.userAgent.GECKO&&goog.userAgent.isVersionOrHigher("1.9b")||goog.userAgent.IE&&goog.userAgent.isVersionOrHigher("8")||
|
|
goog.userAgent.OPERA&&goog.userAgent.isVersionOrHigher("9.5")||goog.userAgent.WEBKIT&&goog.userAgent.isVersionOrHigher("528"),HTML5_NETWORK_EVENTS_FIRE_ON_BODY:goog.userAgent.GECKO&&!goog.userAgent.isVersionOrHigher("8")||goog.userAgent.IE&&!goog.userAgent.isVersionOrHigher("9"),TOUCH_ENABLED:"ontouchstart"in goog.global||!!(goog.global.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!goog.global.navigator||!goog.global.navigator.msMaxTouchPoints)};goog.events.EventType={CLICK:"click",DBLCLICK:"dblclick",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEMOVE:"mousemove",SELECTSTART:"selectstart",KEYPRESS:"keypress",KEYDOWN:"keydown",KEYUP:"keyup",BLUR:"blur",FOCUS:"focus",DEACTIVATE:"deactivate",FOCUSIN:goog.userAgent.IE?"focusin":"DOMFocusIn",FOCUSOUT:goog.userAgent.IE?"focusout":"DOMFocusOut",CHANGE:"change",SELECT:"select",SUBMIT:"submit",INPUT:"input",PROPERTYCHANGE:"propertychange",DRAGSTART:"dragstart",
|
|
DRAG:"drag",DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",DRAGEND:"dragend",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",TOUCHCANCEL:"touchcancel",BEFOREUNLOAD:"beforeunload",CONSOLEMESSAGE:"consolemessage",CONTEXTMENU:"contextmenu",DOMCONTENTLOADED:"DOMContentLoaded",ERROR:"error",HELP:"help",LOAD:"load",LOSECAPTURE:"losecapture",READYSTATECHANGE:"readystatechange",RESIZE:"resize",SCROLL:"scroll",UNLOAD:"unload",HASHCHANGE:"hashchange",PAGEHIDE:"pagehide",
|
|
PAGESHOW:"pageshow",POPSTATE:"popstate",COPY:"copy",PASTE:"paste",CUT:"cut",BEFORECOPY:"beforecopy",BEFORECUT:"beforecut",BEFOREPASTE:"beforepaste",ONLINE:"online",OFFLINE:"offline",MESSAGE:"message",CONNECT:"connect",TRANSITIONEND:goog.userAgent.WEBKIT?"webkitTransitionEnd":goog.userAgent.OPERA?"oTransitionEnd":"transitionend",MSGESTURECHANGE:"MSGestureChange",MSGESTUREEND:"MSGestureEnd",MSGESTUREHOLD:"MSGestureHold",MSGESTURESTART:"MSGestureStart",MSGESTURETAP:"MSGestureTap",MSGOTPOINTERCAPTURE:"MSGotPointerCapture",
|
|
MSINERTIASTART:"MSInertiaStart",MSLOSTPOINTERCAPTURE:"MSLostPointerCapture",MSPOINTERCANCEL:"MSPointerCancel",MSPOINTERDOWN:"MSPointerDown",MSPOINTERMOVE:"MSPointerMove",MSPOINTEROVER:"MSPointerOver",MSPOINTEROUT:"MSPointerOut",MSPOINTERUP:"MSPointerUp",TEXTINPUT:"textinput",COMPOSITIONSTART:"compositionstart",COMPOSITIONUPDATE:"compositionupdate",COMPOSITIONEND:"compositionend",EXIT:"exit",LOADABORT:"loadabort",LOADCOMMIT:"loadcommit",LOADREDIRECT:"loadredirect",LOADSTART:"loadstart",LOADSTOP:"loadstop",
|
|
RESPONSIVE:"responsive",SIZECHANGED:"sizechanged",UNRESPONSIVE:"unresponsive"};goog.reflect={};goog.reflect.object=function(a,b){return b};goog.reflect.sinkValue=function(a){goog.reflect.sinkValue[" "](a);return a};goog.reflect.sinkValue[" "]=goog.nullFunction;goog.reflect.canAccessProperty=function(a,b){try{return goog.reflect.sinkValue(a[b]),!0}catch(c){}return!1};goog.events.BrowserEvent=function(a,b){a&&this.init(a,b)};goog.inherits(goog.events.BrowserEvent,goog.events.Event);goog.events.BrowserEvent.MouseButton={LEFT:0,MIDDLE:1,RIGHT:2};goog.events.BrowserEvent.IEButtonMap=[1,4,2];goog.events.BrowserEvent.prototype.target=null;goog.events.BrowserEvent.prototype.relatedTarget=null;goog.events.BrowserEvent.prototype.offsetX=0;goog.events.BrowserEvent.prototype.offsetY=0;goog.events.BrowserEvent.prototype.clientX=0;
|
|
goog.events.BrowserEvent.prototype.clientY=0;goog.events.BrowserEvent.prototype.screenX=0;goog.events.BrowserEvent.prototype.screenY=0;goog.events.BrowserEvent.prototype.button=0;goog.events.BrowserEvent.prototype.keyCode=0;goog.events.BrowserEvent.prototype.charCode=0;goog.events.BrowserEvent.prototype.ctrlKey=!1;goog.events.BrowserEvent.prototype.altKey=!1;goog.events.BrowserEvent.prototype.shiftKey=!1;goog.events.BrowserEvent.prototype.metaKey=!1;
|
|
goog.events.BrowserEvent.prototype.platformModifierKey=!1;goog.events.BrowserEvent.prototype.event_=null;
|
|
goog.events.BrowserEvent.prototype.init=function(a,b){var c=this.type=a.type;goog.events.Event.call(this,c);this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;d?goog.userAgent.GECKO&&(goog.reflect.canAccessProperty(d,"nodeName")||(d=null)):c==goog.events.EventType.MOUSEOVER?d=a.fromElement:c==goog.events.EventType.MOUSEOUT&&(d=a.toElement);this.relatedTarget=d;this.offsetX=goog.userAgent.WEBKIT||void 0!==a.offsetX?a.offsetX:a.layerX;this.offsetY=goog.userAgent.WEBKIT||void 0!==
|
|
a.offsetY?a.offsetY:a.layerY;this.clientX=void 0!==a.clientX?a.clientX:a.pageX;this.clientY=void 0!==a.clientY?a.clientY:a.pageY;this.screenX=a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.platformModifierKey=goog.userAgent.MAC?a.metaKey:a.ctrlKey;this.state=a.state;this.event_=a;a.defaultPrevented&&this.preventDefault();
|
|
delete this.propagationStopped_};goog.events.BrowserEvent.prototype.isButton=function(a){return goog.events.BrowserFeature.HAS_W3C_BUTTON?this.event_.button==a:"click"==this.type?a==goog.events.BrowserEvent.MouseButton.LEFT:!!(this.event_.button&goog.events.BrowserEvent.IEButtonMap[a])};goog.events.BrowserEvent.prototype.isMouseActionButton=function(){return this.isButton(goog.events.BrowserEvent.MouseButton.LEFT)&&!(goog.userAgent.WEBKIT&&goog.userAgent.MAC&&this.ctrlKey)};
|
|
goog.events.BrowserEvent.prototype.stopPropagation=function(){goog.events.BrowserEvent.superClass_.stopPropagation.call(this);this.event_.stopPropagation?this.event_.stopPropagation():this.event_.cancelBubble=!0};
|
|
goog.events.BrowserEvent.prototype.preventDefault=function(){goog.events.BrowserEvent.superClass_.preventDefault.call(this);var a=this.event_;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,goog.events.BrowserFeature.SET_KEY_CODE_TO_PREVENT_DEFAULT)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};goog.events.BrowserEvent.prototype.getBrowserEvent=function(){return this.event_};goog.events.BrowserEvent.prototype.disposeInternal=function(){};goog.events.Listenable=function(){};goog.events.Listenable.IMPLEMENTED_BY_PROP="closure_listenable_"+(1E6*Math.random()|0);goog.events.Listenable.addImplementation=function(a){a.prototype[goog.events.Listenable.IMPLEMENTED_BY_PROP]=!0};goog.events.Listenable.isImplementedBy=function(a){return!(!a||!a[goog.events.Listenable.IMPLEMENTED_BY_PROP])};goog.events.ListenableKey=function(){};goog.events.ListenableKey.counter_=0;goog.events.ListenableKey.reserveKey=function(){return++goog.events.ListenableKey.counter_};goog.events.Listener=function(a,b,c,d,e,f){goog.events.Listener.ENABLE_MONITORING&&(this.creationStack=Error().stack);this.listener=a;this.proxy=b;this.src=c;this.type=d;this.capture=!!e;this.handler=f;this.key=goog.events.ListenableKey.reserveKey();this.removed=this.callOnce=!1};goog.events.Listener.ENABLE_MONITORING=!1;goog.events.Listener.prototype.markAsRemoved=function(){this.removed=!0;this.handler=this.src=this.proxy=this.listener=null};goog.events.listeners_={};goog.events.listenerTree_={};goog.events.sources_={};goog.events.onString_="on";goog.events.onStringMap_={};goog.events.keySeparator_="_";goog.events.listen=function(a,b,c,d,e){if(goog.isArray(b)){for(var f=0;f<b.length;f++)goog.events.listen(a,b[f],c,d,e);return null}c=goog.events.wrapListener_(c);return goog.events.Listenable.isImplementedBy(a)?a.listen(b,c,d,e):goog.events.listen_(a,b,c,!1,d,e)};
|
|
goog.events.listen_=function(a,b,c,d,e,f){if(!b)throw Error("Invalid event type");e=!!e;var g=goog.events.listenerTree_;b in g||(g[b]={count_:0});g=g[b];e in g||(g[e]={count_:0},g.count_++);var g=g[e],h=goog.getUid(a),k;if(g[h]){k=g[h];for(var l=0;l<k.length;l++)if(g=k[l],g.listener==c&&g.handler==f){if(g.removed)break;d||(k[l].callOnce=!1);return k[l]}}else k=g[h]=[],g.count_++;l=goog.events.getProxy();g=new goog.events.Listener(c,l,a,b,e,f);g.callOnce=d;l.src=a;l.listener=g;k.push(g);goog.events.sources_[h]||
|
|
(goog.events.sources_[h]=[]);goog.events.sources_[h].push(g);a.addEventListener?a.addEventListener(b,l,e):a.attachEvent(goog.events.getOnString_(b),l);return goog.events.listeners_[g.key]=g};goog.events.getProxy=function(){var a=goog.events.handleBrowserEvent_,b=goog.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT?function(c){return a.call(b.src,b.listener,c)}:function(c){c=a.call(b.src,b.listener,c);if(!c)return c};return b};
|
|
goog.events.listenOnce=function(a,b,c,d,e){if(goog.isArray(b)){for(var f=0;f<b.length;f++)goog.events.listenOnce(a,b[f],c,d,e);return null}c=goog.events.wrapListener_(c);return goog.events.Listenable.isImplementedBy(a)?a.listenOnce(b,c,d,e):goog.events.listen_(a,b,c,!0,d,e)};goog.events.listenWithWrapper=function(a,b,c,d,e){b.listen(a,c,d,e)};
|
|
goog.events.unlisten=function(a,b,c,d,e){if(goog.isArray(b)){for(var f=0;f<b.length;f++)goog.events.unlisten(a,b[f],c,d,e);return null}c=goog.events.wrapListener_(c);if(goog.events.Listenable.isImplementedBy(a))return a.unlisten(b,c,d,e);d=!!d;a=goog.events.getListeners_(a,b,d);if(!a)return!1;for(f=0;f<a.length;f++)if(a[f].listener==c&&a[f].capture==d&&a[f].handler==e)return goog.events.unlistenByKey(a[f]);return!1};
|
|
goog.events.unlistenByKey=function(a){if(goog.isNumber(a)||!a||a.removed)return!1;var b=a.src;if(goog.events.Listenable.isImplementedBy(b))return b.unlistenByKey(a);var c=a.type,d=a.proxy,e=a.capture;b.removeEventListener?b.removeEventListener(c,d,e):b.detachEvent&&b.detachEvent(goog.events.getOnString_(c),d);b=goog.getUid(b);goog.events.sources_[b]&&(d=goog.events.sources_[b],goog.array.remove(d,a),0==d.length&&delete goog.events.sources_[b]);a.markAsRemoved();if(d=goog.events.listenerTree_[c][e][b])goog.array.remove(d,
|
|
a),0==d.length&&(delete goog.events.listenerTree_[c][e][b],goog.events.listenerTree_[c][e].count_--),0==goog.events.listenerTree_[c][e].count_&&(delete goog.events.listenerTree_[c][e],goog.events.listenerTree_[c].count_--),0==goog.events.listenerTree_[c].count_&&delete goog.events.listenerTree_[c];delete goog.events.listeners_[a.key];return!0};goog.events.unlistenWithWrapper=function(a,b,c,d,e){b.unlisten(a,c,d,e)};
|
|
goog.events.removeAll=function(a,b){var c=0,d=null==b;if(null!=a){if(a&&goog.events.Listenable.isImplementedBy(a))return a.removeAllListeners(b);var e=goog.getUid(a);if(goog.events.sources_[e])for(var e=goog.events.sources_[e],f=e.length-1;0<=f;f--){var g=e[f];if(d||b==g.type)goog.events.unlistenByKey(g),c++}}else goog.object.forEach(goog.events.listeners_,function(a){goog.events.unlistenByKey(a);c++});return c};
|
|
goog.events.removeAllNativeListeners=function(){var a=0;goog.object.forEach(goog.events.listeners_,function(b){goog.events.unlistenByKey(b);a++});return a};goog.events.getListeners=function(a,b,c){return goog.events.Listenable.isImplementedBy(a)?a.getListeners(b,c):goog.events.getListeners_(a,b,c)||[]};goog.events.getListeners_=function(a,b,c){var d=goog.events.listenerTree_;return b in d&&(d=d[b],c in d&&(d=d[c],a=goog.getUid(a),d[a]))?d[a]:null};
|
|
goog.events.getListener=function(a,b,c,d,e){d=!!d;c=goog.events.wrapListener_(c);if(goog.events.Listenable.isImplementedBy(a))return a.getListener(b,c,d,e);if(a=goog.events.getListeners_(a,b,d))for(b=0;b<a.length;b++)if(!a[b].removed&&a[b].listener==c&&a[b].capture==d&&a[b].handler==e)return a[b];return null};
|
|
goog.events.hasListener=function(a,b,c){if(goog.events.Listenable.isImplementedBy(a))return a.hasListener(b,c);a=goog.getUid(a);var d=goog.events.sources_[a];if(d){var e=goog.isDef(b),f=goog.isDef(c);return e&&f?(d=goog.events.listenerTree_[b],!!d&&!!d[c]&&a in d[c]):e||f?goog.array.some(d,function(a){return e&&a.type==b||f&&a.capture==c}):!0}return!1};goog.events.expose=function(a){var b=[],c;for(c in a)a[c]&&a[c].id?b.push(c+" \x3d "+a[c]+" ("+a[c].id+")"):b.push(c+" \x3d "+a[c]);return b.join("\n")};
|
|
goog.events.getOnString_=function(a){return a in goog.events.onStringMap_?goog.events.onStringMap_[a]:goog.events.onStringMap_[a]=goog.events.onString_+a};goog.events.fireListeners=function(a,b,c,d){if(goog.events.Listenable.isImplementedBy(a))return a.fireListeners(b,c,d);var e=goog.events.listenerTree_;return b in e&&(e=e[b],c in e)?goog.events.fireListeners_(e[c],a,b,c,d):!0};
|
|
goog.events.fireListeners_=function(a,b,c,d,e){c=1;b=goog.getUid(b);if(a[b])for(a=goog.array.clone(a[b]),b=0;b<a.length;b++)(d=a[b])&&!d.removed&&(c&=!1!==goog.events.fireListener(d,e));return Boolean(c)};goog.events.fireListener=function(a,b){var c=a.listener,d=a.handler||a.src;a.callOnce&&goog.events.unlistenByKey(a);return c.call(d,b)};goog.events.getTotalListenerCount=function(){return goog.object.getCount(goog.events.listeners_)};goog.events.dispatchEvent=function(a,b){return a.dispatchEvent(b)};
|
|
goog.events.protectBrowserEventEntryPoint=function(a){goog.events.handleBrowserEvent_=a.protectEntryPoint(goog.events.handleBrowserEvent_)};
|
|
goog.events.handleBrowserEvent_=function(a,b){if(a.removed)return!0;var c=a.type,d=goog.events.listenerTree_;if(!(c in d))return!0;var d=d[c],e,f;if(!goog.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT){e=b||goog.getObjectByName("window.event");var g=!0 in d,h=!1 in d;if(g){if(goog.events.isMarkedIeEvent_(e))return!0;goog.events.markIeEvent_(e)}var k=new goog.events.BrowserEvent;k.init(e,this);e=!0;try{if(g){for(var l=[],m=k.currentTarget;m;m=m.parentNode)l.push(m);f=d[!0];for(var n=l.length-1;!k.propagationStopped_&&
|
|
0<=n;n--)k.currentTarget=l[n],e&=goog.events.fireListeners_(f,l[n],c,!0,k);if(h)for(f=d[!1],n=0;!k.propagationStopped_&&n<l.length;n++)k.currentTarget=l[n],e&=goog.events.fireListeners_(f,l[n],c,!1,k)}else e=goog.events.fireListener(a,k)}finally{l&&(l.length=0)}return e}c=new goog.events.BrowserEvent(b,this);return e=goog.events.fireListener(a,c)};goog.events.markIeEvent_=function(a){var b=!1;if(0==a.keyCode)try{a.keyCode=-1;return}catch(c){b=!0}if(b||void 0==a.returnValue)a.returnValue=!0};
|
|
goog.events.isMarkedIeEvent_=function(a){return 0>a.keyCode||void 0!=a.returnValue};goog.events.uniqueIdCounter_=0;goog.events.getUniqueId=function(a){return a+"_"+goog.events.uniqueIdCounter_++};goog.events.LISTENER_WRAPPER_PROP_="__closure_events_fn_"+(1E9*Math.random()>>>0);goog.events.wrapListener_=function(a){return goog.isFunction(a)?a:a[goog.events.LISTENER_WRAPPER_PROP_]||(a[goog.events.LISTENER_WRAPPER_PROP_]=function(b){return a.handleEvent(b)})};goog.functions={};goog.functions.constant=function(a){return function(){return a}};goog.functions.FALSE=goog.functions.constant(!1);goog.functions.TRUE=goog.functions.constant(!0);goog.functions.NULL=goog.functions.constant(null);goog.functions.identity=function(a,b){return a};goog.functions.error=function(a){return function(){throw Error(a);}};goog.functions.fail=function(a){return function(){throw a;}};
|
|
goog.functions.lock=function(a,b){b=b||0;return function(){return a.apply(this,Array.prototype.slice.call(arguments,0,b))}};goog.functions.withReturnValue=function(a,b){return goog.functions.sequence(a,goog.functions.constant(b))};goog.functions.compose=function(a,b){var c=arguments,d=c.length;return function(){var a;d&&(a=c[d-1].apply(this,arguments));for(var b=d-2;0<=b;b--)a=c[b].call(this,a);return a}};
|
|
goog.functions.sequence=function(a){var b=arguments,c=b.length;return function(){for(var a,e=0;e<c;e++)a=b[e].apply(this,arguments);return a}};goog.functions.and=function(a){var b=arguments,c=b.length;return function(){for(var a=0;a<c;a++)if(!b[a].apply(this,arguments))return!1;return!0}};goog.functions.or=function(a){var b=arguments,c=b.length;return function(){for(var a=0;a<c;a++)if(b[a].apply(this,arguments))return!0;return!1}};
|
|
goog.functions.not=function(a){return function(){return!a.apply(this,arguments)}};goog.functions.create=function(a,b){var c=function(){};c.prototype=a.prototype;c=new c;a.apply(c,Array.prototype.slice.call(arguments,1));return c};goog.events.ListenerMap=function(a){this.src=a;this.listeners={};this.typeCount_=0};goog.events.ListenerMap.prototype.getTypeCount=function(){return this.typeCount_};goog.events.ListenerMap.prototype.getListenerCount=function(){var a=0,b;for(b in this.listeners)a+=this.listeners[b].length;return a};
|
|
goog.events.ListenerMap.prototype.add=function(a,b,c,d,e){var f=this.listeners[a];f||(f=this.listeners[a]=[],this.typeCount_++);var g=goog.events.ListenerMap.findListenerIndex_(f,b,d,e);-1<g?(a=f[g],c||(a.callOnce=!1)):(a=new goog.events.Listener(b,null,this.src,a,!!d,e),a.callOnce=c,f.push(a));return a};
|
|
goog.events.ListenerMap.prototype.remove=function(a,b,c,d){if(!(a in this.listeners))return!1;var e=this.listeners[a];b=goog.events.ListenerMap.findListenerIndex_(e,b,c,d);return-1<b?(e[b].markAsRemoved(),goog.array.removeAt(e,b),0==e.length&&(delete this.listeners[a],this.typeCount_--),!0):!1};
|
|
goog.events.ListenerMap.prototype.removeByKey=function(a){var b=a.type;if(!(b in this.listeners))return!1;var c=goog.array.remove(this.listeners[b],a);c&&(a.markAsRemoved(),0==this.listeners[b].length&&(delete this.listeners[b],this.typeCount_--));return c};goog.events.ListenerMap.prototype.removeAll=function(a){var b=0,c;for(c in this.listeners)if(!a||c==a){for(var d=this.listeners[c],e=0;e<d.length;e++)++b,d[e].removed=!0;delete this.listeners[c];this.typeCount_--}return b};
|
|
goog.events.ListenerMap.prototype.getListeners=function(a,b){var c=this.listeners[a],d=[];if(c)for(var e=0;e<c.length;++e){var f=c[e];f.capture==b&&d.push(f)}return d};goog.events.ListenerMap.prototype.getListener=function(a,b,c,d){a=this.listeners[a];var e=-1;a&&(e=goog.events.ListenerMap.findListenerIndex_(a,b,c,d));return-1<e?a[e]:null};
|
|
goog.events.ListenerMap.prototype.hasListener=function(a,b){var c=goog.isDef(a),d=goog.isDef(b);return goog.object.some(this.listeners,function(e,f){for(var g=0;g<e.length;++g)if(!(c&&e[g].type!=a||d&&e[g].capture!=b))return!0;return!1})};goog.events.ListenerMap.findListenerIndex_=function(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.removed&&f.listener==b&&f.capture==!!c&&f.handler==d)return e}return-1};goog.events.EventTarget=function(){goog.Disposable.call(this);this.eventTargetListeners_=new goog.events.ListenerMap(this);this.actualEventTarget_=this};goog.inherits(goog.events.EventTarget,goog.Disposable);goog.events.Listenable.addImplementation(goog.events.EventTarget);goog.events.EventTarget.MAX_ANCESTORS_=1E3;goog.events.EventTarget.prototype.parentEventTarget_=null;goog.events.EventTarget.prototype.getParentEventTarget=function(){return this.parentEventTarget_};
|
|
goog.events.EventTarget.prototype.setParentEventTarget=function(a){this.parentEventTarget_=a};goog.events.EventTarget.prototype.addEventListener=function(a,b,c,d){goog.events.listen(this,a,b,c,d)};goog.events.EventTarget.prototype.removeEventListener=function(a,b,c,d){goog.events.unlisten(this,a,b,c,d)};
|
|
goog.events.EventTarget.prototype.dispatchEvent=function(a){this.assertInitialized_();var b,c=this.getParentEventTarget();if(c)for(b=[];c;c=c.getParentEventTarget())b.push(c);return goog.events.EventTarget.dispatchEventInternal_(this.actualEventTarget_,a,b)};goog.events.EventTarget.prototype.disposeInternal=function(){goog.events.EventTarget.superClass_.disposeInternal.call(this);this.removeAllListeners();this.parentEventTarget_=null};
|
|
goog.events.EventTarget.prototype.listen=function(a,b,c,d){this.assertInitialized_();return this.eventTargetListeners_.add(a,b,!1,c,d)};goog.events.EventTarget.prototype.listenOnce=function(a,b,c,d){return this.eventTargetListeners_.add(a,b,!0,c,d)};goog.events.EventTarget.prototype.unlisten=function(a,b,c,d){return this.eventTargetListeners_.remove(a,b,c,d)};goog.events.EventTarget.prototype.unlistenByKey=function(a){return this.eventTargetListeners_.removeByKey(a)};
|
|
goog.events.EventTarget.prototype.removeAllListeners=function(a){return this.eventTargetListeners_?this.eventTargetListeners_.removeAll(a):0};goog.events.EventTarget.prototype.fireListeners=function(a,b,c){a=this.eventTargetListeners_.listeners[a];if(!a)return!0;a=goog.array.clone(a);for(var d=!0,e=0;e<a.length;++e){var f=a[e];if(f&&!f.removed&&f.capture==b){var g=f.listener,h=f.handler||f.src;f.callOnce&&this.unlistenByKey(f);d=!1!==g.call(h,c)&&d}}return d&&!1!=c.returnValue_};
|
|
goog.events.EventTarget.prototype.getListeners=function(a,b){return this.eventTargetListeners_.getListeners(a,b)};goog.events.EventTarget.prototype.getListener=function(a,b,c,d){return this.eventTargetListeners_.getListener(a,b,c,d)};goog.events.EventTarget.prototype.hasListener=function(a,b){return this.eventTargetListeners_.hasListener(a,b)};goog.events.EventTarget.prototype.setTargetForTesting=function(a){this.actualEventTarget_=a};goog.events.EventTarget.prototype.assertInitialized_=function(){};
|
|
goog.events.EventTarget.dispatchEventInternal_=function(a,b,c){var d=b.type||b;if(goog.isString(b))b=new goog.events.Event(b,a);else if(b instanceof goog.events.Event)b.target=b.target||a;else{var e=b;b=new goog.events.Event(d,a);goog.object.extend(b,e)}var e=!0,f;if(c)for(var g=c.length-1;!b.propagationStopped_&&0<=g;g--)f=b.currentTarget=c[g],e=f.fireListeners(d,!0,b)&&e;b.propagationStopped_||(f=b.currentTarget=a,e=f.fireListeners(d,!0,b)&&e,b.propagationStopped_||(e=f.fireListeners(d,!1,b)&&e));
|
|
if(c)for(g=0;!b.propagationStopped_&&g<c.length;g++)f=b.currentTarget=c[g],e=f.fireListeners(d,!1,b)&&e;return e};ol.Observable=function(){goog.events.EventTarget.call(this);this.revision_=0};goog.inherits(ol.Observable,goog.events.EventTarget);ol.Observable.prototype.dispatchChangeEvent=function(){++this.revision_;this.dispatchEvent(goog.events.EventType.CHANGE)};ol.Observable.prototype.getRevision=function(){return this.revision_};ol.Observable.prototype.on=function(a,b,c){return goog.events.listen(this,a,b,!1,c)};ol.Observable.prototype.once=function(a,b,c){return goog.events.listenOnce(this,a,b,!1,c)};
|
|
ol.Observable.prototype.un=function(a,b,c){goog.events.unlisten(this,a,b,!1,c)};ol.Observable.prototype.unByKey=function(a){goog.events.unlistenByKey(a)};ol.ObjectEventType={BEFOREPROPERTYCHANGE:"beforepropertychange",PROPERTYCHANGE:"propertychange"};ol.ObjectEvent=function(a,b){goog.events.Event.call(this,a);this.key=b};goog.inherits(ol.ObjectEvent,goog.events.Event);ol.ObjectAccessor=function(a,b){this.target=a;this.key=b;this.to=this.from=goog.functions.identity};ol.ObjectAccessor.prototype.transform=function(a,b){this.from=a;this.to=b;this.target.notify(this.key)};
|
|
ol.Object=function(a){ol.Observable.call(this);this.values_={};this.accessors_={};this.beforeChangeListeners_={};this.listeners_={};goog.isDef(a)&&this.setValues(a)};goog.inherits(ol.Object,ol.Observable);ol.Object.changeEventTypeCache_={};ol.Object.getterNameCache_={};ol.Object.setterNameCache_={};ol.Object.capitalize=function(a){return a.substr(0,1).toUpperCase()+a.substr(1)};
|
|
ol.Object.getChangeEventType=function(a){return ol.Object.changeEventTypeCache_.hasOwnProperty(a)?ol.Object.changeEventTypeCache_[a]:ol.Object.changeEventTypeCache_[a]="change:"+a.toLowerCase()};ol.Object.getGetterName=function(a){return ol.Object.getterNameCache_.hasOwnProperty(a)?ol.Object.getterNameCache_[a]:ol.Object.getterNameCache_[a]="get"+ol.Object.capitalize(a)};
|
|
ol.Object.getSetterName=function(a){return ol.Object.setterNameCache_.hasOwnProperty(a)?ol.Object.setterNameCache_[a]:ol.Object.setterNameCache_[a]="set"+ol.Object.capitalize(a)};
|
|
ol.Object.prototype.bindTo=function(a,b,c){c=c||a;this.unbind(a);var d=ol.Object.getChangeEventType(c);this.listeners_[a]=goog.events.listen(b,d,function(){this.notifyInternal_(a)},void 0,this);this.beforeChangeListeners_[a]=goog.events.listen(b,ol.ObjectEventType.BEFOREPROPERTYCHANGE,this.createBeforeChangeListener_(a,c),void 0,this);b=new ol.ObjectAccessor(b,c);this.accessors_[a]=b;this.notifyInternal_(a);return b};
|
|
ol.Object.prototype.createBeforeChangeListener_=function(a,b){return function(c){c.key===b&&this.dispatchEvent(new ol.ObjectEvent(ol.ObjectEventType.BEFOREPROPERTYCHANGE,a))}};ol.Object.prototype.get=function(a){var b,c=this.accessors_;if(c.hasOwnProperty(a)){a=c[a];b=a.target;var c=a.key,d=ol.Object.getGetterName(c),d=goog.object.get(b,d);b=goog.isDef(d)?d.call(b):b.get(c);b=a.to(b)}else this.values_.hasOwnProperty(a)&&(b=this.values_[a]);return b};
|
|
ol.Object.prototype.getKeys=function(){var a=this.accessors_,b;if(goog.object.isEmpty(this.values_)){if(goog.object.isEmpty(a))return[];b=a}else if(goog.object.isEmpty(a))b=this.values_;else{b={};for(var c in this.values_)b[c]=!0;for(c in a)b[c]=!0}return goog.object.getKeys(b)};ol.Object.prototype.getProperties=function(){var a={},b;for(b in this.values_)a[b]=this.values_[b];for(b in this.accessors_)a[b]=this.get(b);return a};
|
|
ol.Object.prototype.notify=function(a){var b=this.accessors_;b.hasOwnProperty(a)?(a=b[a],a.target.notify(a.key)):this.notifyInternal_(a)};ol.Object.prototype.notifyInternal_=function(a){var b=ol.Object.getChangeEventType(a);this.dispatchEvent(b);this.dispatchEvent(new ol.ObjectEvent(ol.ObjectEventType.PROPERTYCHANGE,a))};
|
|
ol.Object.prototype.set=function(a,b){this.dispatchEvent(new ol.ObjectEvent(ol.ObjectEventType.BEFOREPROPERTYCHANGE,a));var c=this.accessors_;if(c.hasOwnProperty(a)){var d=c[a],c=d.target,e=d.key;b=d.from(b);d=ol.Object.getSetterName(e);d=goog.object.get(c,d);goog.isDef(d)?d.call(c,b):c.set(e,b)}else this.values_[a]=b,this.notifyInternal_(a)};ol.Object.prototype.setValues=function(a){for(var b in a)this.set(b,a[b])};
|
|
ol.Object.prototype.unbind=function(a){var b=this.listeners_,c=b[a];c&&(delete b[a],goog.events.unlistenByKey(c),b=this.get(a),delete this.accessors_[a],this.values_[a]=b);if(b=this.beforeChangeListeners_[a])goog.events.unlistenByKey(b),delete this.beforeChangeListeners_[a]};ol.Object.prototype.unbindAll=function(){for(var a in this.listeners_)this.unbind(a)};ol.CollectionEventType={ADD:"add",REMOVE:"remove"};ol.CollectionEvent=function(a,b,c){goog.events.Event.call(this,a,c);this.element=b};goog.inherits(ol.CollectionEvent,goog.events.Event);ol.CollectionProperty={LENGTH:"length"};ol.Collection=function(a){ol.Object.call(this);this.array_=a||[];this.updateLength_()};goog.inherits(ol.Collection,ol.Object);ol.Collection.prototype.clear=function(){for(;0<this.getLength();)this.pop()};
|
|
ol.Collection.prototype.extend=function(a){var b,c;b=0;for(c=a.length;b<c;++b)this.push(a[b]);return this};ol.Collection.prototype.forEach=function(a,b){goog.array.forEach(this.array_,a,b)};ol.Collection.prototype.getArray=function(){return this.array_};ol.Collection.prototype.getAt=function(a){return this.array_[a]};ol.Collection.prototype.getLength=function(){return this.get(ol.CollectionProperty.LENGTH)};
|
|
ol.Collection.prototype.insertAt=function(a,b){goog.array.insertAt(this.array_,b,a);this.updateLength_();this.dispatchEvent(new ol.CollectionEvent(ol.CollectionEventType.ADD,b,this))};ol.Collection.prototype.pop=function(){return this.removeAt(this.getLength()-1)};ol.Collection.prototype.push=function(a){var b=this.array_.length;this.insertAt(b,a);return b};ol.Collection.prototype.remove=function(a){var b=this.array_,c,d;c=0;for(d=b.length;c<d;++c)if(b[c]===a)return this.removeAt(c)};
|
|
ol.Collection.prototype.removeAt=function(a){var b=this.array_[a];goog.array.removeAt(this.array_,a);this.updateLength_();this.dispatchEvent(new ol.CollectionEvent(ol.CollectionEventType.REMOVE,b,this));return b};
|
|
ol.Collection.prototype.setAt=function(a,b){var c=this.getLength();if(a<c)c=this.array_[a],this.array_[a]=b,this.dispatchEvent(new ol.CollectionEvent(ol.CollectionEventType.REMOVE,c,this)),this.dispatchEvent(new ol.CollectionEvent(ol.CollectionEventType.ADD,b,this));else{for(;c<a;++c)this.insertAt(c,void 0);this.insertAt(a,b)}};ol.Collection.prototype.updateLength_=function(){this.set(ol.CollectionProperty.LENGTH,this.array_.length)};ol.array={};ol.array.binaryFindNearest=function(a,b){var c=goog.array.binarySearch(a,b,function(a,b){return b-a});if(0<=c)return c;if(-1==c)return 0;if(c==-a.length-1)return a.length-1;var d=-c-2,c=-c-1;return a[d]-b<b-a[c]?d:c};
|
|
ol.array.linearFindNearest=function(a,b,c){var d=a.length;if(a[0]<=b)return 0;if(!(b<=a[d-1]))if(0<c)for(c=1;c<d;++c){if(a[c]<b)return c-1}else if(0>c)for(c=1;c<d;++c){if(a[c]<=b)return c}else for(c=1;c<d;++c){if(a[c]==b)return c;if(a[c]<b)return a[c-1]-b<b-a[c]?c-1:c}return d-1};ol.array.reverseSubArray=function(a,b,c){for(;b<c;){var d=a[b];a[b]=a[c];a[c]=d;++b;--c}};ol.ResolutionConstraint={};ol.ResolutionConstraint.createSnapToResolutions=function(a){return function(b,c,d){if(goog.isDef(b))return b=ol.array.linearFindNearest(a,b,d),b=goog.math.clamp(b+c,0,a.length-1),a[b]}};ol.ResolutionConstraint.createSnapToPower=function(a,b,c){return function(d,e,f){if(goog.isDef(d))return f=0<f?0:0>f?1:0.5,d=Math.floor(Math.log(b/d)/Math.log(a)+f),e=Math.max(d+e,0),goog.isDef(c)&&(e=Math.min(e,c)),b/Math.pow(a,e)}};ol.RotationConstraint={};ol.RotationConstraint.disable=function(a,b){if(goog.isDef(a))return 0};ol.RotationConstraint.none=function(a,b){if(goog.isDef(a))return a+b};ol.RotationConstraint.createSnapToN=function(a){var b=2*Math.PI/a;return function(a,d){if(goog.isDef(a))return a=Math.floor((a+d)/b+0.5)*b}};ol.RotationConstraint.createSnapToZero=function(a){var b=a||goog.math.toRadians(5);return function(a,d){if(goog.isDef(a))return Math.abs(a+d)<=b?0:a+d}};ol.Constraints=function(a,b,c){this.center=a;this.resolution=b;this.rotation=c};ol.coordinate={};ol.coordinate.add=function(a,b){a[0]+=b[0];a[1]+=b[1];return a};ol.coordinate.closestOnSegment=function(a,b){var c=a[0],d=a[1],e=b[0],f=b[1],g=e[0],e=e[1],h=f[0],f=f[1],k=h-g,l=f-e,c=0==k&&0==l?0:(k*(c-g)+l*(d-e))/(k*k+l*l||0);0>=c||(1<=c?(g=h,e=f):(g+=c*k,e+=c*l));return[g,e]};ol.coordinate.createStringXY=function(a){return function(b){return ol.coordinate.toStringXY(b,a)}};
|
|
ol.coordinate.degreesToStringHDMS_=function(a,b){var c=goog.math.modulo(a+180,360)-180,d=Math.abs(Math.round(3600*c));return Math.floor(d/3600)+"\u00b0 "+Math.floor(d/60%60)+"\u2032 "+Math.floor(d%60)+"\u2033 "+b.charAt(0>c?1:0)};ol.coordinate.format=function(a,b,c){return goog.isDef(a)?b.replace("{x}",a[0].toFixed(c)).replace("{y}",a[1].toFixed(c)):""};ol.coordinate.equals=function(a,b){for(var c=!0,d=a.length-1;0<=d;--d)if(a[d]!=b[d]){c=!1;break}return c};
|
|
ol.coordinate.rotate=function(a,b){var c=Math.cos(b),d=Math.sin(b),e=a[1]*c+a[0]*d;a[0]=a[0]*c-a[1]*d;a[1]=e;return a};ol.coordinate.scale=function(a,b){a[0]*=b;a[1]*=b;return a};ol.coordinate.squaredDistance=function(a,b){var c=a[0]-b[0],d=a[1]-b[1];return c*c+d*d};ol.coordinate.squaredDistanceToSegment=function(a,b){return ol.coordinate.squaredDistance(a,ol.coordinate.closestOnSegment(a,b))};
|
|
ol.coordinate.toStringHDMS=function(a){return goog.isDef(a)?ol.coordinate.degreesToStringHDMS_(a[1],"NS")+" "+ol.coordinate.degreesToStringHDMS_(a[0],"EW"):""};ol.coordinate.toStringXY=function(a,b){return ol.coordinate.format(a,"{x}, {y}",b)};ol.coordinate.fromProjectedArray=function(a,b){var c=b.charAt(0);return"n"===c||"s"===c?[a[1],a[0]]:a};ol.DeviceOrientationProperty={ALPHA:"alpha",BETA:"beta",GAMMA:"gamma",HEADING:"heading",TRACKING:"tracking"};ol.DeviceOrientation=function(a){ol.Object.call(this);a=goog.isDef(a)?a:{};this.listenerKey_=null;goog.events.listen(this,ol.Object.getChangeEventType(ol.DeviceOrientationProperty.TRACKING),this.handleTrackingChanged_,!1,this);this.setTracking(goog.isDef(a.tracking)?a.tracking:!1)};goog.inherits(ol.DeviceOrientation,ol.Object);
|
|
ol.DeviceOrientation.prototype.disposeInternal=function(){this.setTracking(!1);ol.DeviceOrientation.superClass_.disposeInternal.call(this)};
|
|
ol.DeviceOrientation.prototype.orientationChange_=function(a){a=a.getBrowserEvent();if(goog.isDefAndNotNull(a.alpha)){var b=goog.math.toRadians(a.alpha);this.set(ol.DeviceOrientationProperty.ALPHA,b);goog.isBoolean(a.absolute)&&a.absolute?this.set(ol.DeviceOrientationProperty.HEADING,b):goog.isDefAndNotNull(a.webkitCompassHeading)&&(goog.isDefAndNotNull(a.webkitCompassAccuracy)&&-1!=a.webkitCompassAccuracy)&&(b=goog.math.toRadians(a.webkitCompassHeading),this.set(ol.DeviceOrientationProperty.HEADING,
|
|
b))}goog.isDefAndNotNull(a.beta)&&this.set(ol.DeviceOrientationProperty.BETA,goog.math.toRadians(a.beta));goog.isDefAndNotNull(a.gamma)&&this.set(ol.DeviceOrientationProperty.GAMMA,goog.math.toRadians(a.gamma))};ol.DeviceOrientation.prototype.getAlpha=function(){return this.get(ol.DeviceOrientationProperty.ALPHA)};goog.exportProperty(ol.DeviceOrientation.prototype,"getAlpha",ol.DeviceOrientation.prototype.getAlpha);ol.DeviceOrientation.prototype.getBeta=function(){return this.get(ol.DeviceOrientationProperty.BETA)};
|
|
goog.exportProperty(ol.DeviceOrientation.prototype,"getBeta",ol.DeviceOrientation.prototype.getBeta);ol.DeviceOrientation.prototype.getGamma=function(){return this.get(ol.DeviceOrientationProperty.GAMMA)};goog.exportProperty(ol.DeviceOrientation.prototype,"getGamma",ol.DeviceOrientation.prototype.getGamma);ol.DeviceOrientation.prototype.getHeading=function(){return this.get(ol.DeviceOrientationProperty.HEADING)};goog.exportProperty(ol.DeviceOrientation.prototype,"getHeading",ol.DeviceOrientation.prototype.getHeading);
|
|
ol.DeviceOrientation.prototype.getTracking=function(){return this.get(ol.DeviceOrientationProperty.TRACKING)};goog.exportProperty(ol.DeviceOrientation.prototype,"getTracking",ol.DeviceOrientation.prototype.getTracking);
|
|
ol.DeviceOrientation.prototype.handleTrackingChanged_=function(){if(ol.BrowserFeature.HAS_DEVICE_ORIENTATION){var a=this.getTracking();a&&goog.isNull(this.listenerKey_)?this.listenerKey_=goog.events.listen(goog.global,"deviceorientation",this.orientationChange_,!1,this):a||goog.isNull(this.listenerKey_)||(goog.events.unlistenByKey(this.listenerKey_),this.listenerKey_=null)}};ol.DeviceOrientation.prototype.setTracking=function(a){this.set(ol.DeviceOrientationProperty.TRACKING,a)};
|
|
goog.exportProperty(ol.DeviceOrientation.prototype,"setTracking",ol.DeviceOrientation.prototype.setTracking);goog.vec={};goog.vec.Float32Array=function(a){this.length=a.length||a;for(var b=0;b<this.length;b++)this[b]=a[b]||0};goog.vec.Float32Array.BYTES_PER_ELEMENT=4;goog.vec.Float32Array.prototype.BYTES_PER_ELEMENT=4;goog.vec.Float32Array.prototype.set=function(a,b){b=b||0;for(var c=0;c<a.length&&b+c<this.length;c++)this[b+c]=a[c]};goog.vec.Float32Array.prototype.toString=Array.prototype.join;
|
|
"undefined"==typeof Float32Array&&(goog.exportProperty(goog.vec.Float32Array,"BYTES_PER_ELEMENT",goog.vec.Float32Array.BYTES_PER_ELEMENT),goog.exportProperty(goog.vec.Float32Array.prototype,"BYTES_PER_ELEMENT",goog.vec.Float32Array.prototype.BYTES_PER_ELEMENT),goog.exportProperty(goog.vec.Float32Array.prototype,"set",goog.vec.Float32Array.prototype.set),goog.exportProperty(goog.vec.Float32Array.prototype,"toString",goog.vec.Float32Array.prototype.toString),goog.exportSymbol("Float32Array",goog.vec.Float32Array));goog.vec.Float64Array=function(a){this.length=a.length||a;for(var b=0;b<this.length;b++)this[b]=a[b]||0};goog.vec.Float64Array.BYTES_PER_ELEMENT=8;goog.vec.Float64Array.prototype.BYTES_PER_ELEMENT=8;goog.vec.Float64Array.prototype.set=function(a,b){b=b||0;for(var c=0;c<a.length&&b+c<this.length;c++)this[b+c]=a[c]};goog.vec.Float64Array.prototype.toString=Array.prototype.join;
|
|
if("undefined"==typeof Float64Array){try{goog.exportProperty(goog.vec.Float64Array,"BYTES_PER_ELEMENT",goog.vec.Float64Array.BYTES_PER_ELEMENT)}catch(float64ArrayError){}goog.exportProperty(goog.vec.Float64Array.prototype,"BYTES_PER_ELEMENT",goog.vec.Float64Array.prototype.BYTES_PER_ELEMENT);goog.exportProperty(goog.vec.Float64Array.prototype,"set",goog.vec.Float64Array.prototype.set);goog.exportProperty(goog.vec.Float64Array.prototype,"toString",goog.vec.Float64Array.prototype.toString);goog.exportSymbol("Float64Array",
|
|
goog.vec.Float64Array)};goog.vec.EPSILON=1E-6;goog.vec.Vec3={};goog.vec.Vec3.createFloat32=function(){return new Float32Array(3)};goog.vec.Vec3.createFloat64=function(){return new Float64Array(3)};goog.vec.Vec3.createNumber=function(){var a=Array(3);goog.vec.Vec3.setFromValues(a,0,0,0);return a};goog.vec.Vec3.create=function(){return new Float32Array(3)};goog.vec.Vec3.createFloat32FromArray=function(a){var b=goog.vec.Vec3.createFloat32();goog.vec.Vec3.setFromArray(b,a);return b};
|
|
goog.vec.Vec3.createFloat32FromValues=function(a,b,c){var d=goog.vec.Vec3.createFloat32();goog.vec.Vec3.setFromValues(d,a,b,c);return d};goog.vec.Vec3.cloneFloat32=goog.vec.Vec3.createFloat32FromArray;goog.vec.Vec3.createFloat64FromArray=function(a){var b=goog.vec.Vec3.createFloat64();goog.vec.Vec3.setFromArray(b,a);return b};goog.vec.Vec3.createFloat64FromValues=function(a,b,c){var d=goog.vec.Vec3.createFloat64();goog.vec.Vec3.setFromValues(d,a,b,c);return d};goog.vec.Vec3.cloneFloat64=goog.vec.Vec3.createFloat64FromArray;
|
|
goog.vec.Vec3.createFromArray=function(a){var b=goog.vec.Vec3.create();goog.vec.Vec3.setFromArray(b,a);return b};goog.vec.Vec3.createFromValues=function(a,b,c){var d=goog.vec.Vec3.create();goog.vec.Vec3.setFromValues(d,a,b,c);return d};goog.vec.Vec3.clone=function(a){var b=goog.vec.Vec3.create();goog.vec.Vec3.setFromArray(b,a);return b};goog.vec.Vec3.setFromValues=function(a,b,c,d){a[0]=b;a[1]=c;a[2]=d;return a};goog.vec.Vec3.setFromArray=function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];return a};
|
|
goog.vec.Vec3.add=function(a,b,c){c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];return c};goog.vec.Vec3.subtract=function(a,b,c){c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];return c};goog.vec.Vec3.negate=function(a,b){b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b};goog.vec.Vec3.scale=function(a,b,c){c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;return c};goog.vec.Vec3.magnitudeSquared=function(a){var b=a[0],c=a[1];a=a[2];return b*b+c*c+a*a};
|
|
goog.vec.Vec3.magnitude=function(a){var b=a[0],c=a[1];a=a[2];return Math.sqrt(b*b+c*c+a*a)};goog.vec.Vec3.normalize=function(a,b){var c=1/goog.vec.Vec3.magnitude(a);b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;return b};goog.vec.Vec3.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]};goog.vec.Vec3.cross=function(a,b,c){var d=a[0],e=a[1];a=a[2];var f=b[0],g=b[1];b=b[2];c[0]=e*b-a*g;c[1]=a*f-d*b;c[2]=d*g-e*f;return c};
|
|
goog.vec.Vec3.distanceSquared=function(a,b){var c=a[0]-b[0],d=a[1]-b[1],e=a[2]-b[2];return c*c+d*d+e*e};goog.vec.Vec3.distance=function(a,b){return Math.sqrt(goog.vec.Vec3.distanceSquared(a,b))};goog.vec.Vec3.direction=function(a,b,c){var d=b[0]-a[0],e=b[1]-a[1];a=b[2]-a[2];(b=Math.sqrt(d*d+e*e+a*a))?(b=1/b,c[0]=d*b,c[1]=e*b,c[2]=a*b):c[0]=c[1]=c[2]=0;return c};goog.vec.Vec3.lerp=function(a,b,c,d){var e=a[0],f=a[1];a=a[2];d[0]=(b[0]-e)*c+e;d[1]=(b[1]-f)*c+f;d[2]=(b[2]-a)*c+a;return d};
|
|
goog.vec.Vec3.equals=function(a,b){return a.length==b.length&&a[0]==b[0]&&a[1]==b[1]&&a[2]==b[2]};goog.vec.Vec4={};goog.vec.Vec4.createFloat32=function(){return new Float32Array(4)};goog.vec.Vec4.createFloat64=function(){return new Float64Array(4)};goog.vec.Vec4.createNumber=function(){var a=Array(4);goog.vec.Vec4.setFromValues(a,0,0,0,0);return a};goog.vec.Vec4.create=function(){return new Float32Array(4)};goog.vec.Vec4.createFromArray=function(a){var b=goog.vec.Vec4.create();goog.vec.Vec4.setFromArray(b,a);return b};
|
|
goog.vec.Vec4.createFloat32FromArray=function(a){var b=goog.vec.Vec4.createFloat32();goog.vec.Vec4.setFromArray(b,a);return b};goog.vec.Vec4.createFloat32FromValues=function(a,b,c,d){var e=goog.vec.Vec4.createFloat32();goog.vec.Vec4.setFromValues(e,a,b,c,d);return e};goog.vec.Vec4.cloneFloat32=goog.vec.Vec4.createFloat32FromArray;goog.vec.Vec4.createFloat64FromArray=function(a){var b=goog.vec.Vec4.createFloat64();goog.vec.Vec4.setFromArray(b,a);return b};
|
|
goog.vec.Vec4.createFloat64FromValues=function(a,b,c,d){var e=goog.vec.Vec4.createFloat64();goog.vec.Vec4.setFromValues(e,a,b,c,d);return e};goog.vec.Vec4.cloneFloat64=goog.vec.Vec4.createFloat64FromArray;goog.vec.Vec4.createFromValues=function(a,b,c,d){var e=goog.vec.Vec4.create();goog.vec.Vec4.setFromValues(e,a,b,c,d);return e};goog.vec.Vec4.clone=goog.vec.Vec4.createFromArray;goog.vec.Vec4.setFromValues=function(a,b,c,d,e){a[0]=b;a[1]=c;a[2]=d;a[3]=e;return a};
|
|
goog.vec.Vec4.setFromArray=function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];return a};goog.vec.Vec4.add=function(a,b,c){c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c};goog.vec.Vec4.subtract=function(a,b,c){c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c};goog.vec.Vec4.negate=function(a,b){b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b};goog.vec.Vec4.scale=function(a,b,c){c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c};
|
|
goog.vec.Vec4.magnitudeSquared=function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a};goog.vec.Vec4.magnitude=function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)};goog.vec.Vec4.normalize=function(a,b){var c=1/goog.vec.Vec4.magnitude(a);b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;return b};goog.vec.Vec4.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};
|
|
goog.vec.Vec4.lerp=function(a,b,c,d){var e=a[0],f=a[1],g=a[2];a=a[3];d[0]=(b[0]-e)*c+e;d[1]=(b[1]-f)*c+f;d[2]=(b[2]-g)*c+g;d[3]=(b[3]-a)*c+a;return d};goog.vec.Vec4.equals=function(a,b){return a.length==b.length&&a[0]==b[0]&&a[1]==b[1]&&a[2]==b[2]&&a[3]==b[3]};goog.vec.Mat4={};goog.vec.Mat4.createFloat32=function(){return new Float32Array(16)};goog.vec.Mat4.createFloat64=function(){return new Float64Array(16)};goog.vec.Mat4.createNumber=function(){var a=Array(16);goog.vec.Mat4.setFromValues(a,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return a};goog.vec.Mat4.create=function(){return goog.vec.Mat4.createFloat32()};goog.vec.Mat4.createFloat32Identity=function(){var a=goog.vec.Mat4.createFloat32();a[0]=a[5]=a[10]=a[15]=1;return a};
|
|
goog.vec.Mat4.createFloat64Identity=function(){var a=goog.vec.Mat4.createFloat64();a[0]=a[5]=a[10]=a[15]=1;return a};goog.vec.Mat4.createNumberIdentity=function(){var a=Array(16);goog.vec.Mat4.setFromValues(a,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return a};goog.vec.Mat4.createIdentity=function(){return goog.vec.Mat4.createFloat32Identity()};goog.vec.Mat4.createFloat32FromArray=function(a){var b=goog.vec.Mat4.createFloat32();goog.vec.Mat4.setFromArray(b,a);return b};
|
|
goog.vec.Mat4.createFloat32FromValues=function(a,b,c,d,e,f,g,h,k,l,m,n,p,r,q,u){var s=goog.vec.Mat4.createFloat32();goog.vec.Mat4.setFromValues(s,a,b,c,d,e,f,g,h,k,l,m,n,p,r,q,u);return s};goog.vec.Mat4.cloneFloat32=goog.vec.Mat4.createFloat32FromArray;goog.vec.Mat4.createFloat64FromArray=function(a){var b=goog.vec.Mat4.createFloat64();goog.vec.Mat4.setFromArray(b,a);return b};
|
|
goog.vec.Mat4.createFloat64FromValues=function(a,b,c,d,e,f,g,h,k,l,m,n,p,r,q,u){var s=goog.vec.Mat4.createFloat64();goog.vec.Mat4.setFromValues(s,a,b,c,d,e,f,g,h,k,l,m,n,p,r,q,u);return s};goog.vec.Mat4.cloneFloat64=goog.vec.Mat4.createFloat64FromArray;goog.vec.Mat4.createFromArray=function(a){var b=goog.vec.Mat4.createFloat32();goog.vec.Mat4.setFromArray(b,a);return b};
|
|
goog.vec.Mat4.createFromValues=function(a,b,c,d,e,f,g,h,k,l,m,n,p,r,q,u){return goog.vec.Mat4.createFloat32FromValues(a,b,c,d,e,f,g,h,k,l,m,n,p,r,q,u)};goog.vec.Mat4.clone=goog.vec.Mat4.createFromArray;goog.vec.Mat4.getElement=function(a,b,c){return a[b+4*c]};goog.vec.Mat4.setElement=function(a,b,c,d){a[b+4*c]=d;return a};
|
|
goog.vec.Mat4.setFromValues=function(a,b,c,d,e,f,g,h,k,l,m,n,p,r,q,u,s){a[0]=b;a[1]=c;a[2]=d;a[3]=e;a[4]=f;a[5]=g;a[6]=h;a[7]=k;a[8]=l;a[9]=m;a[10]=n;a[11]=p;a[12]=r;a[13]=q;a[14]=u;a[15]=s;return a};goog.vec.Mat4.setFromArray=function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[4]=b[4];a[5]=b[5];a[6]=b[6];a[7]=b[7];a[8]=b[8];a[9]=b[9];a[10]=b[10];a[11]=b[11];a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15];return a};
|
|
goog.vec.Mat4.setFromRowMajorArray=function(a,b){a[0]=b[0];a[1]=b[4];a[2]=b[8];a[3]=b[12];a[4]=b[1];a[5]=b[5];a[6]=b[9];a[7]=b[13];a[8]=b[2];a[9]=b[6];a[10]=b[10];a[11]=b[14];a[12]=b[3];a[13]=b[7];a[14]=b[11];a[15]=b[15];return a};goog.vec.Mat4.setDiagonalValues=function(a,b,c,d,e){a[0]=b;a[5]=c;a[10]=d;a[15]=e;return a};goog.vec.Mat4.setDiagonal=function(a,b){a[0]=b[0];a[5]=b[1];a[10]=b[2];a[15]=b[3];return a};
|
|
goog.vec.Mat4.getDiagonal=function(a,b,c){if(c)for(var d=0<c?4*c:-c,e=0;e<4-Math.abs(c);e++)b[e]=a[d+5*e];else b[0]=a[0],b[1]=a[5],b[2]=a[10],b[3]=a[15];return b};goog.vec.Mat4.setColumnValues=function(a,b,c,d,e,f){b*=4;a[b]=c;a[b+1]=d;a[b+2]=e;a[b+3]=f;return a};goog.vec.Mat4.setColumn=function(a,b,c){b*=4;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];return a};goog.vec.Mat4.getColumn=function(a,b,c){b*=4;c[0]=a[b];c[1]=a[b+1];c[2]=a[b+2];c[3]=a[b+3];return c};
|
|
goog.vec.Mat4.setColumns=function(a,b,c,d,e){goog.vec.Mat4.setColumn(a,0,b);goog.vec.Mat4.setColumn(a,1,c);goog.vec.Mat4.setColumn(a,2,d);goog.vec.Mat4.setColumn(a,3,e);return a};goog.vec.Mat4.getColumns=function(a,b,c,d,e){goog.vec.Mat4.getColumn(a,0,b);goog.vec.Mat4.getColumn(a,1,c);goog.vec.Mat4.getColumn(a,2,d);goog.vec.Mat4.getColumn(a,3,e)};goog.vec.Mat4.setRowValues=function(a,b,c,d,e,f){a[b]=c;a[b+4]=d;a[b+8]=e;a[b+12]=f;return a};
|
|
goog.vec.Mat4.setRow=function(a,b,c){a[b]=c[0];a[b+4]=c[1];a[b+8]=c[2];a[b+12]=c[3];return a};goog.vec.Mat4.getRow=function(a,b,c){c[0]=a[b];c[1]=a[b+4];c[2]=a[b+8];c[3]=a[b+12];return c};goog.vec.Mat4.setRows=function(a,b,c,d,e){goog.vec.Mat4.setRow(a,0,b);goog.vec.Mat4.setRow(a,1,c);goog.vec.Mat4.setRow(a,2,d);goog.vec.Mat4.setRow(a,3,e);return a};
|
|
goog.vec.Mat4.getRows=function(a,b,c,d,e){goog.vec.Mat4.getRow(a,0,b);goog.vec.Mat4.getRow(a,1,c);goog.vec.Mat4.getRow(a,2,d);goog.vec.Mat4.getRow(a,3,e)};goog.vec.Mat4.makeZero=function(a){a[0]=0;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=0;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=0;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=0;return a};goog.vec.Mat4.makeIdentity=function(a){a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};
|
|
goog.vec.Mat4.addMat=function(a,b,c){c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];c[4]=a[4]+b[4];c[5]=a[5]+b[5];c[6]=a[6]+b[6];c[7]=a[7]+b[7];c[8]=a[8]+b[8];c[9]=a[9]+b[9];c[10]=a[10]+b[10];c[11]=a[11]+b[11];c[12]=a[12]+b[12];c[13]=a[13]+b[13];c[14]=a[14]+b[14];c[15]=a[15]+b[15];return c};
|
|
goog.vec.Mat4.subMat=function(a,b,c){c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];c[4]=a[4]-b[4];c[5]=a[5]-b[5];c[6]=a[6]-b[6];c[7]=a[7]-b[7];c[8]=a[8]-b[8];c[9]=a[9]-b[9];c[10]=a[10]-b[10];c[11]=a[11]-b[11];c[12]=a[12]-b[12];c[13]=a[13]-b[13];c[14]=a[14]-b[14];c[15]=a[15]-b[15];return c};
|
|
goog.vec.Mat4.multScalar=function(a,b,c){c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;c[4]=a[4]*b;c[5]=a[5]*b;c[6]=a[6]*b;c[7]=a[7]*b;c[8]=a[8]*b;c[9]=a[9]*b;c[10]=a[10]*b;c[11]=a[11]*b;c[12]=a[12]*b;c[13]=a[13]*b;c[14]=a[14]*b;c[15]=a[15]*b;return c};
|
|
goog.vec.Mat4.multMat=function(a,b,c){var d=a[0],e=a[1],f=a[2],g=a[3],h=a[4],k=a[5],l=a[6],m=a[7],n=a[8],p=a[9],r=a[10],q=a[11],u=a[12],s=a[13],v=a[14];a=a[15];var t=b[0],B=b[1],w=b[2],z=b[3],x=b[4],A=b[5],C=b[6],G=b[7],H=b[8],E=b[9],y=b[10],D=b[11],F=b[12],J=b[13],I=b[14];b=b[15];c[0]=d*t+h*B+n*w+u*z;c[1]=e*t+k*B+p*w+s*z;c[2]=f*t+l*B+r*w+v*z;c[3]=g*t+m*B+q*w+a*z;c[4]=d*x+h*A+n*C+u*G;c[5]=e*x+k*A+p*C+s*G;c[6]=f*x+l*A+r*C+v*G;c[7]=g*x+m*A+q*C+a*G;c[8]=d*H+h*E+n*y+u*D;c[9]=e*H+k*E+p*y+s*D;c[10]=f*H+
|
|
l*E+r*y+v*D;c[11]=g*H+m*E+q*y+a*D;c[12]=d*F+h*J+n*I+u*b;c[13]=e*F+k*J+p*I+s*b;c[14]=f*F+l*J+r*I+v*b;c[15]=g*F+m*J+q*I+a*b;return c};
|
|
goog.vec.Mat4.transpose=function(a,b){if(b==a){var c=a[1],d=a[2],e=a[3],f=a[6],g=a[7],h=a[11];b[1]=a[4];b[2]=a[8];b[3]=a[12];b[4]=c;b[6]=a[9];b[7]=a[13];b[8]=d;b[9]=f;b[11]=a[14];b[12]=e;b[13]=g;b[14]=h}else b[0]=a[0],b[1]=a[4],b[2]=a[8],b[3]=a[12],b[4]=a[1],b[5]=a[5],b[6]=a[9],b[7]=a[13],b[8]=a[2],b[9]=a[6],b[10]=a[10],b[11]=a[14],b[12]=a[3],b[13]=a[7],b[14]=a[11],b[15]=a[15];return b};
|
|
goog.vec.Mat4.determinant=function(a){var b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],k=a[7],l=a[8],m=a[9],n=a[10],p=a[11],r=a[12],q=a[13],u=a[14];a=a[15];return(b*g-c*f)*(n*a-p*u)-(b*h-d*f)*(m*a-p*q)+(b*k-e*f)*(m*u-n*q)+(c*h-d*g)*(l*a-p*r)-(c*k-e*g)*(l*u-n*r)+(d*k-e*h)*(l*q-m*r)};
|
|
goog.vec.Mat4.invert=function(a,b){var c=a[0],d=a[1],e=a[2],f=a[3],g=a[4],h=a[5],k=a[6],l=a[7],m=a[8],n=a[9],p=a[10],r=a[11],q=a[12],u=a[13],s=a[14],v=a[15],t=c*h-d*g,B=c*k-e*g,w=c*l-f*g,z=d*k-e*h,x=d*l-f*h,A=e*l-f*k,C=m*u-n*q,G=m*s-p*q,H=m*v-r*q,E=n*s-p*u,y=n*v-r*u,D=p*v-r*s,F=t*D-B*y+w*E+z*H-x*G+A*C;if(0==F)return!1;F=1/F;b[0]=(h*D-k*y+l*E)*F;b[1]=(-d*D+e*y-f*E)*F;b[2]=(u*A-s*x+v*z)*F;b[3]=(-n*A+p*x-r*z)*F;b[4]=(-g*D+k*H-l*G)*F;b[5]=(c*D-e*H+f*G)*F;b[6]=(-q*A+s*w-v*B)*F;b[7]=(m*A-p*w+r*B)*F;b[8]=
|
|
(g*y-h*H+l*C)*F;b[9]=(-c*y+d*H-f*C)*F;b[10]=(q*x-u*w+v*t)*F;b[11]=(-m*x+n*w-r*t)*F;b[12]=(-g*E+h*G-k*C)*F;b[13]=(c*E-d*G+e*C)*F;b[14]=(-q*z+u*B-s*t)*F;b[15]=(m*z-n*B+p*t)*F;return!0};goog.vec.Mat4.equals=function(a,b){return a.length==b.length&&a[0]==b[0]&&a[1]==b[1]&&a[2]==b[2]&&a[3]==b[3]&&a[4]==b[4]&&a[5]==b[5]&&a[6]==b[6]&&a[7]==b[7]&&a[8]==b[8]&&a[9]==b[9]&&a[10]==b[10]&&a[11]==b[11]&&a[12]==b[12]&&a[13]==b[13]&&a[14]==b[14]&&a[15]==b[15]};
|
|
goog.vec.Mat4.multVec3=function(a,b,c){var d=b[0],e=b[1];b=b[2];c[0]=d*a[0]+e*a[4]+b*a[8]+a[12];c[1]=d*a[1]+e*a[5]+b*a[9]+a[13];c[2]=d*a[2]+e*a[6]+b*a[10]+a[14];return c};goog.vec.Mat4.multVec3NoTranslate=function(a,b,c){var d=b[0],e=b[1];b=b[2];c[0]=d*a[0]+e*a[4]+b*a[8];c[1]=d*a[1]+e*a[5]+b*a[9];c[2]=d*a[2]+e*a[6]+b*a[10];return c};
|
|
goog.vec.Mat4.multVec3Projective=function(a,b,c){var d=b[0],e=b[1];b=b[2];var f=1/(d*a[3]+e*a[7]+b*a[11]+a[15]);c[0]=(d*a[0]+e*a[4]+b*a[8]+a[12])*f;c[1]=(d*a[1]+e*a[5]+b*a[9]+a[13])*f;c[2]=(d*a[2]+e*a[6]+b*a[10]+a[14])*f;return c};goog.vec.Mat4.multVec4=function(a,b,c){var d=b[0],e=b[1],f=b[2];b=b[3];c[0]=d*a[0]+e*a[4]+f*a[8]+b*a[12];c[1]=d*a[1]+e*a[5]+f*a[9]+b*a[13];c[2]=d*a[2]+e*a[6]+f*a[10]+b*a[14];c[3]=d*a[3]+e*a[7]+f*a[11]+b*a[15];return c};
|
|
goog.vec.Mat4.makeTranslate=function(a,b,c,d){goog.vec.Mat4.makeIdentity(a);return goog.vec.Mat4.setColumnValues(a,3,b,c,d,1)};goog.vec.Mat4.makeScale=function(a,b,c,d){goog.vec.Mat4.makeIdentity(a);return goog.vec.Mat4.setDiagonalValues(a,b,c,d,1)};goog.vec.Mat4.makeRotate=function(a,b,c,d,e){var f=Math.cos(b),g=1-f;b=Math.sin(b);return goog.vec.Mat4.setFromValues(a,c*c*g+f,c*d*g+e*b,c*e*g-d*b,0,c*d*g-e*b,d*d*g+f,d*e*g+c*b,0,c*e*g+d*b,d*e*g-c*b,e*e*g+f,0,0,0,0,1)};
|
|
goog.vec.Mat4.makeRotateX=function(a,b){var c=Math.cos(b),d=Math.sin(b);return goog.vec.Mat4.setFromValues(a,1,0,0,0,0,c,d,0,0,-d,c,0,0,0,0,1)};goog.vec.Mat4.makeRotateY=function(a,b){var c=Math.cos(b),d=Math.sin(b);return goog.vec.Mat4.setFromValues(a,c,0,-d,0,0,1,0,0,d,0,c,0,0,0,0,1)};goog.vec.Mat4.makeRotateZ=function(a,b){var c=Math.cos(b),d=Math.sin(b);return goog.vec.Mat4.setFromValues(a,c,d,0,0,-d,c,0,0,0,0,1,0,0,0,0,1)};
|
|
goog.vec.Mat4.makeFrustum=function(a,b,c,d,e,f,g){return goog.vec.Mat4.setFromValues(a,2*f/(c-b),0,0,0,0,2*f/(e-d),0,0,(c+b)/(c-b),(e+d)/(e-d),-(g+f)/(g-f),-1,0,0,-(2*g*f)/(g-f),0)};goog.vec.Mat4.makePerspective=function(a,b,c,d,e){var f=b/2;b=e-d;var g=Math.sin(f);if(0==b||0==g||0==c)return a;f=Math.cos(f)/g;return goog.vec.Mat4.setFromValues(a,f/c,0,0,0,0,f,0,0,0,0,-(e+d)/b,-1,0,0,-(2*d*e)/b,0)};
|
|
goog.vec.Mat4.makeOrtho=function(a,b,c,d,e,f,g){return goog.vec.Mat4.setFromValues(a,2/(c-b),0,0,0,0,2/(e-d),0,0,0,0,-2/(g-f),0,-(c+b)/(c-b),-(e+d)/(e-d),-(g+f)/(g-f),1)};
|
|
goog.vec.Mat4.makeLookAt=function(a,b,c,d){var e=goog.vec.Mat4.tmpVec4_[0];goog.vec.Vec3.subtract(c,b,e);goog.vec.Vec3.normalize(e,e);e[3]=0;c=goog.vec.Mat4.tmpVec4_[1];goog.vec.Vec3.cross(e,d,c);goog.vec.Vec3.normalize(c,c);c[3]=0;d=goog.vec.Mat4.tmpVec4_[2];goog.vec.Vec3.cross(c,e,d);goog.vec.Vec3.normalize(d,d);d[3]=0;goog.vec.Vec3.negate(e,e);goog.vec.Mat4.setRow(a,0,c);goog.vec.Mat4.setRow(a,1,d);goog.vec.Mat4.setRow(a,2,e);goog.vec.Mat4.setRowValues(a,3,0,0,0,1);goog.vec.Mat4.translate(a,-b[0],
|
|
-b[1],-b[2]);return a};goog.vec.Mat4.toLookAt=function(a,b,c,d){var e=goog.vec.Mat4.tmpMat4_[0];if(!goog.vec.Mat4.invert(a,e))return!1;b&&(b[0]=e[12],b[1]=e[13],b[2]=e[14]);if(c||d)c||(c=goog.vec.Mat4.tmpVec3_[0]),c[0]=-a[2],c[1]=-a[6],c[2]=-a[10],goog.vec.Vec3.normalize(c,c);d&&(b=goog.vec.Mat4.tmpVec3_[1],b[0]=a[0],b[1]=a[4],b[2]=a[8],goog.vec.Vec3.cross(b,c,d),goog.vec.Vec3.normalize(d,d));return!0};
|
|
goog.vec.Mat4.makeEulerZXZ=function(a,b,c,d){var e=Math.cos(b);b=Math.sin(b);var f=Math.cos(c);c=Math.sin(c);var g=Math.cos(d);d=Math.sin(d);a[0]=e*g-f*b*d;a[1]=f*e*d+g*b;a[2]=d*c;a[3]=0;a[4]=-e*d-g*f*b;a[5]=e*f*g-b*d;a[6]=g*c;a[7]=0;a[8]=c*b;a[9]=-e*c;a[10]=f;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};
|
|
goog.vec.Mat4.toEulerZXZ=function(a,b,c){var d=Math.sqrt(a[2]*a[2]+a[6]*a[6]);c=c?-1:1;d>goog.vec.EPSILON?(b[2]=Math.atan2(a[2]*c,a[6]*c),b[1]=Math.atan2(d*c,a[10]),b[0]=Math.atan2(a[8]*c,-a[9]*c)):(b[0]=0,b[1]=Math.atan2(d*c,a[10]),b[2]=Math.atan2(a[1],a[0]));b[0]=(b[0]+2*Math.PI)%(2*Math.PI);b[2]=(b[2]+2*Math.PI)%(2*Math.PI);b[1]=(b[1]*c+2*Math.PI)%(2*Math.PI)*c;return b};
|
|
goog.vec.Mat4.translate=function(a,b,c,d){return goog.vec.Mat4.setColumnValues(a,3,a[0]*b+a[4]*c+a[8]*d+a[12],a[1]*b+a[5]*c+a[9]*d+a[13],a[2]*b+a[6]*c+a[10]*d+a[14],a[3]*b+a[7]*c+a[11]*d+a[15])};goog.vec.Mat4.scale=function(a,b,c,d){return goog.vec.Mat4.setFromValues(a,a[0]*b,a[1]*b,a[2]*b,a[3]*b,a[4]*c,a[5]*c,a[6]*c,a[7]*c,a[8]*d,a[9]*d,a[10]*d,a[11]*d,a[12],a[13],a[14],a[15])};
|
|
goog.vec.Mat4.rotate=function(a,b,c,d,e){var f=a[0],g=a[1],h=a[2],k=a[3],l=a[4],m=a[5],n=a[6],p=a[7],r=a[8],q=a[9],u=a[10],s=a[11],v=a[12],t=a[13],B=a[14],w=a[15],z=Math.cos(b),x=Math.sin(b),A=1-z;b=c*c*A+z;var C=c*d*A+e*x,G=c*e*A-d*x,H=c*d*A-e*x,E=d*d*A+z,y=d*e*A+c*x,D=c*e*A+d*x;c=d*e*A-c*x;e=e*e*A+z;return goog.vec.Mat4.setFromValues(a,f*b+l*C+r*G,g*b+m*C+q*G,h*b+n*C+u*G,k*b+p*C+s*G,f*H+l*E+r*y,g*H+m*E+q*y,h*H+n*E+u*y,k*H+p*E+s*y,f*D+l*c+r*e,g*D+m*c+q*e,h*D+n*c+u*e,k*D+p*c+s*e,v,t,B,w)};
|
|
goog.vec.Mat4.rotateX=function(a,b){var c=a[4],d=a[5],e=a[6],f=a[7],g=a[8],h=a[9],k=a[10],l=a[11],m=Math.cos(b),n=Math.sin(b);a[4]=c*m+g*n;a[5]=d*m+h*n;a[6]=e*m+k*n;a[7]=f*m+l*n;a[8]=c*-n+g*m;a[9]=d*-n+h*m;a[10]=e*-n+k*m;a[11]=f*-n+l*m;return a};goog.vec.Mat4.rotateY=function(a,b){var c=a[0],d=a[1],e=a[2],f=a[3],g=a[8],h=a[9],k=a[10],l=a[11],m=Math.cos(b),n=Math.sin(b);a[0]=c*m+g*-n;a[1]=d*m+h*-n;a[2]=e*m+k*-n;a[3]=f*m+l*-n;a[8]=c*n+g*m;a[9]=d*n+h*m;a[10]=e*n+k*m;a[11]=f*n+l*m;return a};
|
|
goog.vec.Mat4.rotateZ=function(a,b){var c=a[0],d=a[1],e=a[2],f=a[3],g=a[4],h=a[5],k=a[6],l=a[7],m=Math.cos(b),n=Math.sin(b);a[0]=c*m+g*n;a[1]=d*m+h*n;a[2]=e*m+k*n;a[3]=f*m+l*n;a[4]=c*-n+g*m;a[5]=d*-n+h*m;a[6]=e*-n+k*m;a[7]=f*-n+l*m;return a};goog.vec.Mat4.getTranslation=function(a,b){b[0]=a[12];b[1]=a[13];b[2]=a[14];return b};goog.vec.Mat4.tmpVec3_=[goog.vec.Vec3.createFloat64(),goog.vec.Vec3.createFloat64()];goog.vec.Mat4.tmpVec4_=[goog.vec.Vec4.createFloat64(),goog.vec.Vec4.createFloat64(),goog.vec.Vec4.createFloat64()];
|
|
goog.vec.Mat4.tmpMat4_=[goog.vec.Mat4.createFloat64()];ol.extent={};ol.extent.Relationship={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};ol.extent.boundingExtent=function(a){for(var b=ol.extent.createEmpty(),c=0,d=a.length;c<d;++c)ol.extent.extendCoordinate(b,a[c]);return b};ol.extent.boundingExtentXYs_=function(a,b,c){var d=Math.min.apply(null,a),e=Math.min.apply(null,b);a=Math.max.apply(null,a);b=Math.max.apply(null,b);return ol.extent.createOrUpdate(d,e,a,b,c)};
|
|
ol.extent.buffer=function(a,b,c){return goog.isDef(c)?(c[0]=a[0]-b,c[1]=a[1]-b,c[2]=a[2]+b,c[3]=a[3]+b,c):[a[0]-b,a[1]-b,a[2]+b,a[3]+b]};ol.extent.clone=function(a,b){return goog.isDef(b)?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b):a.slice()};ol.extent.closestSquaredDistanceXY=function(a,b,c){b=b<a[0]?a[0]-b:a[2]<b?b-a[2]:0;a=c<a[1]?a[1]-c:a[3]<c?c-a[3]:0;return b*b+a*a};ol.extent.containsCoordinate=function(a,b){return a[0]<=b[0]&&b[0]<=a[2]&&a[1]<=b[1]&&b[1]<=a[3]};
|
|
ol.extent.containsExtent=function(a,b){return a[0]<=b[0]&&b[2]<=a[2]&&a[1]<=b[1]&&b[3]<=a[3]};ol.extent.coordinateRelationship=function(a,b){var c=a[1],d=a[2],e=a[3],f=b[0],g=b[1],h=ol.extent.Relationship.UNKNOWN;f<a[0]?h|=ol.extent.Relationship.LEFT:f>d&&(h|=ol.extent.Relationship.RIGHT);g<c?h|=ol.extent.Relationship.BELOW:g>e&&(h|=ol.extent.Relationship.ABOVE);h===ol.extent.Relationship.UNKNOWN&&(h=ol.extent.Relationship.INTERSECTING);return h};
|
|
ol.extent.createEmpty=function(){return[Infinity,Infinity,-Infinity,-Infinity]};ol.extent.createOrUpdate=function(a,b,c,d,e){return goog.isDef(e)?(e[0]=a,e[1]=b,e[2]=c,e[3]=d,e):[a,b,c,d]};ol.extent.createOrUpdateEmpty=function(a){return ol.extent.createOrUpdate(Infinity,Infinity,-Infinity,-Infinity,a)};ol.extent.createOrUpdateFromCoordinate=function(a,b){var c=a[0],d=a[1];return ol.extent.createOrUpdate(c,d,c,d,b)};
|
|
ol.extent.createOrUpdateFromCoordinates=function(a,b){var c=ol.extent.createOrUpdateEmpty(b);return ol.extent.extendCoordinates(c,a)};ol.extent.createOrUpdateFromFlatCoordinates=function(a,b,c,d,e){e=ol.extent.createOrUpdateEmpty(e);return ol.extent.extendFlatCoordinates(e,a,b,c,d)};ol.extent.createOrUpdateFromRings=function(a,b){var c=ol.extent.createOrUpdateEmpty(b);return ol.extent.extendRings(c,a)};ol.extent.empty=function(a){a[0]=a[1]=Infinity;a[2]=a[3]=-Infinity;return a};
|
|
ol.extent.equals=function(a,b){return a[0]==b[0]&&a[2]==b[2]&&a[1]==b[1]&&a[3]==b[3]};ol.extent.extend=function(a,b){b[0]<a[0]&&(a[0]=b[0]);b[2]>a[2]&&(a[2]=b[2]);b[1]<a[1]&&(a[1]=b[1]);b[3]>a[3]&&(a[3]=b[3]);return a};ol.extent.extendCoordinate=function(a,b){b[0]<a[0]&&(a[0]=b[0]);b[0]>a[2]&&(a[2]=b[0]);b[1]<a[1]&&(a[1]=b[1]);b[1]>a[3]&&(a[3]=b[1])};ol.extent.extendCoordinates=function(a,b){var c,d;c=0;for(d=b.length;c<d;++c)ol.extent.extendCoordinate(a,b[c]);return a};
|
|
ol.extent.extendFlatCoordinates=function(a,b,c,d,e){for(;c<d;c+=e)ol.extent.extendXY(a,b[c],b[c+1]);return a};ol.extent.extendRings=function(a,b){var c,d;c=0;for(d=b.length;c<d;++c)ol.extent.extendCoordinates(a,b[c]);return a};ol.extent.extendXY=function(a,b,c){a[0]=Math.min(a[0],b);a[1]=Math.min(a[1],c);a[2]=Math.max(a[2],b);a[3]=Math.max(a[3],c)};ol.extent.getArea=function(a){return ol.extent.getWidth(a)*ol.extent.getHeight(a)};ol.extent.getBottomLeft=function(a){return[a[0],a[1]]};
|
|
ol.extent.getBottomRight=function(a){return[a[2],a[1]]};ol.extent.getCenter=function(a){return[(a[0]+a[2])/2,(a[1]+a[3])/2]};ol.extent.getEnlargedArea=function(a,b){var c=Math.min(a[0],b[0]),d=Math.min(a[1],b[1]),e=Math.max(a[2],b[2]),f=Math.max(a[3],b[3]);return(e-c)*(f-d)};
|
|
ol.extent.getForView2DAndSize=function(a,b,c,d,e){var f=b*d[0]/2;d=b*d[1]/2;b=Math.cos(c);c=Math.sin(c);f=[-f,-f,f,f];d=[-d,d,-d,d];var g,h,k;for(g=0;4>g;++g)h=f[g],k=d[g],f[g]=a[0]+h*b-k*c,d[g]=a[1]+h*c+k*b;return ol.extent.boundingExtentXYs_(f,d,e)};ol.extent.getHeight=function(a){return a[3]-a[1]};ol.extent.getIntersectionArea=function(a,b){var c=Math.max(a[0],b[0]),d=Math.max(a[1],b[1]),e=Math.min(a[2],b[2]),f=Math.min(a[3],b[3]);return Math.max(0,e-c)*Math.max(0,f-d)};
|
|
ol.extent.getMargin=function(a){return ol.extent.getWidth(a)+ol.extent.getHeight(a)};ol.extent.getSize=function(a){return[a[2]-a[0],a[3]-a[1]]};ol.extent.getTopLeft=function(a){return[a[0],a[3]]};ol.extent.getTopRight=function(a){return[a[2],a[3]]};ol.extent.getWidth=function(a){return a[2]-a[0]};ol.extent.intersects=function(a,b){return a[0]<=b[2]&&a[2]>=b[0]&&a[1]<=b[3]&&a[3]>=b[1]};ol.extent.isEmpty=function(a){return a[2]<a[0]||a[3]<a[1]};
|
|
ol.extent.normalize=function(a,b){return[(b[0]-a[0])/(a[2]-a[0]),(b[1]-a[1])/(a[3]-a[1])]};ol.extent.returnOrUpdate=function(a,b){return goog.isDef(b)?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b):a};ol.extent.scaleFromCenter=function(a,b){var c=(a[2]-a[0])/2*(b-1),d=(a[3]-a[1])/2*(b-1);a[0]-=c;a[2]+=c;a[1]-=d;a[3]+=d};
|
|
ol.extent.segmentIntersects=function(a,b,c){var d=!1,e=ol.extent.coordinateRelationship(a,b),f=ol.extent.coordinateRelationship(a,c);if(e===ol.extent.Relationship.INTERSECTING||f===ol.extent.Relationship.INTERSECTING)d=!0;else{var g=a[0],h=a[1],k=a[2];a=a[3];var l=c[0];c=c[1];b=(c-b[1])/(l-b[0]);f&ol.extent.Relationship.ABOVE&&!(e&ol.extent.Relationship.ABOVE)?(h=l-(c-a)/b,d=h>=g&&h<=k):f&ol.extent.Relationship.RIGHT&&!(e&ol.extent.Relationship.RIGHT)?(g=c-(l-k)*b,d=g>=h&&g<=a):f&ol.extent.Relationship.BELOW&&
|
|
!(e&ol.extent.Relationship.BELOW)?(h=l-(c-h)/b,d=h>=g&&h<=k):f&ol.extent.Relationship.LEFT&&!(e&ol.extent.Relationship.LEFT)&&(g=c-(l-g)*b,d=g>=h&&g<=a)}return d};ol.extent.touches=function(a,b){return ol.extent.intersects(a,b)&&(a[0]==b[2]||a[2]==b[0]||a[1]==b[3]||a[3]==b[1])};ol.extent.transform=function(a,b,c){a=[a[0],a[1],a[0],a[3],a[2],a[1],a[2],a[3]];b(a,a,2);return ol.extent.boundingExtentXYs_([a[0],a[2],a[4],a[6]],[a[1],a[3],a[5],a[7]],c)};
|
|
ol.extent.transform2D=function(a,b,c){c=goog.isDef(c)?c:[];var d=goog.vec.Mat4.getElement(b,0,0),e=goog.vec.Mat4.getElement(b,1,0),f=goog.vec.Mat4.getElement(b,0,1),g=goog.vec.Mat4.getElement(b,1,1),h=goog.vec.Mat4.getElement(b,0,3);b=goog.vec.Mat4.getElement(b,1,3);var k=[0,2,0,2],l=[1,1,3,3],m=[],n=[],p,r,q;for(p=0;4>p;++p)r=a[k[p]],q=a[l[p]],m[p]=d*r+f*q+h,n[p]=e*r+g*q+b;c[0]=Math.min.apply(null,m);c[1]=Math.min.apply(null,n);c[2]=Math.max.apply(null,m);c[3]=Math.max.apply(null,n);return c};ol.TileState={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};ol.Tile=function(a,b){goog.events.EventTarget.call(this);this.tileCoord=a;this.state=b};goog.inherits(ol.Tile,goog.events.EventTarget);ol.Tile.prototype.dispatchChangeEvent=function(){this.dispatchEvent(goog.events.EventType.CHANGE)};ol.Tile.prototype.getKey=function(){return goog.getUid(this).toString()};ol.Tile.prototype.getTileCoord=function(){return this.tileCoord};ol.Tile.prototype.getState=function(){return this.state};ol.structs={};ol.structs.PriorityQueue=function(a,b){this.priorityFunction_=a;this.keyFunction_=b;this.elements_=[];this.priorities_=[];this.queuedElements_={}};ol.structs.PriorityQueue.DROP=Infinity;ol.structs.PriorityQueue.prototype.assertValid=function(){var a=this.elements_.length,b;for(b=0;b<(a>>1)-1;++b);};ol.structs.PriorityQueue.prototype.clear=function(){this.elements_.length=0;this.priorities_.length=0;goog.object.clear(this.queuedElements_)};
|
|
ol.structs.PriorityQueue.prototype.dequeue=function(){var a=this.elements_,b=this.priorities_,c=a[0];1==a.length?(a.length=0,b.length=0):(a[0]=a.pop(),b[0]=b.pop(),this.siftUp_(0));a=this.keyFunction_(c);delete this.queuedElements_[a];return c};ol.structs.PriorityQueue.prototype.enqueue=function(a){var b=this.priorityFunction_(a);b!=ol.structs.PriorityQueue.DROP&&(this.elements_.push(a),this.priorities_.push(b),this.queuedElements_[this.keyFunction_(a)]=!0,this.siftDown_(0,this.elements_.length-1))};
|
|
ol.structs.PriorityQueue.prototype.getCount=function(){return this.elements_.length};ol.structs.PriorityQueue.prototype.getLeftChildIndex_=function(a){return 2*a+1};ol.structs.PriorityQueue.prototype.getRightChildIndex_=function(a){return 2*a+2};ol.structs.PriorityQueue.prototype.getParentIndex_=function(a){return a-1>>1};ol.structs.PriorityQueue.prototype.heapify_=function(){var a;for(a=(this.elements_.length>>1)-1;0<=a;a--)this.siftUp_(a)};
|
|
ol.structs.PriorityQueue.prototype.isEmpty=function(){return 0===this.elements_.length};ol.structs.PriorityQueue.prototype.isKeyQueued=function(a){return a in this.queuedElements_};ol.structs.PriorityQueue.prototype.isQueued=function(a){return this.isKeyQueued(this.keyFunction_(a))};
|
|
ol.structs.PriorityQueue.prototype.siftUp_=function(a){for(var b=this.elements_,c=this.priorities_,d=b.length,e=b[a],f=c[a],g=a;a<d>>1;){var h=this.getLeftChildIndex_(a),k=this.getRightChildIndex_(a),h=k<d&&c[k]<c[h]?k:h;b[a]=b[h];c[a]=c[h];a=h}b[a]=e;c[a]=f;this.siftDown_(g,a)};ol.structs.PriorityQueue.prototype.siftDown_=function(a,b){for(var c=this.elements_,d=this.priorities_,e=c[b],f=d[b];b>a;){var g=this.getParentIndex_(b);if(d[g]>f)c[b]=c[g],d[b]=d[g],b=g;else break}c[b]=e;d[b]=f};
|
|
ol.structs.PriorityQueue.prototype.reprioritize=function(){var a=this.priorityFunction_,b=this.elements_,c=this.priorities_,d=0,e=b.length,f,g,h;for(g=0;g<e;++g)f=b[g],h=a(f),h==ol.structs.PriorityQueue.DROP?delete this.queuedElements_[this.keyFunction_(f)]:(c[d]=h,b[d++]=f);b.length=d;c.length=d;this.heapify_()};ol.TileQueue=function(a,b){ol.structs.PriorityQueue.call(this,function(b){return a.apply(null,b)},function(a){return a[0].getKey()});this.tileChangeCallback_=b;this.tilesLoading_=0};goog.inherits(ol.TileQueue,ol.structs.PriorityQueue);ol.TileQueue.prototype.getTilesLoading=function(){return this.tilesLoading_};ol.TileQueue.prototype.handleTileChange=function(){--this.tilesLoading_;this.tileChangeCallback_()};
|
|
ol.TileQueue.prototype.loadMoreTiles=function(a,b){var c=Math.min(a-this.getTilesLoading(),b,this.getCount()),d,e;for(d=0;d<c;++d)e=this.dequeue()[0],goog.events.listenOnce(e,goog.events.EventType.CHANGE,this.handleTileChange,!1,this),e.load();this.tilesLoading_+=c};ol.IView2D=function(){};ol.IView2D.prototype.getCenter=function(){};ol.IView2D.prototype.getProjection=function(){};ol.IView2D.prototype.getResolution=function(){};ol.IView2D.prototype.getRotation=function(){};ol.IView2D.prototype.getView2DState=function(){};ol.IView2D.prototype.isDef=function(){};/*
|
|
|
|
Latitude/longitude spherical geodesy formulae taken from
|
|
http://www.movable-type.co.uk/scripts/latlong.html
|
|
Licenced under CC-BY-3.0.
|
|
*/
|
|
ol.Sphere=function(a){this.radius=a};ol.Sphere.prototype.cosineDistance=function(a,b){var c=goog.math.toRadians(a[1]),d=goog.math.toRadians(b[1]),e=goog.math.toRadians(b[0]-a[0]);return this.radius*Math.acos(Math.sin(c)*Math.sin(d)+Math.cos(c)*Math.cos(d)*Math.cos(e))};
|
|
ol.Sphere.prototype.crossTrackDistance=function(a,b,c){var d=this.cosineDistance(a,b);b=goog.math.toRadians(this.initialBearing(a,b));a=goog.math.toRadians(this.initialBearing(a,c));return this.radius*Math.asin(Math.sin(d/this.radius)*Math.sin(a-b))};ol.Sphere.prototype.equirectangularDistance=function(a,b){var c=goog.math.toRadians(a[1]),d=goog.math.toRadians(b[1]),e=goog.math.toRadians(b[0]-a[0])*Math.cos((c+d)/2),c=d-c;return this.radius*Math.sqrt(e*e+c*c)};
|
|
ol.Sphere.prototype.finalBearing=function(a,b){return(this.initialBearing(b,a)+180)%360};ol.Sphere.prototype.haversineDistance=function(a,b){var c=goog.math.toRadians(a[1]),d=goog.math.toRadians(b[1]),e=(d-c)/2,f=goog.math.toRadians(b[0]-a[0])/2,c=Math.sin(e)*Math.sin(e)+Math.sin(f)*Math.sin(f)*Math.cos(c)*Math.cos(d);return 2*this.radius*Math.atan2(Math.sqrt(c),Math.sqrt(1-c))};
|
|
ol.Sphere.prototype.initialBearing=function(a,b){var c=goog.math.toRadians(a[1]),d=goog.math.toRadians(b[1]),e=goog.math.toRadians(b[0]-a[0]),f=Math.sin(e)*Math.cos(d),c=Math.cos(c)*Math.sin(d)-Math.sin(c)*Math.cos(d)*Math.cos(e);return goog.math.toDegrees(Math.atan2(f,c))};ol.Sphere.prototype.maximumLatitude=function(a,b){return Math.cos(Math.abs(Math.sin(goog.math.toRadians(a))*Math.cos(goog.math.toRadians(b))))};
|
|
ol.Sphere.prototype.midpoint=function(a,b){var c=goog.math.toRadians(a[1]),d=goog.math.toRadians(b[1]),e=goog.math.toRadians(a[0]),f=goog.math.toRadians(b[0]-a[0]),g=Math.cos(d)*Math.cos(f),f=Math.cos(d)*Math.sin(f),g=Math.cos(c)+g,c=Math.atan2(Math.sin(c)+Math.sin(d),Math.sqrt(g*g+f*f)),e=e+Math.atan2(f,g);return[goog.math.toDegrees(e),goog.math.toDegrees(c)]};
|
|
ol.Sphere.prototype.offset=function(a,b,c){var d=goog.math.toRadians(a[1]);a=goog.math.toRadians(a[0]);var e=b/this.radius;b=Math.asin(Math.sin(d)*Math.cos(e)+Math.cos(d)*Math.sin(e)*Math.cos(c));c=a+Math.atan2(Math.sin(c)*Math.sin(e)*Math.cos(d),Math.cos(e)-Math.sin(d)*Math.sin(b));return[goog.math.toDegrees(c),goog.math.toDegrees(b)]};ol.sphere={};ol.sphere.NORMAL=new ol.Sphere(6370997);ol.proj={};ol.proj.METERS_PER_UNIT={};ol.ENABLE_PROJ4JS=!0;ol.HAVE_PROJ4JS=ol.ENABLE_PROJ4JS&&"object"==typeof Proj4js;ol.proj.Units={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels"};ol.proj.METERS_PER_UNIT[ol.proj.Units.DEGREES]=2*Math.PI*ol.sphere.NORMAL.radius/360;ol.proj.METERS_PER_UNIT[ol.proj.Units.FEET]=0.3048;ol.proj.METERS_PER_UNIT[ol.proj.Units.METERS]=1;
|
|
ol.proj.Projection=function(a){this.code_=a.code;this.units_=a.units;this.extent_=goog.isDef(a.extent)?a.extent:null;this.axisOrientation_=goog.isDef(a.axisOrientation)?a.axisOrientation:"enu";this.global_=goog.isDef(a.global)?a.global:!1;this.defaultTileGrid_=null};ol.proj.Projection.prototype.getCode=function(){return this.code_};ol.proj.Projection.prototype.getExtent=function(){return this.extent_};ol.proj.Projection.prototype.getUnits=function(){return this.units_};
|
|
ol.proj.Projection.prototype.getMetersPerUnit=function(){return ol.proj.METERS_PER_UNIT[this.units_]};ol.proj.Projection.prototype.getAxisOrientation=function(){return this.axisOrientation_};ol.proj.Projection.prototype.isGlobal=function(){return this.global_};ol.proj.Projection.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_};ol.proj.Projection.prototype.setDefaultTileGrid=function(a){this.defaultTileGrid_=a};
|
|
ol.Proj4jsProjection_=function(a,b){var c={units:a.units,axisOrientation:a.axis};goog.object.extend(c,b);ol.proj.Projection.call(this,c);this.proj4jsProj_=a;this.toEPSG4326_=null};goog.inherits(ol.Proj4jsProjection_,ol.proj.Projection);ol.Proj4jsProjection_.prototype.getMetersPerUnit=function(){var a=this.proj4jsProj_.to_meter;goog.isDef(a)||(a=ol.proj.METERS_PER_UNIT[this.units_]);return a};
|
|
ol.Proj4jsProjection_.prototype.getPointResolution=function(a,b){if(this.getUnits()==ol.proj.Units.DEGREES)return a;goog.isNull(this.toEPSG4326_)&&(this.toEPSG4326_=ol.proj.getTransformFromProjections(this,ol.proj.getProj4jsProjectionFromCode_({code:"EPSG:4326",extent:null})));var c=[b[0]-a/2,b[1],b[0]+a/2,b[1],b[0],b[1]-a/2,b[0],b[1]+a/2],c=this.toEPSG4326_(c,c,2),d=ol.sphere.NORMAL.haversineDistance(c.slice(0,2),c.slice(2,4)),c=ol.sphere.NORMAL.haversineDistance(c.slice(4,6),c.slice(6,8)),d=(d+
|
|
c)/2;this.getUnits()==ol.proj.Units.FEET&&(d/=0.3048);return d};ol.Proj4jsProjection_.prototype.getProj4jsProj=function(){return this.proj4jsProj_};ol.proj.proj4jsProjections_={};ol.proj.projections_={};ol.proj.transforms_={};ol.proj.addEquivalentProjections=function(a){ol.proj.addProjections(a);goog.array.forEach(a,function(b){goog.array.forEach(a,function(a){b!==a&&ol.proj.addTransform(b,a,ol.proj.cloneTransform)})})};
|
|
ol.proj.addEquivalentTransforms=function(a,b,c,d){goog.array.forEach(a,function(a){goog.array.forEach(b,function(b){ol.proj.addTransform(a,b,c);ol.proj.addTransform(b,a,d)})})};ol.proj.addProj4jsProjection_=function(a){var b=ol.proj.proj4jsProjections_,c=a.getCode();b[c]=a};ol.proj.addProjection=function(a){var b=ol.proj.projections_,c=a.getCode();b[c]=a;ol.proj.addTransform(a,a,ol.proj.cloneTransform)};ol.proj.addProjections=function(a){goog.array.forEach(a,function(a){ol.proj.addProjection(a)})};
|
|
ol.proj.clearAllProjections=function(){ol.ENABLE_PROJ4JS&&(ol.proj.proj4jsProjections_={});ol.proj.projections_={};ol.proj.transforms_={}};ol.proj.createProjection=function(a,b){return goog.isDefAndNotNull(a)?goog.isString(a)?ol.proj.get(a):a:ol.proj.get(b)};ol.proj.addTransform=function(a,b,c){a=a.getCode();b=b.getCode();var d=ol.proj.transforms_;goog.object.containsKey(d,a)||(d[a]={});d[a][b]=c};
|
|
ol.proj.removeTransform=function(a,b){var c=a.getCode(),d=b.getCode(),e=ol.proj.transforms_,f=e[c][d];delete e[c][d];0===goog.object.getKeys(e[c]).length&&delete e[c];return f};ol.proj.get=function(a){var b;a instanceof ol.proj.Projection?b=a:goog.isString(a)?(b=ol.proj.projections_[a],ol.HAVE_PROJ4JS&&!goog.isDef(b)&&(b=ol.proj.getProj4jsProjectionFromCode_({code:a,extent:null})),goog.isDef(b)||(b=null)):b=null;return b};
|
|
ol.proj.getProj4jsProjectionFromCode_=function(a){var b=a.code,c=ol.proj.proj4jsProjections_,d=c[b];if(!goog.isDef(d)){var e=new Proj4js.Proj(b),f=e.srsCode,d=c[f];goog.isDef(d)||(a=goog.object.clone(a),a.code=f,d=new ol.Proj4jsProjection_(e,a),c[f]=d);c[b]=d}return d};ol.proj.equivalent=function(a,b){return a===b?!0:a.getUnits()!=b.getUnits()?!1:ol.proj.getTransformFromProjections(a,b)===ol.proj.cloneTransform};
|
|
ol.proj.getTransform=function(a,b){var c=ol.proj.get(a),d=ol.proj.get(b);return ol.proj.getTransformFromProjections(c,d)};
|
|
ol.proj.getTransformFromProjections=function(a,b){var c=ol.proj.transforms_,d=a.getCode(),e=b.getCode(),f;goog.object.containsKey(c,d)&&goog.object.containsKey(c[d],e)&&(f=c[d][e]);if(ol.HAVE_PROJ4JS&&!goog.isDef(f)){var g=(a instanceof ol.Proj4jsProjection_?a:ol.proj.getProj4jsProjectionFromCode_({code:d,extent:null})).getProj4jsProj(),h=(b instanceof ol.Proj4jsProjection_?b:ol.proj.getProj4jsProjectionFromCode_({code:e,extent:null})).getProj4jsProj();f=function(a,b,c){var d=a.length;c=1<c?c:2;goog.isDef(b)||
|
|
(b=2<c?a.slice():Array(d));for(var e,f=0;f<d;f+=c)e=new Proj4js.Point(a[f],a[f+1]),e=Proj4js.transform(g,h,e),b[f]=e.x,b[f+1]=e.y;return b};ol.proj.addTransform(a,b,f)}goog.isDef(f)||(f=ol.proj.identityTransform);return f};ol.proj.identityTransform=function(a,b,c){if(goog.isDef(b)&&a!==b){c=0;for(var d=a.length;c<d;++c)b[c]=a[c];a=b}return a};ol.proj.cloneTransform=function(a,b,c){if(goog.isDef(b)){c=0;for(var d=a.length;c<d;++c)b[c]=a[c];a=b}else a=a.slice();return a};
|
|
ol.proj.transform=function(a,b,c){return ol.proj.getTransform(b,c)(a)};ol.proj.transformWithProjections=function(a,b,c){return ol.proj.getTransformFromProjections(b,c)(a)};ol.proj.configureProj4jsProjection=function(a){return ol.proj.getProj4jsProjectionFromCode_(a)};ol.source={};ol.source.State={LOADING:0,READY:1,ERROR:2};ol.source.Source=function(a){ol.Observable.call(this);this.projection_=ol.proj.get(a.projection);this.extent_=goog.isDef(a.extent)?a.extent:goog.isDef(a.projection)?this.projection_.getExtent():null;this.attributions_=goog.isDef(a.attributions)?a.attributions:null;this.logo_=a.logo;this.state_=goog.isDef(a.state)?a.state:ol.source.State.READY};goog.inherits(ol.source.Source,ol.Observable);ol.source.Source.prototype.forEachFeatureAtPixel=goog.nullFunction;
|
|
ol.source.Source.prototype.getAttributions=function(){return this.attributions_};ol.source.Source.prototype.getExtent=function(){return this.extent_};ol.source.Source.prototype.getLogo=function(){return this.logo_};ol.source.Source.prototype.getProjection=function(){return this.projection_};ol.source.Source.prototype.getState=function(){return this.state_};ol.source.Source.prototype.setAttributions=function(a){this.attributions_=a};ol.source.Source.prototype.setExtent=function(a){this.extent_=a};
|
|
ol.source.Source.prototype.setLogo=function(a){this.logo_=a};ol.source.Source.prototype.setState=function(a){this.state_=a;this.dispatchChangeEvent()};ol.source.Source.prototype.setProjection=function(a){this.projection_=a};ol.layer={};ol.layer.LayerProperty={BRIGHTNESS:"brightness",CONTRAST:"contrast",HUE:"hue",OPACITY:"opacity",SATURATION:"saturation",VISIBLE:"visible",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution"};
|
|
ol.layer.Base=function(a){ol.Object.call(this);a=goog.object.clone(a);a.brightness=goog.isDef(a.brightness)?a.brightness:0;a.contrast=goog.isDef(a.contrast)?a.contrast:1;a.hue=goog.isDef(a.hue)?a.hue:0;a.opacity=goog.isDef(a.opacity)?a.opacity:1;a.saturation=goog.isDef(a.saturation)?a.saturation:1;a.visible=goog.isDef(a.visible)?a.visible:!0;a.maxResolution=goog.isDef(a.maxResolution)?a.maxResolution:Infinity;a.minResolution=goog.isDef(a.minResolution)?a.minResolution:0;this.setValues(a)};
|
|
goog.inherits(ol.layer.Base,ol.Object);ol.layer.Base.prototype.getBrightness=function(){return this.get(ol.layer.LayerProperty.BRIGHTNESS)};goog.exportProperty(ol.layer.Base.prototype,"getBrightness",ol.layer.Base.prototype.getBrightness);ol.layer.Base.prototype.getContrast=function(){return this.get(ol.layer.LayerProperty.CONTRAST)};goog.exportProperty(ol.layer.Base.prototype,"getContrast",ol.layer.Base.prototype.getContrast);ol.layer.Base.prototype.getHue=function(){return this.get(ol.layer.LayerProperty.HUE)};
|
|
goog.exportProperty(ol.layer.Base.prototype,"getHue",ol.layer.Base.prototype.getHue);
|
|
ol.layer.Base.prototype.getLayerState=function(){var a=this.getBrightness(),b=this.getContrast(),c=this.getHue(),d=this.getOpacity(),e=this.getSaturation(),f=this.getSourceState(),g=this.getVisible(),h=this.getMaxResolution(),k=this.getMinResolution();return{brightness:goog.isDef(a)?goog.math.clamp(a,-1,1):0,contrast:goog.isDef(b)?Math.max(b,0):1,hue:goog.isDef(c)?c:0,opacity:goog.isDef(d)?goog.math.clamp(d,0,1):1,saturation:goog.isDef(e)?Math.max(e,0):1,sourceState:f,visible:goog.isDef(g)?!!g:!0,
|
|
maxResolution:goog.isDef(h)?h:Infinity,minResolution:goog.isDef(k)?Math.max(k,0):0}};ol.layer.Base.prototype.getMaxResolution=function(){return this.get(ol.layer.LayerProperty.MAX_RESOLUTION)};goog.exportProperty(ol.layer.Base.prototype,"getMaxResolution",ol.layer.Base.prototype.getMaxResolution);ol.layer.Base.prototype.getMinResolution=function(){return this.get(ol.layer.LayerProperty.MIN_RESOLUTION)};goog.exportProperty(ol.layer.Base.prototype,"getMinResolution",ol.layer.Base.prototype.getMinResolution);
|
|
ol.layer.Base.prototype.getOpacity=function(){return this.get(ol.layer.LayerProperty.OPACITY)};goog.exportProperty(ol.layer.Base.prototype,"getOpacity",ol.layer.Base.prototype.getOpacity);ol.layer.Base.prototype.getSaturation=function(){return this.get(ol.layer.LayerProperty.SATURATION)};goog.exportProperty(ol.layer.Base.prototype,"getSaturation",ol.layer.Base.prototype.getSaturation);ol.layer.Base.prototype.getVisible=function(){return this.get(ol.layer.LayerProperty.VISIBLE)};
|
|
goog.exportProperty(ol.layer.Base.prototype,"getVisible",ol.layer.Base.prototype.getVisible);ol.layer.Base.prototype.setBrightness=function(a){this.set(ol.layer.LayerProperty.BRIGHTNESS,a)};goog.exportProperty(ol.layer.Base.prototype,"setBrightness",ol.layer.Base.prototype.setBrightness);ol.layer.Base.prototype.setContrast=function(a){this.set(ol.layer.LayerProperty.CONTRAST,a)};goog.exportProperty(ol.layer.Base.prototype,"setContrast",ol.layer.Base.prototype.setContrast);
|
|
ol.layer.Base.prototype.setHue=function(a){this.set(ol.layer.LayerProperty.HUE,a)};goog.exportProperty(ol.layer.Base.prototype,"setHue",ol.layer.Base.prototype.setHue);ol.layer.Base.prototype.setMaxResolution=function(a){this.set(ol.layer.LayerProperty.MAX_RESOLUTION,a)};goog.exportProperty(ol.layer.Base.prototype,"setMaxResolution",ol.layer.Base.prototype.setMaxResolution);ol.layer.Base.prototype.setMinResolution=function(a){this.set(ol.layer.LayerProperty.MIN_RESOLUTION,a)};
|
|
goog.exportProperty(ol.layer.Base.prototype,"setMinResolution",ol.layer.Base.prototype.setMinResolution);ol.layer.Base.prototype.setOpacity=function(a){this.set(ol.layer.LayerProperty.OPACITY,a)};goog.exportProperty(ol.layer.Base.prototype,"setOpacity",ol.layer.Base.prototype.setOpacity);ol.layer.Base.prototype.setSaturation=function(a){this.set(ol.layer.LayerProperty.SATURATION,a)};goog.exportProperty(ol.layer.Base.prototype,"setSaturation",ol.layer.Base.prototype.setSaturation);
|
|
ol.layer.Base.prototype.setVisible=function(a){this.set(ol.layer.LayerProperty.VISIBLE,a)};goog.exportProperty(ol.layer.Base.prototype,"setVisible",ol.layer.Base.prototype.setVisible);ol.layer.Layer=function(a){var b=goog.object.clone(a);delete b.source;ol.layer.Base.call(this,b);this.source_=a.source;goog.events.listen(this.source_,goog.events.EventType.CHANGE,this.handleSourceChange_,!1,this)};goog.inherits(ol.layer.Layer,ol.layer.Base);ol.layer.Layer.prototype.getLayersArray=function(a){a=goog.isDef(a)?a:[];a.push(this);return a};
|
|
ol.layer.Layer.prototype.getLayerStatesArray=function(a){a=goog.isDef(a)?a:{layers:[],layerStates:[]};a.layers.push(this);a.layerStates.push(this.getLayerState());return a};ol.layer.Layer.prototype.getSource=function(){return this.source_};ol.layer.Layer.prototype.getSourceState=function(){return this.getSource().getState()};ol.layer.Layer.prototype.handleSourceChange_=function(){this.dispatchChangeEvent()};ol.MapEventType={POSTRENDER:"postrender",MOVEEND:"moveend"};ol.MapEvent=function(a,b,c){goog.events.Event.call(this,a);this.map=b;this.frameState=goog.isDef(c)?c:null};goog.inherits(ol.MapEvent,goog.events.Event);ol.MapBrowserEvent=function(a,b,c,d){ol.MapEvent.call(this,a,b,d);this.browserEvent=c;this.originalEvent=c.getBrowserEvent();this.coordinate=b.getEventCoordinate(this.originalEvent);this.pixel=b.getEventPixel(this.originalEvent)};goog.inherits(ol.MapBrowserEvent,ol.MapEvent);ol.MapBrowserEvent.prototype.preventDefault=function(){ol.MapBrowserEvent.superClass_.preventDefault.call(this);this.browserEvent.preventDefault()};
|
|
ol.MapBrowserEvent.prototype.stopPropagation=function(){ol.MapBrowserEvent.superClass_.stopPropagation.call(this);this.browserEvent.stopPropagation()};
|
|
ol.MapBrowserEventHandler=function(a){goog.events.EventTarget.call(this);this.map_=a;this.clickTimeoutId_=0;this.dragged_=!1;this.touchstartListenerKey_=this.pointerdownListenerKey_=this.mousedownListenerKey_=this.dragListenerKeys_=null;ol.LEGACY_IE_SUPPORT&&ol.IS_LEGACY_IE&&(this.ieDblclickListenerKey_=null);this.down_=null;a=this.map_.getViewport();this.relayedListenerKeys_=[goog.events.listen(a,goog.events.EventType.MOUSEMOVE,this.relayEvent_,!1,this),goog.events.listen(a,goog.events.EventType.CLICK,
|
|
this.relayEvent_,!1,this)];this.mousedownListenerKey_=goog.events.listen(a,goog.events.EventType.MOUSEDOWN,this.handleMouseDown_,!1,this);this.pointerdownListenerKey_=goog.events.listen(a,goog.events.EventType.MSPOINTERDOWN,this.handlePointerDown_,!1,this);this.touchstartListenerKey_=goog.events.listen(a,goog.events.EventType.TOUCHSTART,this.handleTouchStart_,!1,this);ol.LEGACY_IE_SUPPORT&&ol.IS_LEGACY_IE&&(this.ieDblclickListenerKey_=goog.events.listen(a,goog.events.EventType.DBLCLICK,this.emulateClick_,
|
|
!1,this))};goog.inherits(ol.MapBrowserEventHandler,goog.events.EventTarget);ol.MapBrowserEventHandler.prototype.getDown=function(){return this.down_};
|
|
ol.MapBrowserEventHandler.prototype.emulateClick_=function(a){if(0!==this.clickTimeoutId_){goog.global.clearTimeout(this.clickTimeoutId_);this.clickTimeoutId_=0;var b=new ol.MapBrowserEvent(ol.MapBrowserEvent.EventType.DBLCLICK,this.map_,a);this.dispatchEvent(b)}else if(ol.LEGACY_IE_SUPPORT&&ol.IS_LEGACY_IE){var c=goog.object.clone(a.getBrowserEvent());this.clickTimeoutId_=goog.global.setTimeout(goog.bind(function(){this.clickTimeoutId_=0;var b=new ol.MapBrowserEvent(ol.MapBrowserEvent.EventType.SINGLECLICK,
|
|
this.map_,new goog.events.BrowserEvent(c,a.currentTarget));this.dispatchEvent(b)},this),250)}else this.clickTimeoutId_=goog.global.setTimeout(goog.bind(function(){this.clickTimeoutId_=0;var b=new ol.MapBrowserEvent(ol.MapBrowserEvent.EventType.SINGLECLICK,this.map_,a);this.dispatchEvent(b)},this),250)};
|
|
ol.MapBrowserEventHandler.prototype.handleMouseUp_=function(a){this.down_&&(goog.array.forEach(this.dragListenerKeys_,goog.events.unlistenByKey),this.dragListenerKeys_=null,this.dragged_?(a=new ol.MapBrowserEvent(ol.MapBrowserEvent.EventType.DRAGEND,this.map_,a),this.dispatchEvent(a)):a.isMouseActionButton()&&this.emulateClick_(a))};
|
|
ol.MapBrowserEventHandler.prototype.handleMouseDown_=function(a){goog.isNull(this.pointerdownListenerKey_)||(goog.events.unlistenByKey(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null,goog.events.unlistenByKey(this.touchstartListenerKey_),this.touchstartListenerKey_=null);var b=new ol.MapBrowserEvent(ol.MapBrowserEvent.EventType.DOWN,this.map_,a);this.dispatchEvent(b);this.down_=a;this.dragged_=!1;this.dragListenerKeys_=[goog.events.listen(goog.global.document,goog.events.EventType.MOUSEMOVE,
|
|
this.handleMouseMove_,!1,this),goog.events.listen(goog.global.document,goog.events.EventType.MOUSEUP,this.handleMouseUp_,!1,this)];a.preventDefault()};ol.MapBrowserEventHandler.prototype.handleMouseMove_=function(a){var b;this.dragged_||(this.dragged_=!0,b=new ol.MapBrowserEvent(ol.MapBrowserEvent.EventType.DRAGSTART,this.map_,this.down_),this.dispatchEvent(b));b=new ol.MapBrowserEvent(ol.MapBrowserEvent.EventType.DRAG,this.map_,a);this.dispatchEvent(b)};
|
|
ol.MapBrowserEventHandler.prototype.handlePointerDown_=function(a){goog.isNull(this.mousedownListenerKey_)||(goog.events.unlistenByKey(this.mousedownListenerKey_),this.mousedownListenerKey_=null,goog.events.unlistenByKey(this.touchstartListenerKey_),this.touchstartListenerKey_=null);var b=new ol.MapBrowserEvent(ol.MapBrowserEvent.EventType.TOUCHSTART,this.map_,a);this.dispatchEvent(b);this.down_=a;this.dragged_=!1;this.dragListenerKeys_=[goog.events.listen(goog.global.document,goog.events.EventType.MSPOINTERMOVE,
|
|
this.handlePointerMove_,!1,this),goog.events.listen(goog.global.document,goog.events.EventType.MSPOINTERUP,this.handlePointerUp_,!1,this)];a.preventDefault()};ol.MapBrowserEventHandler.prototype.handlePointerMove_=function(a){if(a.clientX!=this.down_.clientX||a.clientY!=this.down_.clientY)this.dragged_=!0,a=new ol.MapBrowserEvent(ol.MapBrowserEvent.EventType.TOUCHMOVE,this.map_,a),this.dispatchEvent(a)};
|
|
ol.MapBrowserEventHandler.prototype.handlePointerUp_=function(a){var b=new ol.MapBrowserEvent(ol.MapBrowserEvent.EventType.TOUCHEND,this.map_,a);this.dispatchEvent(b);goog.array.forEach(this.dragListenerKeys_,goog.events.unlistenByKey);!this.dragged_&&a.isMouseActionButton()&&this.emulateClick_(this.down_)};
|
|
ol.MapBrowserEventHandler.prototype.handleTouchStart_=function(a){goog.isNull(this.mousedownListenerKey_)||(goog.events.unlistenByKey(this.mousedownListenerKey_),this.mousedownListenerKey_=null,goog.events.unlistenByKey(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null);var b=new ol.MapBrowserEvent(ol.MapBrowserEvent.EventType.TOUCHSTART,this.map_,a);this.dispatchEvent(b);this.down_=a;this.dragged_=!1;goog.isNull(this.dragListenerKeys_)&&(this.dragListenerKeys_=[goog.events.listen(goog.global.document,
|
|
goog.events.EventType.TOUCHMOVE,this.handleTouchMove_,!1,this),goog.events.listen(goog.global.document,goog.events.EventType.TOUCHEND,this.handleTouchEnd_,!1,this)]);a.preventDefault()};ol.MapBrowserEventHandler.prototype.handleTouchMove_=function(a){this.dragged_=!0;var b=new ol.MapBrowserEvent(ol.MapBrowserEvent.EventType.TOUCHMOVE,this.map_,a);this.dispatchEvent(b);a.preventDefault()};
|
|
ol.MapBrowserEventHandler.prototype.handleTouchEnd_=function(a){var b=new ol.MapBrowserEvent(ol.MapBrowserEvent.EventType.TOUCHEND,this.map_,a);this.dispatchEvent(b);0===a.getBrowserEvent().targetTouches.length&&(goog.array.forEach(this.dragListenerKeys_,goog.events.unlistenByKey),this.dragListenerKeys_=null);this.dragged_||this.emulateClick_(this.down_)};
|
|
ol.MapBrowserEventHandler.prototype.disposeInternal=function(){goog.isNull(this.relayedListenerKeys_)||(goog.array.forEach(this.relayedListenerKeys_,goog.events.unlistenByKey),this.relayedListenerKeys_=null);goog.isNull(this.mousedownListenerKey_)||(goog.events.unlistenByKey(this.mousedownListenerKey_),this.mousedownListenerKey_=null);goog.isNull(this.pointerdownListenerKey_)||(goog.events.unlistenByKey(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null);goog.isNull(this.touchstartListenerKey_)||
|
|
(goog.events.unlistenByKey(this.touchstartListenerKey_),this.touchstartListenerKey_=null);goog.isNull(this.dragListenerKeys_)||(goog.array.forEach(this.dragListenerKeys_,goog.events.unlistenByKey),this.dragListenerKeys_=null);ol.LEGACY_IE_SUPPORT&&(ol.IS_LEGACY_IE&&!goog.isNull(this.ieDblclickListenerKey_))&&(goog.events.unlistenByKey(this.ieDblclickListenerKey_),this.ieDblclickListenerKey_=null);ol.MapBrowserEventHandler.superClass_.disposeInternal.call(this)};
|
|
ol.MapBrowserEventHandler.prototype.relayEvent_=function(a){this.dispatchEvent(new ol.MapBrowserEvent(a.type,this.map_,a))};ol.MapBrowserEvent.EventType={CLICK:goog.events.EventType.CLICK,DBLCLICK:goog.events.EventType.DBLCLICK,MOUSEMOVE:goog.events.EventType.MOUSEMOVE,DOWN:"down",DRAGSTART:"dragstart",DRAG:"drag",DRAGEND:"dragend",SINGLECLICK:"singleclick",TOUCHSTART:goog.events.EventType.TOUCHSTART,TOUCHMOVE:goog.events.EventType.TOUCHMOVE,TOUCHEND:goog.events.EventType.TOUCHEND};ol.events={};ol.events.condition={};ol.events.condition.altKeyOnly=function(a){a=a.browserEvent;return a.altKey&&!a.platformModifierKey&&!a.shiftKey};ol.events.condition.altShiftKeysOnly=function(a){a=a.browserEvent;return a.altKey&&!a.platformModifierKey&&a.shiftKey};ol.events.condition.always=goog.functions.TRUE;ol.events.condition.singleClick=function(a){return a.type==ol.MapBrowserEvent.EventType.SINGLECLICK};
|
|
ol.events.condition.noModifierKeys=function(a){a=a.browserEvent;return!a.altKey&&!a.platformModifierKey&&!a.shiftKey};ol.events.condition.platformModifierKeyOnly=function(a){a=a.browserEvent;return!a.altKey&&a.platformModifierKey&&!a.shiftKey};ol.events.condition.shiftKeyOnly=function(a){a=a.browserEvent;return!a.altKey&&!a.platformModifierKey&&a.shiftKey};
|
|
ol.events.condition.targetNotEditable=function(a){a=a.browserEvent.target.tagName;return a!==goog.dom.TagName.INPUT&&a!==goog.dom.TagName.SELECT&&a!==goog.dom.TagName.TEXTAREA};ol.IView3D=function(){};ol.IView3D.prototype.isDef=function(){};ol.IView=function(){};ol.IView.prototype.getView2D=function(){};ol.IView.prototype.getView3D=function(){};ol.IView.prototype.isDef=function(){};ol.ViewHint={ANIMATING:0,INTERACTING:1};ol.View=function(){ol.Object.call(this);this.hints_=[0,0]};goog.inherits(ol.View,ol.Object);ol.View.prototype.getHints=function(){return goog.array.clone(this.hints_)};ol.View.prototype.getView2D=function(){return null};ol.View.prototype.getView3D=function(){return null};ol.View.prototype.isDef=function(){return!1};ol.View.prototype.setHint=function(a,b){this.hints_[a]+=b;return this.hints_[a]};ol.View2DProperty={CENTER:"center",PROJECTION:"projection",RESOLUTION:"resolution",ROTATION:"rotation"};
|
|
ol.View2D=function(a){ol.View.call(this);a=a||{};var b={};b[ol.View2DProperty.CENTER]=goog.isDef(a.center)?a.center:null;b[ol.View2DProperty.PROJECTION]=ol.proj.createProjection(a.projection,"EPSG:3857");var c=ol.View2D.createResolutionConstraint_(a);this.maxResolution_=c.maxResolution;this.minResolution_=c.minResolution;var d=ol.View2D.createCenterConstraint_(a),c=c.constraint,e=ol.View2D.createRotationConstraint_(a);this.constraints_=new ol.Constraints(d,c,e);goog.isDef(a.resolution)?b[ol.View2DProperty.RESOLUTION]=
|
|
a.resolution:goog.isDef(a.zoom)&&(b[ol.View2DProperty.RESOLUTION]=this.constrainResolution(this.maxResolution_,a.zoom));b[ol.View2DProperty.ROTATION]=goog.isDef(a.rotation)?a.rotation:0;this.setValues(b)};goog.inherits(ol.View2D,ol.View);ol.View2D.prototype.calculateCenterRotate=function(a,b){var c,d=this.getCenter();goog.isDef(d)&&(c=[d[0]-b[0],d[1]-b[1]],ol.coordinate.rotate(c,a-this.getRotation()),ol.coordinate.add(c,b));return c};
|
|
ol.View2D.prototype.calculateCenterZoom=function(a,b){var c,d=this.getCenter(),e=this.getResolution();goog.isDef(d)&&goog.isDef(e)&&(c=[b[0]-a*(b[0]-d[0])/e,b[1]-a*(b[1]-d[1])/e]);return c};ol.View2D.prototype.constrainCenter=function(a){return this.constraints_.center(a)};ol.View2D.prototype.constrainResolution=function(a,b,c){return this.constraints_.resolution(a,b||0,c||0)};ol.View2D.prototype.constrainRotation=function(a,b){return this.constraints_.rotation(a,b||0)};
|
|
ol.View2D.prototype.getCenter=function(){return this.get(ol.View2DProperty.CENTER)};goog.exportProperty(ol.View2D.prototype,"getCenter",ol.View2D.prototype.getCenter);ol.View2D.prototype.calculateExtent=function(a){var b=this.getCenter(),c=this.getResolution();return[b[0]-c*a[0]/2,b[1]-c*a[1]/2,b[0]+c*a[0]/2,b[1]+c*a[1]/2]};ol.View2D.prototype.getProjection=function(){return this.get(ol.View2DProperty.PROJECTION)};goog.exportProperty(ol.View2D.prototype,"getProjection",ol.View2D.prototype.getProjection);
|
|
ol.View2D.prototype.getResolution=function(){return this.get(ol.View2DProperty.RESOLUTION)};goog.exportProperty(ol.View2D.prototype,"getResolution",ol.View2D.prototype.getResolution);ol.View2D.prototype.getResolutionForExtent=function(a,b){return Math.max((a[2]-a[0])/b[0],(a[3]-a[1])/b[1])};ol.View2D.prototype.getResolutionForValueFunction=function(a){var b=a||2,c=this.maxResolution_,d=Math.log(c/this.minResolution_)/Math.log(b);return function(a){return c/Math.pow(b,a*d)}};
|
|
ol.View2D.prototype.getRotation=function(){return this.get(ol.View2DProperty.ROTATION)};goog.exportProperty(ol.View2D.prototype,"getRotation",ol.View2D.prototype.getRotation);ol.View2D.prototype.getValueForResolutionFunction=function(a){var b=a||2,c=this.maxResolution_,d=Math.log(c/this.minResolution_)/Math.log(b);return function(a){return Math.log(c/a)/Math.log(b)/d}};ol.View2D.prototype.getView2D=function(){return this};
|
|
ol.View2D.prototype.getView2DState=function(){var a=this.getCenter(),b=this.getProjection(),c=this.getResolution(),d=this.getRotation();return{center:a.slice(),projection:goog.isDef(b)?b:null,resolution:c,rotation:goog.isDef(d)?d:0}};ol.View2D.prototype.getView3D=function(){};ol.View2D.prototype.getZoom=function(){var a,b=this.getResolution();if(goog.isDef(b)){var c,d=0;do{c=this.constrainResolution(this.maxResolution_,d);if(c==b){a=d;break}++d}while(c>this.minResolution_)}return a};
|
|
ol.View2D.prototype.fitExtent=function(a,b){if(!ol.extent.isEmpty(a)){this.setCenter(ol.extent.getCenter(a));var c=this.getResolutionForExtent(a,b),d=this.constrainResolution(c,0,0);d<c&&(d=this.constrainResolution(d,-1,0));this.setResolution(d)}};ol.View2D.prototype.isDef=function(){return goog.isDefAndNotNull(this.getCenter())&&goog.isDef(this.getResolution())};ol.View2D.prototype.setCenter=function(a){this.set(ol.View2DProperty.CENTER,a)};goog.exportProperty(ol.View2D.prototype,"setCenter",ol.View2D.prototype.setCenter);
|
|
ol.View2D.prototype.setProjection=function(a){this.set(ol.View2DProperty.PROJECTION,a)};goog.exportProperty(ol.View2D.prototype,"setProjection",ol.View2D.prototype.setProjection);ol.View2D.prototype.setResolution=function(a){this.set(ol.View2DProperty.RESOLUTION,a)};goog.exportProperty(ol.View2D.prototype,"setResolution",ol.View2D.prototype.setResolution);ol.View2D.prototype.setRotation=function(a){this.set(ol.View2DProperty.ROTATION,a)};goog.exportProperty(ol.View2D.prototype,"setRotation",ol.View2D.prototype.setRotation);
|
|
ol.View2D.prototype.setZoom=function(a){a=this.constrainResolution(this.maxResolution_,a,0);this.setResolution(a)};ol.View2D.createCenterConstraint_=function(a){return goog.isDef(a.extent)?ol.CenterConstraint.createExtent(a.extent):ol.CenterConstraint.none};
|
|
ol.View2D.createResolutionConstraint_=function(a){var b,c;if(goog.isDef(a.resolutions))b=a.resolutions,c=b[0],a=b[b.length-1],b=ol.ResolutionConstraint.createSnapToResolutions(b);else{c=a.maxResolution;goog.isDef(c)||(c=a.projection,b=ol.proj.createProjection(c,"EPSG:3857").getExtent(),c=(goog.isNull(b)?360*ol.proj.METERS_PER_UNIT[ol.proj.Units.DEGREES]/ol.proj.METERS_PER_UNIT[c.getUnits()]:Math.max(b[2]-b[0],b[3]-b[1]))/ol.DEFAULT_TILE_SIZE);b=a.maxZoom;goog.isDef(b)||(b=28);var d=a.zoomFactor;goog.isDef(d)||
|
|
(d=2);a=c/Math.pow(d,b);b=ol.ResolutionConstraint.createSnapToPower(d,c,b)}return{constraint:b,maxResolution:c,minResolution:a}};ol.View2D.createRotationConstraint_=function(a){return(goog.isDef(a.enableRotation)?a.enableRotation:1)?(a=a.constrainRotation,goog.isDef(a)&&!0!==a?!1===a?ol.RotationConstraint.none:goog.isNumber(a)?ol.RotationConstraint.createSnapToN(a):ol.RotationConstraint.none:ol.RotationConstraint.createSnapToZero()):ol.RotationConstraint.disable};goog.fx={};goog.fx.easing={};goog.fx.easing.easeIn=function(a){return a*a*a};goog.fx.easing.easeOut=function(a){return 1-Math.pow(1-a,3)};goog.fx.easing.inAndOut=function(a){return 3*a*a-2*a*a*a};ol.easing={};ol.easing.bounce=function(a){a<1/2.75?a*=7.5625*a:a<2/2.75?(a-=1.5/2.75,a=7.5625*a*a+0.75):a<2.5/2.75?(a-=2.25/2.75,a=7.5625*a*a+0.9375):(a-=2.625/2.75,a=7.5625*a*a+0.984375);return a};ol.easing.easeIn=goog.fx.easing.easeIn;ol.easing.easeOut=goog.fx.easing.easeOut;ol.easing.elastic=function(a){return Math.pow(2,-10*a)*Math.sin((a-0.075)*2*Math.PI/0.3)+1};ol.easing.inAndOut=goog.fx.easing.inAndOut;ol.easing.linear=function(a){return a};
|
|
ol.easing.upAndDown=function(a){return 0.5>a?ol.easing.inAndOut(2*a):1-ol.easing.inAndOut(2*(a-0.5))};ol.animation={};ol.animation.bounce=function(a){var b=a.resolution,c=goog.isDef(a.start)?a.start:goog.now(),d=goog.isDef(a.duration)?a.duration:1E3,e=goog.isDef(a.easing)?a.easing:ol.easing.upAndDown;return function(a,g){if(g.time<c)return g.animate=!0,g.viewHints[ol.ViewHint.ANIMATING]+=1,!0;if(g.time<c+d){var h=e((g.time-c)/d),k=b-g.view2DState.resolution;g.animate=!0;g.view2DState.resolution+=h*k;g.viewHints[ol.ViewHint.ANIMATING]+=1;return!0}return!1}};
|
|
ol.animation.pan=function(a){var b=a.source,c=goog.isDef(a.start)?a.start:goog.now(),d=b[0],e=b[1],f=goog.isDef(a.duration)?a.duration:1E3,g=goog.isDef(a.easing)?a.easing:ol.easing.inAndOut;return function(a,b){if(b.time<c)return b.animate=!0,b.viewHints[ol.ViewHint.ANIMATING]+=1,!0;if(b.time<c+f){var l=1-g((b.time-c)/f),m=d-b.view2DState.center[0],n=e-b.view2DState.center[1];b.animate=!0;b.view2DState.center[0]+=l*m;b.view2DState.center[1]+=l*n;b.viewHints[ol.ViewHint.ANIMATING]+=1;return!0}return!1}};
|
|
ol.animation.rotate=function(a){var b=a.rotation,c=goog.isDef(a.start)?a.start:goog.now(),d=goog.isDef(a.duration)?a.duration:1E3,e=goog.isDef(a.easing)?a.easing:ol.easing.inAndOut;return function(a,g){if(g.time<c)return g.animate=!0,g.viewHints[ol.ViewHint.ANIMATING]+=1,!0;if(g.time<c+d){var h=1-e((g.time-c)/d),k=b-g.view2DState.rotation;g.animate=!0;g.view2DState.rotation+=h*k;g.viewHints[ol.ViewHint.ANIMATING]+=1;return!0}return!1}};
|
|
ol.animation.zoom=function(a){var b=a.resolution,c=goog.isDef(a.start)?a.start:goog.now(),d=goog.isDef(a.duration)?a.duration:1E3,e=goog.isDef(a.easing)?a.easing:ol.easing.inAndOut;return function(a,g){if(g.time<c)return g.animate=!0,g.viewHints[ol.ViewHint.ANIMATING]+=1,!0;if(g.time<c+d){var h=1-e((g.time-c)/d),k=b-g.view2DState.resolution;g.animate=!0;g.view2DState.resolution+=h*k;g.viewHints[ol.ViewHint.ANIMATING]+=1;return!0}return!1}};ol.interaction={};ol.interaction.Interaction=function(){ol.Observable.call(this);this.map_=null};goog.inherits(ol.interaction.Interaction,ol.Observable);ol.interaction.Interaction.prototype.getMap=function(){return this.map_};ol.interaction.Interaction.prototype.setMap=function(a){this.map_=a};
|
|
ol.interaction.Interaction.pan=function(a,b,c,d){var e=b.getCenter();goog.isDef(e)&&(goog.isDef(d)&&0<d&&a.beforeRender(ol.animation.pan({source:e,duration:d,easing:ol.easing.linear})),a=b.constrainCenter([e[0]+c[0],e[1]+c[1]]),b.setCenter(a))};ol.interaction.Interaction.rotate=function(a,b,c,d,e){c=b.constrainRotation(c,0);ol.interaction.Interaction.rotateWithoutConstraints(a,b,c,d,e)};
|
|
ol.interaction.Interaction.rotateWithoutConstraints=function(a,b,c,d,e){if(goog.isDefAndNotNull(c)){var f=b.getRotation(),g=b.getCenter();goog.isDef(f)&&(goog.isDef(g)&&goog.isDef(e)&&0<e)&&(a.beforeRender(ol.animation.rotate({rotation:f,duration:e,easing:ol.easing.easeOut})),goog.isDef(d)&&a.beforeRender(ol.animation.pan({source:g,duration:e,easing:ol.easing.easeOut})));goog.isDefAndNotNull(d)&&(a=b.calculateCenterRotate(c,d),b.setCenter(a));b.setRotation(c)}};
|
|
ol.interaction.Interaction.zoom=function(a,b,c,d,e,f){c=b.constrainResolution(c,0,f);ol.interaction.Interaction.zoomWithoutConstraints(a,b,c,d,e)};ol.interaction.Interaction.zoomByDelta=function(a,b,c,d,e){var f=b.getResolution();c=b.constrainResolution(f,c,0);ol.interaction.Interaction.zoomWithoutConstraints(a,b,c,d,e)};
|
|
ol.interaction.Interaction.zoomWithoutConstraints=function(a,b,c,d,e){if(goog.isDefAndNotNull(c)){var f=b.getResolution(),g=b.getCenter();goog.isDef(f)&&(goog.isDef(g)&&goog.isDef(e)&&0<e)&&(a.beforeRender(ol.animation.zoom({resolution:f,duration:e,easing:ol.easing.easeOut})),goog.isDef(d)&&a.beforeRender(ol.animation.pan({source:g,duration:e,easing:ol.easing.easeOut})));goog.isDefAndNotNull(d)&&(a=b.calculateCenterZoom(c,d),b.setCenter(a));b.setResolution(c)}};ol.interaction.Drag=function(){ol.interaction.Interaction.call(this);this.dragging_=!1;this.deltaY=this.deltaX=this.startY=this.startX=0;this.startCoordinate=this.startCenter=null};goog.inherits(ol.interaction.Drag,ol.interaction.Interaction);ol.interaction.Drag.prototype.getDragging=function(){return this.dragging_};ol.interaction.Drag.prototype.handleDrag=goog.nullFunction;ol.interaction.Drag.prototype.handleDragEnd=goog.nullFunction;ol.interaction.Drag.prototype.handleDragStart=goog.functions.FALSE;
|
|
ol.interaction.Drag.prototype.handleDown=goog.nullFunction;
|
|
ol.interaction.Drag.prototype.handleMapBrowserEvent=function(a){var b=a.map;if(!b.isDef())return!0;var c=!1,d=b.getView(),b=a.browserEvent;a.type==ol.MapBrowserEvent.EventType.DOWN&&this.handleDown(a);this.dragging_?a.type==ol.MapBrowserEvent.EventType.DRAG?(this.deltaX=b.clientX-this.startX,this.deltaY=b.clientY-this.startY,this.handleDrag(a)):a.type==ol.MapBrowserEvent.EventType.DRAGEND&&(this.deltaX=b.clientX-this.startX,this.deltaY=b.clientY-this.startY,this.dragging_=!1,this.handleDragEnd(a)):
|
|
a.type==ol.MapBrowserEvent.EventType.DRAGSTART&&(d=d.getView2D().getView2DState(),this.startX=b.clientX,this.startY=b.clientY,this.deltaY=this.deltaX=0,this.startCenter=d.center,this.startCoordinate=a.coordinate,this.handleDragStart(a)&&(this.dragging_=!0,a.preventDefault(),c=!0));return!c};ol.geom={};ol.geom.GeometryType={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};ol.geom.GeometryLayout={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};
|
|
ol.geom.Geometry=function(){ol.Observable.call(this);this.extent=void 0;this.extentRevision=-1;this.simplifiedGeometryCache={};this.simplifiedGeometryRevision=this.simplifiedGeometryMaxMinSquaredTolerance=0};goog.inherits(ol.geom.Geometry,ol.Observable);ol.geom.Geometry.prototype.getClosestPoint=function(a,b){var c=goog.isDef(b)?b:[NaN,NaN];this.closestPointXY(a[0],a[1],c,Infinity);return c};ol.geom.Geometry.prototype.containsCoordinate=function(a){return this.containsXY(a[0],a[1])};
|
|
ol.geom.Geometry.prototype.containsXY=goog.functions.FALSE;ol.geom.flat={};ol.geom.flat.closestPoint=function(a,b,c,d,e,f,g){var h=a[b],k=a[b+1],l=a[c]-h,m=a[c+1]-k;if(0!==l||0!==m)if(f=((e-h)*l+(f-k)*m)/(l*l+m*m),1<f)b=c;else if(0<f){for(e=0;e<d;++e)g[e]=goog.math.lerp(a[b+e],a[c+e],f);g.length=d;return}for(e=0;e<d;++e)g[e]=a[b+e];g.length=d};ol.geom.flat.deflateCoordinate=function(a,b,c,d){var e;d=0;for(e=c.length;d<e;++d)a[b++]=c[d];return b};
|
|
ol.geom.flat.deflateCoordinates=function(a,b,c,d){var e,f;e=0;for(f=c.length;e<f;++e){var g=c[e],h;for(h=0;h<d;++h)a[b++]=g[h]}return b};ol.geom.flat.deflateCoordinatess=function(a,b,c,d,e){e=goog.isDef(e)?e:[];var f=0,g,h;g=0;for(h=c.length;g<h;++g)b=ol.geom.flat.deflateCoordinates(a,b,c[g],d),e[f++]=b;e.length=f;return e};
|
|
ol.geom.flat.deflateCoordinatesss=function(a,b,c,d,e){e=goog.isDef(e)?e:[];var f=0,g,h;g=0;for(h=c.length;g<h;++g)b=ol.geom.flat.deflateCoordinatess(a,b,c[g],d,e[f]),e[f++]=b,b=b[b.length-1];e.length=f;return e};ol.geom.flat.flipXY=function(a,b,c,d,e,f){goog.isDef(e)?f=goog.isDef(f)?f:0:(e=[],f=0);for(var g;b<c;)for(g=a[b++],e[f++]=a[b++],e[f++]=g,g=2;g<d;++g)e[f++]=a[b++];e.length=f;return e};
|
|
ol.geom.flat.inflateCoordinates=function(a,b,c,d,e){e=goog.isDef(e)?e:[];for(var f=0;b<c;b+=d)e[f++]=a.slice(b,b+d);e.length=f;return e};ol.geom.flat.inflateCoordinatess=function(a,b,c,d,e){e=goog.isDef(e)?e:[];var f=0,g,h;g=0;for(h=c.length;g<h;++g){var k=c[g];e[f++]=ol.geom.flat.inflateCoordinates(a,b,k,d,e[f]);b=k}e.length=f;return e};
|
|
ol.geom.flat.inflateCoordinatesss=function(a,b,c,d,e){e=goog.isDef(e)?e:[];var f=0,g,h;g=0;for(h=c.length;g<h;++g){var k=c[g];e[f++]=ol.geom.flat.inflateCoordinatess(a,b,k,d,e[f]);b=k[k.length-1]}e.length=f;return e};
|
|
ol.geom.flat.lineStringInterpolate=function(a,b,c,d,e,f){var g=NaN,h=NaN,k=(c-b)/d;if(0!==k)if(1==k)g=a[b],h=a[b+1];else if(2==k)g=(1-e)*a[b]+e*a[b+d],h=(1-e)*a[b+1]+e*a[b+d+1];else{var h=a[b],k=a[b+1],l=0,g=[0],m;for(m=b+d;m<c;m+=d){var n=a[m],p=a[m+1],l=l+Math.sqrt((n-h)*(n-h)+(p-k)*(p-k));g.push(l);h=n;k=p}e*=l;c=goog.array.binarySearch(g,e);0>c?(e=(e-g[-c-2])/(g[-c-1]-g[-c-2]),b+=(-c-2)*d,g=(1-e)*a[b]+e*a[b+d],h=(1-e)*a[b+1]+e*a[b+d+1]):(g=a[b+c*d],h=a[b+c*d+1])}return goog.isDefAndNotNull(f)?
|
|
(f.push(g,h),f):[g,h]};ol.geom.flat.lineStringCoordinateAtM=function(a,b,c,d,e,f){if(c==b)return null;if(e<a[b+d-1])return f?(c=a.slice(b,b+d),c[d-1]=e,c):null;if(a[c-1]<e)return f?(c=a.slice(c-d,c),c[d-1]=e,c):null;if(e==a[b+d-1])return a.slice(b,b+d);b/=d;for(c/=d;b<c;)f=b+c>>1,e<a[(f+1)*d-1]?c=f:b=f+1;c=a[b*d-1];if(e==c)return a.slice((b-1)*d,(b-1)*d+d);f=(e-c)/(a[(b+1)*d-1]-c);c=[];var g;for(g=0;g<d-1;++g)c.push((1-f)*a[(b-1)*d+g]+f*a[b*d+g]);c.push(e);return c};
|
|
ol.geom.flat.lineStringsCoordinateAtM=function(a,b,c,d,e,f,g){if(g)return ol.geom.flat.lineStringCoordinateAtM(a,b,c[c.length-1],d,e,f);if(e<a[d-1])return f?(a=a.slice(0,d),a[d-1]=e,a):null;if(a[a.length-1]<e)return f?(a=a.slice(a.length-d),a[d-1]=e,a):null;f=0;for(g=c.length;f<g;++f){var h=c[f];if(b!=h){if(e<a[b+d-1])break;else if(e<=a[h-1])return ol.geom.flat.lineStringCoordinateAtM(a,b,h,d,e,!1);b=h}}return null};
|
|
ol.geom.flat.lineStringLength=function(a,b,c,d){var e=a[b],f=a[b+1],g=0;for(b+=d;b<c;b+=d)var h=a[b],k=a[b+1],g=g+Math.sqrt((h-e)*(h-e)+(k-f)*(k-f)),e=h,f=k;return g};ol.geom.flat.linearRingArea=function(a,b,c,d){for(var e=0,f=a[c-d],g=a[c-d+1];b<c;b+=d)var h=a[b],k=a[b+1],e=e+(g*h-f*k),f=h,g=k;return e/2};ol.geom.flat.linearRingContainsXY=function(a,b,c,d,e,f){for(var g=!1,h=a[c-d],k=a[c-d+1];b<c;b+=d){var l=a[b],m=a[b+1];k>f!=m>f&&e<(l-h)*(f-k)/(m-k)+h&&(g=!g);h=l;k=m}return g};
|
|
ol.geom.flat.linearRingIsClockwise=function(a,b,c,d){for(var e=0,f=a[c-d],g=a[c-d+1];b<c;b+=d)var h=a[b],k=a[b+1],e=e+(h-f)*(k+g),f=h,g=k;return 0<e};ol.geom.flat.linearRingPerimeter=function(a,b,c,d){var e=ol.geom.flat.lineStringLength(a,b,c,d),f=a[c-d]-a[b];a=a[c-d+1]-a[b+1];return e+=Math.sqrt(f*f+a*a)};ol.geom.flat.linearRingsArea=function(a,b,c,d){var e=0,f,g;f=0;for(g=c.length;f<g;++f){var h=c[f],e=e+ol.geom.flat.linearRingArea(a,b,h,d);b=h}return e};
|
|
ol.geom.flat.linearRingsContainsXY=function(a,b,c,d,e,f){if(0===c.length||!ol.geom.flat.linearRingContainsXY(a,b,c[0],d,e,f))return!1;var g;b=1;for(g=c.length;b<g;++b)if(ol.geom.flat.linearRingContainsXY(a,c[b-1],c[b],d,e,f))return!1;return!0};
|
|
ol.geom.flat.linearRingsGetInteriorPoint=function(a,b,c,d,e,f,g){var h,k,l,m,n,p=e[f+1],r=[],q=c[0];l=a[q-d];n=a[q-d+1];for(h=b;h<q;h+=d){m=a[h];k=a[h+1];if(p<=n&&k<=p||n<=p&&p<=k)l=(p-n)/(k-n)*(m-l)+l,r.push(l);l=m;n=k}q=NaN;n=-Infinity;r.sort();l=r[0];h=1;for(k=r.length;h<k;++h){m=r[h];var u=Math.abs(m-l);u>n&&(l=(l+m)/2,ol.geom.flat.linearRingsContainsXY(a,b,c,d,l,p)&&(q=l,n=u));l=m}isNaN(q)&&(q=e[f]);return goog.isDef(g)?(g.push(q,p),g):[q,p]};
|
|
ol.geom.flat.linearRingsAreOriented=function(a,b,c,d){var e,f;e=0;for(f=c.length;e<f;++e){var g=c[e];b=ol.geom.flat.linearRingIsClockwise(a,b,g,d);if(0===e?!b:b)return!1;b=g}return!0};ol.geom.flat.linearRingssAreOriented=function(a,b,c,d){var e,f;e=0;for(f=c.length;e<f;++e)if(!ol.geom.flat.linearRingsAreOriented(a,b,c[e],d))return!1;return!0};ol.geom.flat.linearRingssArea=function(a,b,c,d){var e=0,f,g;f=0;for(g=c.length;f<g;++f){var h=c[f],e=e+ol.geom.flat.linearRingsArea(a,b,h,d);b=h[h.length-1]}return e};
|
|
ol.geom.flat.linearRingssContainsXY=function(a,b,c,d,e,f){if(0===c.length)return!1;var g,h;g=0;for(h=c.length;g<h;++g){var k=c[g];if(ol.geom.flat.linearRingsContainsXY(a,b,k,d,e,f))return!0;b=k[k.length-1]}return!1};ol.geom.flat.linearRingssGetInteriorPoints=function(a,b,c,d,e){var f=[],g,h;g=0;for(h=c.length;g<h;++g){var k=c[g],f=ol.geom.flat.linearRingsGetInteriorPoint(a,b,k,d,e,2*g,f);b=k[k.length-1]}return f};
|
|
ol.geom.flat.linearRingssGetFlatCenters=function(a,b,c,d){var e=[],f,g,h=ol.extent.createEmpty();f=0;for(g=c.length;f<g;++f){var k=c[f],h=ol.extent.createOrUpdateFromFlatCoordinates(a,b,k[0],d);e.push((h[0]+h[2])/2,(h[1]+h[3])/2);b=k[k.length-1]}return e};ol.geom.flat.orientLinearRings=function(a,b,c,d){var e,f;e=0;for(f=c.length;e<f;++e){var g=c[e],h=ol.geom.flat.linearRingIsClockwise(a,b,g,d);(0===e?!h:h)&&ol.geom.flat.reverseCoordinates(a,b,g,d);b=g}return b};
|
|
ol.geom.flat.orientLinearRingss=function(a,b,c,d){var e,f;e=0;for(f=c.length;e<f;++e)b=ol.geom.flat.orientLinearRings(a,b,c[e],d);return b};ol.geom.flat.reverseCoordinates=function(a,b,c,d){for(;b<c-d;){var e;for(e=0;e<d;++e){var f=a[b+e];a[b+e]=a[c-d+e];a[c-d+e]=f}b+=d;c-=d}};ol.geom.flat.squaredSegmentDistance=function(a,b,c,d,e,f){var g=e-c,h=f-d;if(0!==g||0!==h){var k=((a-c)*g+(b-d)*h)/(g*g+h*h);1<k?(c=e,d=f):0<k&&(c+=g*k,d+=h*k)}return ol.geom.flat.squaredDistance(a,b,c,d)};
|
|
ol.geom.flat.squaredDistance=function(a,b,c,d){a=c-a;b=d-b;return a*a+b*b};ol.geom.flat.transform2D=function(a,b,c,d){var e=goog.vec.Mat4.getElement(c,0,0),f=goog.vec.Mat4.getElement(c,1,0),g=goog.vec.Mat4.getElement(c,0,1),h=goog.vec.Mat4.getElement(c,1,1),k=goog.vec.Mat4.getElement(c,0,3);c=goog.vec.Mat4.getElement(c,1,3);var l=goog.isDef(d)?d:[],m=0,n,p;n=0;for(p=a.length;n<p;n+=b){var r=a[n],q=a[n+1];l[m++]=e*r+g*q+k;l[m++]=f*r+h*q+c}goog.isDef(d)&&l.length!=m&&(l.length=m);return l};ol.geom.SimpleGeometry=function(){ol.geom.Geometry.call(this);this.layout=ol.geom.GeometryLayout.XY;this.stride=2;this.flatCoordinates=null};goog.inherits(ol.geom.SimpleGeometry,ol.geom.Geometry);ol.geom.SimpleGeometry.getLayoutForStride_=function(a){if(2==a)return ol.geom.GeometryLayout.XY;if(3==a)return ol.geom.GeometryLayout.XYZ;if(4==a)return ol.geom.GeometryLayout.XYZM;throw Error("unsupported stride: "+a);};
|
|
ol.geom.SimpleGeometry.getStrideForLayout_=function(a){if(a==ol.geom.GeometryLayout.XY)return 2;if(a==ol.geom.GeometryLayout.XYZ||a==ol.geom.GeometryLayout.XYM)return 3;if(a==ol.geom.GeometryLayout.XYZM)return 4;throw Error("unsupported layout: "+a);};ol.geom.SimpleGeometry.prototype.containsXY=goog.functions.FALSE;
|
|
ol.geom.SimpleGeometry.prototype.getExtent=function(a){this.extentRevision!=this.getRevision()&&(this.extent=ol.extent.createOrUpdateFromFlatCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.extent),this.extentRevision=this.getRevision());return ol.extent.returnOrUpdate(this.extent,a)};ol.geom.SimpleGeometry.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)};ol.geom.SimpleGeometry.prototype.getFlatCoordinates=function(){return this.flatCoordinates};
|
|
ol.geom.SimpleGeometry.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)};ol.geom.SimpleGeometry.prototype.getLayout=function(){return this.layout};
|
|
ol.geom.SimpleGeometry.prototype.getSimplifiedGeometry=function(a){this.simplifiedGeometryRevision!=this.getRevision()&&(goog.object.clear(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision());if(0>a||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&a<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var b=a.toString();if(this.simplifiedGeometryCache.hasOwnProperty(b))return this.simplifiedGeometryCache[b];var c=
|
|
this.getSimplifiedGeometryInternal(a);if(c.getFlatCoordinates().length<this.flatCoordinates.length)return this.simplifiedGeometryCache[b]=c;this.simplifiedGeometryMaxMinSquaredTolerance=a;return this};ol.geom.SimpleGeometry.prototype.getSimplifiedGeometryInternal=function(a){return this};ol.geom.SimpleGeometry.prototype.getStride=function(){return this.stride};
|
|
ol.geom.SimpleGeometry.prototype.setFlatCoordinatesInternal=function(a,b){this.stride=ol.geom.SimpleGeometry.getStrideForLayout_(a);this.layout=a;this.flatCoordinates=b};ol.geom.SimpleGeometry.prototype.setLayout=function(a,b,c){if(goog.isDef(a))b=ol.geom.SimpleGeometry.getStrideForLayout_(a);else{for(a=0;a<c;++a){if(0===b.length){this.layout=ol.geom.GeometryLayout.XY;this.stride=2;return}b=b[0]}b=b.length;a=ol.geom.SimpleGeometry.getLayoutForStride_(b)}this.layout=a;this.stride=b};
|
|
ol.geom.SimpleGeometry.prototype.transform=function(a){goog.isNull(this.flatCoordinates)||(a(this.flatCoordinates,this.flatCoordinates,this.stride),this.dispatchChangeEvent())};ol.geom.transformSimpleGeometry2D=function(a,b,c){var d=a.getFlatCoordinates();if(goog.isNull(d))return null;a=a.getStride();return ol.geom.flat.transform2D(d,a,b,c)};ol.geom.closest={};ol.geom.closest.getMaxSquaredDelta=function(a,b,c,d,e){var f=a[b],g=a[b+1];for(b+=d;b<c;b+=d){var h=a[b],k=a[b+1],f=ol.geom.flat.squaredDistance(f,g,h,k);f>e&&(e=f);f=h;g=k}return e};ol.geom.closest.getsMaxSquaredDelta=function(a,b,c,d,e){var f,g;f=0;for(g=c.length;f<g;++f){var h=c[f];e=ol.geom.closest.getMaxSquaredDelta(a,b,h,d,e);b=h}return e};
|
|
ol.geom.closest.getssMaxSquaredDelta=function(a,b,c,d,e){var f,g;f=0;for(g=c.length;f<g;++f){var h=c[f];e=ol.geom.closest.getsMaxSquaredDelta(a,b,h,d,e);b=h[h.length-1]}return e};
|
|
ol.geom.closest.getClosestPoint=function(a,b,c,d,e,f,g,h,k,l,m){if(b==c)return l;var n;if(0===e){n=ol.geom.flat.squaredDistance(g,h,a[b],a[b+1]);if(n<l){for(m=0;m<d;++m)k[m]=a[b+m];k.length=d;return n}return l}for(var p=goog.isDef(m)?m:[NaN,NaN],r=b+d;r<c;)if(ol.geom.flat.closestPoint(a,r-d,r,d,g,h,p),n=ol.geom.flat.squaredDistance(g,h,p[0],p[1]),n<l){l=n;for(m=0;m<d;++m)k[m]=p[m];k.length=d;r+=d}else r+=d*Math.max((Math.sqrt(n)-Math.sqrt(l))/e|0,1);if(f&&(ol.geom.flat.closestPoint(a,c-d,b,d,g,h,
|
|
p),n=ol.geom.flat.squaredDistance(g,h,p[0],p[1]),n<l)){l=n;for(m=0;m<d;++m)k[m]=p[m];k.length=d}return l};ol.geom.closest.getsClosestPoint=function(a,b,c,d,e,f,g,h,k,l,m){m=goog.isDef(m)?m:[NaN,NaN];var n,p;n=0;for(p=c.length;n<p;++n){var r=c[n];l=ol.geom.closest.getClosestPoint(a,b,r,d,e,f,g,h,k,l,m);b=r}return l};
|
|
ol.geom.closest.getssClosestPoint=function(a,b,c,d,e,f,g,h,k,l,m){m=goog.isDef(m)?m:[NaN,NaN];var n,p;n=0;for(p=c.length;n<p;++n){var r=c[n];l=ol.geom.closest.getsClosestPoint(a,b,r,d,e,f,g,h,k,l,m);b=r[r.length-1]}return l};ol.geom.simplify={};ol.geom.simplify.lineString=function(a,b,c,d,e,f,g){g=goog.isDef(g)?g:[];f||(c=ol.geom.simplify.radialDistance(a,b,c,d,e,g,0),a=g,b=0,d=2);g.length=ol.geom.simplify.douglasPeucker(a,b,c,d,e,g,0);return g};
|
|
ol.geom.simplify.douglasPeucker=function(a,b,c,d,e,f,g){var h=(c-b)/d;if(3>h){for(;b<c;b+=d)f[g++]=a[b],f[g++]=a[b+1];return g}var k=Array(h);k[0]=1;k[h-1]=1;c=[b,c-d];for(var l=0,m;0<c.length;){var n=c.pop(),p=c.pop(),r=0,q=a[p],u=a[p+1],s=a[n],v=a[n+1];for(m=p+d;m<n;m+=d){var t=ol.geom.flat.squaredSegmentDistance(a[m],a[m+1],q,u,s,v);t>r&&(l=m,r=t)}r>e&&(k[(l-b)/d]=1,p+d<l&&c.push(p,l),l+d<n&&c.push(l,n))}for(m=0;m<h;++m)k[m]&&(f[g++]=a[b+m*d],f[g++]=a[b+m*d+1]);return g};
|
|
ol.geom.simplify.douglasPeuckers=function(a,b,c,d,e,f,g,h){var k,l;k=0;for(l=c.length;k<l;++k){var m=c[k];g=ol.geom.simplify.douglasPeucker(a,b,m,d,e,f,g);h.push(g);b=m}return g};ol.geom.simplify.douglasPeuckerss=function(a,b,c,d,e,f,g,h){var k,l;k=0;for(l=c.length;k<l;++k){var m=c[k],n=[];g=ol.geom.simplify.douglasPeuckers(a,b,m,d,e,f,g,n);h.push(n);b=m[m.length-1]}return g};
|
|
ol.geom.simplify.radialDistance=function(a,b,c,d,e,f,g){if(c<=b+d){for(;b<c;b+=d)f[g++]=a[b],f[g++]=a[b+1];return g}var h=a[b],k=a[b+1];f[g++]=h;f[g++]=k;var l=h,m=k;for(b+=d;b<c;b+=d)l=a[b],m=a[b+1],ol.geom.flat.squaredDistance(h,k,l,m)>e&&(f[g++]=l,f[g++]=m,h=l,k=m);if(l!=h||m!=k)f[g++]=l,f[g++]=m;return g};ol.geom.simplify.snap=function(a,b){return b*Math.round(a/b)};
|
|
ol.geom.simplify.quantize=function(a,b,c,d,e,f,g){if(b==c)return g;var h=ol.geom.simplify.snap(a[b],e),k=ol.geom.simplify.snap(a[b+1],e);b+=d;f[g++]=h;f[g++]=k;var l,m;do if(l=ol.geom.simplify.snap(a[b],e),m=ol.geom.simplify.snap(a[b+1],e),b+=d,b==c)return f[g++]=l,f[g++]=m,g;while(l==h&&m==k);for(;b<c;){var n,p;n=ol.geom.simplify.snap(a[b],e);p=ol.geom.simplify.snap(a[b+1],e);b+=d;if(n!=l||p!=m){var r=l-h,q=m-k,u=n-h,s=p-k;r*s==q*u&&(0>r&&u<r||r==u||0<r&&u>r)&&(0>q&&s<q||q==s||0<q&&s>q)||(f[g++]=
|
|
l,f[g++]=m,h=l,k=m);l=n;m=p}}f[g++]=l;f[g++]=m;return g};ol.geom.simplify.quantizes=function(a,b,c,d,e,f,g,h){var k,l;k=0;for(l=c.length;k<l;++k){var m=c[k];g=ol.geom.simplify.quantize(a,b,m,d,e,f,g);h.push(g);b=m}return g};ol.geom.simplify.quantizess=function(a,b,c,d,e,f,g,h){var k,l;k=0;for(l=c.length;k<l;++k){var m=c[k],n=[];g=ol.geom.simplify.quantizes(a,b,m,d,e,f,g,n);h.push(n);b=m[m.length-1]}return g};ol.geom.LinearRing=function(a,b){ol.geom.SimpleGeometry.call(this);this.maxDeltaRevision_=this.maxDelta_=-1;this.setCoordinates(a,b)};goog.inherits(ol.geom.LinearRing,ol.geom.SimpleGeometry);ol.geom.LinearRing.prototype.clone=function(){var a=new ol.geom.LinearRing(null);a.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return a};
|
|
ol.geom.LinearRing.prototype.closestPointXY=function(a,b,c,d){if(d<ol.extent.closestSquaredDistanceXY(this.getExtent(),a,b))return d;this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ol.geom.closest.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision());return ol.geom.closest.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,a,b,c,d)};
|
|
ol.geom.LinearRing.prototype.getArea=function(){return ol.geom.flat.linearRingArea(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};ol.geom.LinearRing.prototype.getCoordinates=function(){return ol.geom.flat.inflateCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};
|
|
ol.geom.LinearRing.prototype.getSimplifiedGeometryInternal=function(a){var b=[];b.length=ol.geom.simplify.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,a,b,0);a=new ol.geom.LinearRing(null);a.setFlatCoordinates(ol.geom.GeometryLayout.XY,b);return a};ol.geom.LinearRing.prototype.getType=function(){return ol.geom.GeometryType.LINEAR_RING};
|
|
ol.geom.LinearRing.prototype.setCoordinates=function(a,b){goog.isNull(a)?this.setFlatCoordinates(ol.geom.GeometryLayout.XY,null):(this.setLayout(b,a,1),goog.isNull(this.flatCoordinates)&&(this.flatCoordinates=[]),this.flatCoordinates.length=ol.geom.flat.deflateCoordinates(this.flatCoordinates,0,a,this.stride),this.dispatchChangeEvent())};ol.geom.LinearRing.prototype.setFlatCoordinates=function(a,b){this.setFlatCoordinatesInternal(a,b);this.dispatchChangeEvent()};ol.geom.Point=function(a,b){ol.geom.SimpleGeometry.call(this);this.setCoordinates(a,b)};goog.inherits(ol.geom.Point,ol.geom.SimpleGeometry);ol.geom.Point.prototype.clone=function(){var a=new ol.geom.Point(null);a.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return a};ol.geom.Point.prototype.closestPointXY=function(a,b,c,d){var e=this.flatCoordinates;a=ol.geom.flat.squaredDistance(a,b,e[0],e[1]);if(a<d){d=this.stride;for(b=0;b<d;++b)c[b]=e[b];c.length=d;return a}return d};
|
|
ol.geom.Point.prototype.getCoordinates=function(){return this.flatCoordinates.slice()};ol.geom.Point.prototype.getExtent=function(a){this.extentRevision!=this.getRevision()&&(this.extent=ol.extent.createOrUpdateFromCoordinate(this.flatCoordinates,this.extent),this.extentRevision=this.getRevision());return ol.extent.returnOrUpdate(this.extent,a)};ol.geom.Point.prototype.getType=function(){return ol.geom.GeometryType.POINT};
|
|
ol.geom.Point.prototype.setCoordinates=function(a,b){goog.isNull(a)?this.setFlatCoordinates(ol.geom.GeometryLayout.XY,null):(this.setLayout(b,a,0),goog.isNull(this.flatCoordinates)&&(this.flatCoordinates=[]),this.flatCoordinates.length=ol.geom.flat.deflateCoordinate(this.flatCoordinates,0,a,this.stride),this.dispatchChangeEvent())};ol.geom.Point.prototype.setFlatCoordinates=function(a,b){this.setFlatCoordinatesInternal(a,b);this.dispatchChangeEvent()};ol.geom.Polygon=function(a,b){ol.geom.SimpleGeometry.call(this);this.ends_=[];this.flatInteriorPointRevision_=-1;this.flatInteriorPoint_=null;this.orientedRevision_=this.maxDeltaRevision_=this.maxDelta_=-1;this.orientedFlatCoordinates_=null;this.setCoordinates(a,b)};goog.inherits(ol.geom.Polygon,ol.geom.SimpleGeometry);ol.geom.Polygon.prototype.clone=function(){var a=new ol.geom.Polygon(null);a.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),this.ends_.slice());return a};
|
|
ol.geom.Polygon.prototype.closestPointXY=function(a,b,c,d){if(d<ol.extent.closestSquaredDistanceXY(this.getExtent(),a,b))return d;this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ol.geom.closest.getsMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision());return ol.geom.closest.getsClosestPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,a,b,c,d)};
|
|
ol.geom.Polygon.prototype.containsXY=function(a,b){return ol.geom.flat.linearRingsContainsXY(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,a,b)};ol.geom.Polygon.prototype.getArea=function(){return ol.geom.flat.linearRingsArea(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)};ol.geom.Polygon.prototype.getCoordinates=function(){return ol.geom.flat.inflateCoordinatess(this.flatCoordinates,0,this.ends_,this.stride)};ol.geom.Polygon.prototype.getEnds=function(){return this.ends_};
|
|
ol.geom.Polygon.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var a=ol.extent.getCenter(this.getExtent());this.flatInteriorPoint_=ol.geom.flat.linearRingsGetInteriorPoint(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,a,0);this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_};ol.geom.Polygon.prototype.getInteriorPoint=function(){return new ol.geom.Point(this.getFlatInteriorPoint())};
|
|
ol.geom.Polygon.prototype.getLinearRings=function(){var a=this.layout,b=this.flatCoordinates,c=this.ends_,d=[],e=0,f,g;f=0;for(g=c.length;f<g;++f){var h=c[f],k=new ol.geom.LinearRing(null);k.setFlatCoordinates(a,b.slice(e,h));d.push(k);e=h}return d};
|
|
ol.geom.Polygon.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var a=this.flatCoordinates;ol.geom.flat.linearRingsAreOriented(a,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=a:(this.orientedFlatCoordinates_=a.slice(),this.orientedFlatCoordinates_.length=ol.geom.flat.orientLinearRings(this.orientedFlatCoordinates_,0,this.ends_,this.stride));this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_};
|
|
ol.geom.Polygon.prototype.getSimplifiedGeometryInternal=function(a){var b=[],c=[];b.length=ol.geom.simplify.quantizes(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(a),b,0,c);a=new ol.geom.Polygon(null);a.setFlatCoordinates(ol.geom.GeometryLayout.XY,b,c);return a};ol.geom.Polygon.prototype.getType=function(){return ol.geom.GeometryType.POLYGON};
|
|
ol.geom.Polygon.prototype.setCoordinates=function(a,b){if(goog.isNull(a))this.setFlatCoordinates(ol.geom.GeometryLayout.XY,null,this.ends_);else{this.setLayout(b,a,2);goog.isNull(this.flatCoordinates)&&(this.flatCoordinates=[]);var c=ol.geom.flat.deflateCoordinatess(this.flatCoordinates,0,a,this.stride,this.ends_);this.flatCoordinates.length=0===c.length?0:c[c.length-1];this.dispatchChangeEvent()}};
|
|
ol.geom.Polygon.prototype.setFlatCoordinates=function(a,b,c){this.setFlatCoordinatesInternal(a,b);this.ends_=c;this.dispatchChangeEvent()};ol.render={};ol.render.IVectorContext=function(){};ol.render.IVectorContext.prototype.drawAsync=function(a,b){};ol.render.IVectorContext.prototype.drawCircleGeometry=function(a,b){};ol.render.IVectorContext.prototype.drawFeature=function(a,b){};ol.render.IVectorContext.prototype.drawGeometryCollectionGeometry=function(a,b){};ol.render.IVectorContext.prototype.drawPointGeometry=function(a,b){};ol.render.IVectorContext.prototype.drawLineStringGeometry=function(a,b){};
|
|
ol.render.IVectorContext.prototype.drawMultiLineStringGeometry=function(a,b){};ol.render.IVectorContext.prototype.drawMultiPointGeometry=function(a,b){};ol.render.IVectorContext.prototype.drawMultiPolygonGeometry=function(a,b){};ol.render.IVectorContext.prototype.drawPolygonGeometry=function(a,b){};ol.render.IVectorContext.prototype.drawText=function(a,b,c,d,e,f){};ol.render.IVectorContext.prototype.setFillStrokeStyle=function(a,b){};ol.render.IVectorContext.prototype.setImageStyle=function(a){};
|
|
ol.render.IVectorContext.prototype.setTextStyle=function(a){};ol.render.EventType={POSTCOMPOSE:"postcompose",PRECOMPOSE:"precompose",RENDER:"render"};ol.render.Event=function(a,b,c,d,e,f){goog.events.Event.call(this,a,b);this.vectorContext=c;this.frameState=d;this.context=e;this.glContext=f};goog.inherits(ol.render.Event,goog.events.Event);ol.render.Box=function(a){this.geometry_=this.endPixel_=this.startPixel_=this.postComposeListenerKey_=this.map_=null;this.style_=a};goog.inherits(ol.render.Box,goog.Disposable);ol.render.Box.prototype.createGeometry_=function(){var a=this.startPixel_,b=this.endPixel_,a=goog.array.map([a,[a[0],b[1]],b,[b[0],a[1]]],this.map_.getCoordinateFromPixel,this.map_);a[4]=a[0].slice();return new ol.geom.Polygon([a])};ol.render.Box.prototype.disposeInternal=function(){this.setMap(null)};
|
|
ol.render.Box.prototype.handleMapPostCompose_=function(a){var b=this.geometry_,c=this.style_;a.vectorContext.drawAsync(Infinity,function(a){a.setFillStrokeStyle(c.getFill(),c.getStroke());a.setTextStyle(c.getText());a.drawPolygonGeometry(b,null)})};ol.render.Box.prototype.getGeometry=function(){return this.geometry_};ol.render.Box.prototype.requestMapRenderFrame_=function(){goog.isNull(this.map_)||(goog.isNull(this.startPixel_)||goog.isNull(this.endPixel_))||this.map_.render()};
|
|
ol.render.Box.prototype.setMap=function(a){goog.isNull(this.postComposeListenerKey_)||(goog.events.unlistenByKey(this.postComposeListenerKey_),this.postComposeListenerKey_=null,this.map_.render(),this.map_=null);this.map_=a;goog.isNull(this.map_)||(this.postComposeListenerKey_=goog.events.listen(a,ol.render.EventType.POSTCOMPOSE,this.handleMapPostCompose_,!1,this),this.requestMapRenderFrame_())};
|
|
ol.render.Box.prototype.setPixels=function(a,b){this.startPixel_=a;this.endPixel_=b;this.geometry_=this.createGeometry_();this.requestMapRenderFrame_()};ol.DRAG_BOX_HYSTERESIS_PIXELS=8;ol.DRAG_BOX_HYSTERESIS_PIXELS_SQUARED=ol.DRAG_BOX_HYSTERESIS_PIXELS*ol.DRAG_BOX_HYSTERESIS_PIXELS;ol.DragBoxEventType={BOXSTART:"boxstart",BOXEND:"boxend"};ol.DragBoxEvent=function(a,b){goog.events.Event.call(this,a);this.coordinate=b};goog.inherits(ol.DragBoxEvent,goog.events.Event);
|
|
ol.interaction.DragBox=function(a){ol.interaction.Drag.call(this);a=goog.isDef(a)?a:{};var b=goog.isDef(a.style)?a.style:null;this.box_=new ol.render.Box(b);this.startPixel_=null;this.condition_=goog.isDef(a.condition)?a.condition:ol.events.condition.always};goog.inherits(ol.interaction.DragBox,ol.interaction.Drag);ol.interaction.DragBox.prototype.handleDrag=function(a){this.box_.setPixels(this.startPixel_,a.pixel)};ol.interaction.DragBox.prototype.getGeometry=function(){return this.box_.getGeometry()};
|
|
ol.interaction.DragBox.prototype.onBoxEnd=goog.nullFunction;ol.interaction.DragBox.prototype.handleDragEnd=function(a){this.box_.setMap(null);this.deltaX*this.deltaX+this.deltaY*this.deltaY>=ol.DRAG_BOX_HYSTERESIS_PIXELS_SQUARED&&(this.onBoxEnd(a),this.dispatchEvent(new ol.DragBoxEvent(ol.DragBoxEventType.BOXEND,a.coordinate)))};
|
|
ol.interaction.DragBox.prototype.handleDragStart=function(a){return a.browserEvent.isMouseActionButton()&&this.condition_(a)?(this.startPixel_=a.pixel,this.box_.setMap(a.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new ol.DragBoxEvent(ol.DragBoxEventType.BOXSTART,a.coordinate)),!0):!1};goog.color={};
|
|
goog.color.names={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",
|
|
darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",
|
|
ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",
|
|
lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",
|
|
moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",
|
|
seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};goog.color.parse=function(a){var b={};a=String(a);var c=goog.color.prependHashIfNecessaryHelper(a);if(goog.color.isValidHexColor_(c))return b.hex=goog.color.normalizeHex(c),b.type="hex",b;c=goog.color.isValidRgbColor_(a);if(c.length)return b.hex=goog.color.rgbArrayToHex(c),b.type="rgb",b;if(goog.color.names&&(c=goog.color.names[a.toLowerCase()]))return b.hex=c,b.type="named",b;throw Error(a+" is not a valid color string");};
|
|
goog.color.isValidColor=function(a){var b=goog.color.prependHashIfNecessaryHelper(a);return!!(goog.color.isValidHexColor_(b)||goog.color.isValidRgbColor_(a).length||goog.color.names&&goog.color.names[a.toLowerCase()])};goog.color.parseRgb=function(a){var b=goog.color.isValidRgbColor_(a);if(!b.length)throw Error(a+" is not a valid RGB color");return b};goog.color.hexToRgbStyle=function(a){return goog.color.rgbStyle_(goog.color.hexToRgb(a))};goog.color.hexTripletRe_=/#(.)(.)(.)/;
|
|
goog.color.normalizeHex=function(a){if(!goog.color.isValidHexColor_(a))throw Error("'"+a+"' is not a valid hex color");4==a.length&&(a=a.replace(goog.color.hexTripletRe_,"#$1$1$2$2$3$3"));return a.toLowerCase()};goog.color.hexToRgb=function(a){a=goog.color.normalizeHex(a);var b=parseInt(a.substr(1,2),16),c=parseInt(a.substr(3,2),16);a=parseInt(a.substr(5,2),16);return[b,c,a]};
|
|
goog.color.rgbToHex=function(a,b,c){a=Number(a);b=Number(b);c=Number(c);if(isNaN(a)||0>a||255<a||isNaN(b)||0>b||255<b||isNaN(c)||0>c||255<c)throw Error('"('+a+","+b+","+c+'") is not a valid RGB color');a=goog.color.prependZeroIfNecessaryHelper(a.toString(16));b=goog.color.prependZeroIfNecessaryHelper(b.toString(16));c=goog.color.prependZeroIfNecessaryHelper(c.toString(16));return"#"+a+b+c};goog.color.rgbArrayToHex=function(a){return goog.color.rgbToHex(a[0],a[1],a[2])};
|
|
goog.color.rgbToHsl=function(a,b,c){a/=255;b/=255;c/=255;var d=Math.max(a,b,c),e=Math.min(a,b,c),f=0,g=0,h=0.5*(d+e);d!=e&&(d==a?f=60*(b-c)/(d-e):d==b?f=60*(c-a)/(d-e)+120:d==c&&(f=60*(a-b)/(d-e)+240),g=0<h&&0.5>=h?(d-e)/(2*h):(d-e)/(2-2*h));return[Math.round(f+360)%360,g,h]};goog.color.rgbArrayToHsl=function(a){return goog.color.rgbToHsl(a[0],a[1],a[2])};goog.color.hueToRgb_=function(a,b,c){0>c?c+=1:1<c&&(c-=1);return 1>6*c?a+6*(b-a)*c:1>2*c?b:2>3*c?a+6*(b-a)*(2/3-c):a};
|
|
goog.color.hslToRgb=function(a,b,c){var d=0,e=0,f=0;a/=360;if(0==b)d=e=f=255*c;else var g=f=0,g=0.5>c?c*(1+b):c+b-b*c,f=2*c-g,d=255*goog.color.hueToRgb_(f,g,a+1/3),e=255*goog.color.hueToRgb_(f,g,a),f=255*goog.color.hueToRgb_(f,g,a-1/3);return[Math.round(d),Math.round(e),Math.round(f)]};goog.color.hslArrayToRgb=function(a){return goog.color.hslToRgb(a[0],a[1],a[2])};goog.color.validHexColorRe_=/^#(?:[0-9a-f]{3}){1,2}$/i;goog.color.isValidHexColor_=function(a){return goog.color.validHexColorRe_.test(a)};
|
|
goog.color.normalizedHexColorRe_=/^#[0-9a-f]{6}$/;goog.color.isNormalizedHexColor_=function(a){return goog.color.normalizedHexColorRe_.test(a)};goog.color.rgbColorRe_=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;goog.color.isValidRgbColor_=function(a){var b=a.match(goog.color.rgbColorRe_);if(b){a=Number(b[1]);var c=Number(b[2]),b=Number(b[3]);if(0<=a&&255>=a&&0<=c&&255>=c&&0<=b&&255>=b)return[a,c,b]}return[]};
|
|
goog.color.prependZeroIfNecessaryHelper=function(a){return 1==a.length?"0"+a:a};goog.color.prependHashIfNecessaryHelper=function(a){return"#"==a.charAt(0)?a:"#"+a};goog.color.rgbStyle_=function(a){return"rgb("+a.join(",")+")"};
|
|
goog.color.hsvToRgb=function(a,b,c){var d=0,e=0,f=0;if(0==b)f=e=d=c;else{var g=Math.floor(a/60),h=a/60-g;a=c*(1-b);var k=c*(1-b*h);b=c*(1-b*(1-h));switch(g){case 1:d=k;e=c;f=a;break;case 2:d=a;e=c;f=b;break;case 3:d=a;e=k;f=c;break;case 4:d=b;e=a;f=c;break;case 5:d=c;e=a;f=k;break;case 6:case 0:d=c,e=b,f=a}}return[Math.floor(d),Math.floor(e),Math.floor(f)]};
|
|
goog.color.rgbToHsv=function(a,b,c){var d=Math.max(Math.max(a,b),c),e=Math.min(Math.min(a,b),c);if(e==d)e=a=0;else{var f=d-e,e=f/d;a=60*(a==d?(b-c)/f:b==d?2+(c-a)/f:4+(a-b)/f);0>a&&(a+=360);360<a&&(a-=360)}return[a,e,d]};goog.color.rgbArrayToHsv=function(a){return goog.color.rgbToHsv(a[0],a[1],a[2])};goog.color.hsvArrayToRgb=function(a){return goog.color.hsvToRgb(a[0],a[1],a[2])};goog.color.hexToHsl=function(a){a=goog.color.hexToRgb(a);return goog.color.rgbToHsl(a[0],a[1],a[2])};
|
|
goog.color.hslToHex=function(a,b,c){return goog.color.rgbArrayToHex(goog.color.hslToRgb(a,b,c))};goog.color.hslArrayToHex=function(a){return goog.color.rgbArrayToHex(goog.color.hslToRgb(a[0],a[1],a[2]))};goog.color.hexToHsv=function(a){return goog.color.rgbArrayToHsv(goog.color.hexToRgb(a))};goog.color.hsvToHex=function(a,b,c){return goog.color.rgbArrayToHex(goog.color.hsvToRgb(a,b,c))};goog.color.hsvArrayToHex=function(a){return goog.color.hsvToHex(a[0],a[1],a[2])};
|
|
goog.color.hslDistance=function(a,b){var c,d;c=0.5>=a[2]?a[1]*a[2]:a[1]*(1-a[2]);d=0.5>=b[2]?b[1]*b[2]:b[1]*(1-b[2]);return(a[2]-b[2])*(a[2]-b[2])+c*c+d*d-2*c*d*Math.cos(2*(a[0]/360-b[0]/360)*Math.PI)};goog.color.blend=function(a,b,c){c=goog.math.clamp(c,0,1);return[Math.round(c*a[0]+(1-c)*b[0]),Math.round(c*a[1]+(1-c)*b[1]),Math.round(c*a[2]+(1-c)*b[2])]};goog.color.darken=function(a,b){return goog.color.blend([0,0,0],a,b)};
|
|
goog.color.lighten=function(a,b){return goog.color.blend([255,255,255],a,b)};goog.color.highContrast=function(a,b){for(var c=[],d=0;d<b.length;d++)c.push({color:b[d],diff:goog.color.yiqBrightnessDiff_(b[d],a)+goog.color.colorDiff_(b[d],a)});c.sort(function(a,b){return b.diff-a.diff});return c[0].color};goog.color.yiqBrightness_=function(a){return Math.round((299*a[0]+587*a[1]+114*a[2])/1E3)};goog.color.yiqBrightnessDiff_=function(a,b){return Math.abs(goog.color.yiqBrightness_(a)-goog.color.yiqBrightness_(b))};
|
|
goog.color.colorDiff_=function(a,b){return Math.abs(a[0]-b[0])+Math.abs(a[1]-b[1])+Math.abs(a[2]-b[2])};ol.color={};ol.color.ENABLE_NAMED_COLORS=!0;ol.color.hexColorRe_=/^#(?:[0-9a-f]{3}){1,2}$/i;ol.color.rgbColorRe_=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;ol.color.rgbaColorRe_=/^(?:rgba)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|1|0\.\d{0,10})\)$/i;
|
|
ol.color.blend=function(a,b,c){c=goog.isDef(c)?c:[];var d=a[3],e=a[3];if(1==d)c[0]=b[0]*e+a[0]*(1-e)+0.5|0,c[1]=b[1]*e+a[1]*(1-e)+0.5|0,c[2]=b[2]*e+a[2]*(1-e)+0.5|0,c[4]=1;else if(0===e)c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=d;else{var f=e+d*(1-e);0===f?(c[0]=0,c[1]=0,c[2]=0,c[3]=0):(c[0]=(b[0]*e+a[0]*d*(1-e))/f+0.5|0,c[1]=(b[1]*e+a[1]*d*(1-e))/f+0.5|0,c[2]=(b[2]*e+a[2]*d*(1-e))/f+0.5|0,c[3]=f)}return c};ol.color.asArray=function(a){return goog.isArray(a)?a:ol.color.fromString(a)};
|
|
ol.color.asString=function(a){return goog.isString(a)?a:ol.color.toString(a)};ol.color.equals=function(a,b){return a===b||a[0]==b[0]&&a[1]==b[1]&&a[2]==b[2]&&a[3]==b[3]};ol.color.fromString=function(){var a={},b=0;return function(c,d){var e;if(a.hasOwnProperty(c))e=a[c];else{if(1024<=b){e=0;for(var f in a)0===(e++&3)&&(delete a[f],--b)}e=ol.color.fromStringInternal_(c);a[c]=e;++b}return ol.color.returnOrUpdate(e,d)}}();
|
|
ol.color.fromStringInternal_=function(a){var b=!1;ol.color.ENABLE_NAMED_COLORS&&goog.color.names.hasOwnProperty(a)&&(a=goog.color.names[a],b=!0);var c,d;if(b||ol.color.hexColorRe_.exec(a))return d=3==a.length-1?1:2,b=parseInt(a.substr(1+0*d,d),16),c=parseInt(a.substr(1+1*d,d),16),a=parseInt(a.substr(1+2*d,d),16),1==d&&(b=(b<<4)+b,c=(c<<4)+c,a=(a<<4)+a),b=[b,c,a,1];if(d=ol.color.rgbaColorRe_.exec(a))return b=Number(d[1]),c=Number(d[2]),a=Number(d[3]),d=Number(d[4]),b=[b,c,a,d],ol.color.normalize(b,
|
|
b);if(d=ol.color.rgbColorRe_.exec(a))return b=Number(d[1]),c=Number(d[2]),a=Number(d[3]),b=[b,c,a,1],ol.color.normalize(b,b);throw Error(a+" is not a valid color");};ol.color.isValid=function(a){return 0<=a[0]&&256>a[0]&&0<=a[1]&&256>a[1]&&0<=a[2]&&256>a[2]&&0<=a[3]&&1>=a[3]};ol.color.normalize=function(a,b){var c=goog.isDef(b)?b:[];c[0]=goog.math.clamp(a[0]+0.5|0,0,255);c[1]=goog.math.clamp(a[1]+0.5|0,0,255);c[2]=goog.math.clamp(a[2]+0.5|0,0,255);c[3]=goog.math.clamp(a[3],0,1);return c};
|
|
ol.color.returnOrUpdate=function(a,b){return goog.isDef(b)?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b):a};ol.color.toString=function(a){var b=a[0];b!=(b|0)&&(b=b+0.5|0);var c=a[1];c!=(c|0)&&(c=c+0.5|0);var d=a[2];d!=(d|0)&&(d=d+0.5|0);return"rgba("+b+","+c+","+d+","+a[3]+")"};ol.color.transform=function(a,b,c){c=goog.isDef(c)?c:[];c=goog.vec.Mat4.multVec3(b,a,c);c[3]=a[3];return ol.color.normalize(c,c)};
|
|
ol.color.stringOrColorEquals=function(a,b){if(a===b||a==b)return!0;goog.isString(a)&&(a=ol.color.fromString(a));goog.isString(b)&&(b=ol.color.fromString(b));return ol.color.equals(a,b)};ol.render.canvas={};ol.render.canvas.defaultFont="10px sans-serif";ol.render.canvas.defaultFillStyle=ol.color.fromString("black");ol.render.canvas.defaultLineCap="round";ol.render.canvas.defaultLineDash=[];ol.render.canvas.defaultLineJoin="round";ol.render.canvas.defaultMiterLimit=10;ol.render.canvas.defaultStrokeStyle=[0,0,0,1];ol.render.canvas.defaultTextAlign="center";ol.render.canvas.defaultTextBaseline="middle";ol.render.canvas.defaultLineWidth=1;ol.style={};ol.style.Fill=function(a){a=goog.isDef(a)?a:{};this.color_=goog.isDef(a.color)?a.color:null};ol.style.Fill.prototype.getColor=function(){return this.color_};ol.style.ImageState={IDLE:0,LOADING:1,LOADED:2,ERROR:3};ol.style.Image=function(a){this.opacity_=a.opacity;this.rotateWithView_=a.rotateWithView;this.rotation_=a.rotation;this.scale_=a.scale;this.snapToPixel_=a.snapToPixel};ol.style.Image.prototype.getOpacity=function(){return this.opacity_};ol.style.Image.prototype.getRotateWithView=function(){return this.rotateWithView_};ol.style.Image.prototype.getRotation=function(){return this.rotation_};ol.style.Image.prototype.getScale=function(){return this.scale_};
|
|
ol.style.Image.prototype.getSnapToPixel=function(){return this.snapToPixel_};ol.style.Stroke=function(a){a=goog.isDef(a)?a:{};this.color_=goog.isDef(a.color)?a.color:null;this.lineCap_=a.lineCap;this.lineDash_=goog.isDef(a.lineDash)?a.lineDash:null;this.lineJoin_=a.lineJoin;this.miterLimit_=a.miterLimit;this.width_=a.width};ol.style.Stroke.prototype.getColor=function(){return this.color_};ol.style.Stroke.prototype.getLineCap=function(){return this.lineCap_};ol.style.Stroke.prototype.getLineDash=function(){return this.lineDash_};ol.style.Stroke.prototype.getLineJoin=function(){return this.lineJoin_};
|
|
ol.style.Stroke.prototype.getMiterLimit=function(){return this.miterLimit_};ol.style.Stroke.prototype.getWidth=function(){return this.width_};ol.style.Circle=function(a){a=goog.isDef(a)?a:{};this.canvas_=goog.dom.createElement(goog.dom.TagName.CANVAS);this.hitDetectionCanvas_=null;this.fill_=goog.isDef(a.fill)?a.fill:null;this.radius_=a.radius;this.stroke_=goog.isDef(a.stroke)?a.stroke:null;a=this.render_();this.anchor_=[a/2,a/2];this.size_=[a,a];ol.style.Image.call(this,{opacity:1,rotateWithView:!1,rotation:0,scale:1,snapToPixel:void 0})};goog.inherits(ol.style.Circle,ol.style.Image);ol.style.Circle.prototype.getAnchor=function(){return this.anchor_};
|
|
ol.style.Circle.prototype.getFill=function(){return this.fill_};ol.style.Circle.prototype.getHitDetectionImage=function(a){return this.hitDetectionCanvas_};ol.style.Circle.prototype.getImage=function(a){return this.canvas_};ol.style.Circle.prototype.getImageState=function(){return ol.style.ImageState.LOADED};ol.style.Circle.prototype.getRadius=function(){return this.radius_};ol.style.Circle.prototype.getSize=function(){return this.size_};ol.style.Circle.prototype.getStroke=function(){return this.stroke_};
|
|
ol.style.Circle.prototype.listenImageChange=goog.nullFunction;ol.style.Circle.prototype.load=goog.nullFunction;ol.style.Circle.prototype.unlistenImageChange=goog.nullFunction;
|
|
ol.style.Circle.prototype.render_=function(){var a=this.canvas_,b,c;goog.isNull(this.stroke_)?c=0:(b=ol.color.asString(this.stroke_.getColor()),c=this.stroke_.getWidth(),goog.isDef(c)||(c=ol.render.canvas.defaultLineWidth));var d=2*(this.radius_+c)+1;a.height=d;a.width=d;var e=a.getContext("2d");e.arc(d/2,d/2,this.radius_,0,2*Math.PI,!0);goog.isNull(this.fill_)||(e.fillStyle=ol.color.asString(this.fill_.getColor()),e.fill());goog.isNull(this.stroke_)||(e.strokeStyle=b,e.lineWidth=c,e.stroke());goog.isNull(this.fill_)?
|
|
(a=this.hitDetectionCanvas_=goog.dom.createElement(goog.dom.TagName.CANVAS),a.height=d,a.width=d,e=a.getContext("2d"),e.arc(d/2,d/2,this.radius_,0,2*Math.PI,!0),e.fillStyle=ol.render.canvas.defaultFillStyle,e.fill(),goog.isNull(this.stroke_)||(e.strokeStyle=b,e.lineWidth=c,e.stroke())):this.hitDetectionCanvas_=a;return d};ol.style.Style=function(a){a=goog.isDef(a)?a:{};this.fill_=goog.isDef(a.fill)?a.fill:null;this.image_=goog.isDef(a.image)?a.image:null;this.stroke_=goog.isDef(a.stroke)?a.stroke:null;this.text_=goog.isDef(a.text)?a.text:null;this.zIndex_=a.zIndex};ol.style.Style.prototype.getFill=function(){return this.fill_};ol.style.Style.prototype.getImage=function(){return this.image_};ol.style.Style.prototype.getStroke=function(){return this.stroke_};ol.style.Style.prototype.getText=function(){return this.text_};
|
|
ol.style.Style.prototype.getZIndex=function(){return this.zIndex_};ol.feature={};ol.Feature=function(a){ol.Object.call(this);this.id_=void 0;this.geometryName_="geometry";this.style_=null;this.styleFunction_=void 0;this.geometryChangeKey_=null;goog.events.listen(this,ol.Object.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,!1,this);goog.isDefAndNotNull(a)?a instanceof ol.geom.Geometry?this.setGeometry(a):this.setValues(a):this.setGeometry(null)};goog.inherits(ol.Feature,ol.Object);ol.Feature.prototype.getGeometry=function(){return this.get(this.geometryName_)};
|
|
goog.exportProperty(ol.Feature.prototype,"getGeometry",ol.Feature.prototype.getGeometry);ol.Feature.prototype.getId=function(){return this.id_};ol.Feature.prototype.getGeometryName=function(){return this.geometryName_};ol.Feature.prototype.getStyle=function(){return this.style_};ol.Feature.prototype.getStyleFunction=function(){return this.styleFunction_};ol.Feature.prototype.handleGeometryChange_=function(){this.dispatchChangeEvent()};
|
|
ol.Feature.prototype.handleGeometryChanged_=function(){goog.isNull(this.geometryChangeKey_)||(goog.events.unlistenByKey(this.geometryChangeKey_),this.geometryChangeKey_=null);var a=this.getGeometry();goog.isDefAndNotNull(a)&&(this.geometryChangeKey_=goog.events.listen(a,goog.events.EventType.CHANGE,this.handleGeometryChange_,!1,this));this.dispatchChangeEvent()};ol.Feature.prototype.setGeometry=function(a){this.set(this.geometryName_,a)};goog.exportProperty(ol.Feature.prototype,"setGeometry",ol.Feature.prototype.setGeometry);
|
|
ol.Feature.prototype.setStyle=function(a){this.style_=a;this.styleFunction_=ol.feature.createFeatureStyleFunction(a);this.dispatchChangeEvent()};ol.Feature.prototype.setId=function(a){this.id_=a};ol.Feature.prototype.setGeometryName=function(a){goog.events.unlisten(this,ol.Object.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,!1,this);this.geometryName_=a;goog.events.listen(this,ol.Object.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,!1,this);this.handleGeometryChanged_()};
|
|
ol.feature.defaultFeatureStyleFunction=function(){var a=new ol.style.Fill({color:"rgba(255,255,255,0.4)"}),b=new ol.style.Stroke({color:"#3399CC",width:1.25}),c=[new ol.style.Style({image:new ol.style.Circle({fill:a,stroke:b,radius:5}),fill:a,stroke:b})];return function(a){return c}}();ol.feature.defaultStyleFunction=function(a,b){var c=a.getStyleFunction();goog.isDef(c)||(c=ol.feature.defaultFeatureStyleFunction);return c.call(a,b)};
|
|
ol.feature.createFeatureStyleFunction=function(a){goog.isFunction(a)||(a=goog.isArray(a)?a:[a],a=goog.functions.constant(a));return a};ol.feature.createStyleFunction=function(a){goog.isFunction(a)||(a=goog.isArray(a)?a:[a],a=goog.functions.constant(a));return a};ol.FeatureOverlay=function(a){a=goog.isDef(a)?a:{};this.style_=this.postComposeListenerKey_=this.map_=this.featureChangeListenerKeys_=this.featuresListenerKeys_=this.features_=null;this.styleFunction_=goog.isDef(a.style)?ol.feature.createStyleFunction(a.style):void 0;goog.isDef(a.features)?goog.isArray(a.features)?this.setFeatures(new ol.Collection(goog.array.clone(a.features))):this.setFeatures(a.features):this.setFeatures(new ol.Collection);goog.isDef(a.map)&&this.setMap(a.map)};
|
|
ol.FeatureOverlay.prototype.addFeature=function(a){this.features_.push(a)};ol.FeatureOverlay.prototype.getFeatures=function(){return this.features_};ol.FeatureOverlay.prototype.handleFeatureChange_=function(){this.render_()};ol.FeatureOverlay.prototype.handleFeaturesAdd_=function(a){a=a.element;this.featureChangeListenerKeys_[goog.getUid(a).toString()]=goog.events.listen(a,goog.events.EventType.CHANGE,this.handleFeatureChange_,!1,this);this.render_()};
|
|
ol.FeatureOverlay.prototype.handleFeaturesRemove_=function(a){a=goog.getUid(a.element).toString();goog.events.unlistenByKey(this.featureChangeListenerKeys_[a]);delete this.featureChangeListenerKeys_[a];this.render_()};
|
|
ol.FeatureOverlay.prototype.handleMapPostCompose_=function(a){if(!goog.isNull(this.features_)&&goog.isDef(this.styleFunction_)){var b=a.frameState.view2DState.resolution,c=a.vectorContext,d,e,f;this.features_.forEach(function(a){f=this.styleFunction_(a,b);if(goog.isDefAndNotNull(f))for(e=f.length,d=0;d<e;++d)c.drawFeature(a,f[d])},this)}};ol.FeatureOverlay.prototype.removeFeature=function(a){this.features_.remove(a)};ol.FeatureOverlay.prototype.render_=function(){goog.isNull(this.map_)||this.map_.render()};
|
|
ol.FeatureOverlay.prototype.setFeatures=function(a){goog.isNull(this.featuresListenerKeys_)||(goog.array.forEach(this.featuresListenerKeys_,goog.events.unlistenByKey),this.featuresListenerKeys_=null);goog.isNull(this.featureChangeListenerKeys_)||(goog.array.forEach(goog.object.getValues(this.featureChangeListenerKeys_),goog.events.unlistenByKey),this.featureChangeListenerKeys_=null);this.features_=a;if(!goog.isNull(a)){this.featuresListenerKeys_=[goog.events.listen(a,ol.CollectionEventType.ADD,this.handleFeaturesAdd_,
|
|
!1,this),goog.events.listen(a,ol.CollectionEventType.REMOVE,this.handleFeaturesRemove_,!1,this)];this.featureChangeListenerKeys_={};a=a.getArray();var b,c=a.length,d;for(b=0;b<c;++b)d=a[b],this.featureChangeListenerKeys_[goog.getUid(d).toString()]=goog.events.listen(d,goog.events.EventType.CHANGE,this.handleFeatureChange_,!1,this)}this.render_()};
|
|
ol.FeatureOverlay.prototype.setMap=function(a){goog.isNull(this.postComposeListenerKey_)||(goog.events.unlistenByKey(this.postComposeListenerKey_),this.postComposeListenerKey_=null);this.render_();this.map_=a;goog.isNull(a)||(this.postComposeListenerKey_=goog.events.listen(a,ol.render.EventType.POSTCOMPOSE,this.handleMapPostCompose_,!1,this),a.render())};ol.FeatureOverlay.prototype.setStyle=function(a){this.style_=a;this.styleFunction_=ol.feature.createStyleFunction(a);this.render_()};
|
|
ol.FeatureOverlay.prototype.getStyle=function(){return this.style_};ol.FeatureOverlay.prototype.getStyleFunction=function(){return this.styleFunction_};goog.structs={};goog.structs.getCount=function(a){return"function"==typeof a.getCount?a.getCount():goog.isArrayLike(a)||goog.isString(a)?a.length:goog.object.getCount(a)};goog.structs.getValues=function(a){if("function"==typeof a.getValues)return a.getValues();if(goog.isString(a))return a.split("");if(goog.isArrayLike(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return goog.object.getValues(a)};
|
|
goog.structs.getKeys=function(a){if("function"==typeof a.getKeys)return a.getKeys();if("function"!=typeof a.getValues){if(goog.isArrayLike(a)||goog.isString(a)){var b=[];a=a.length;for(var c=0;c<a;c++)b.push(c);return b}return goog.object.getKeys(a)}};goog.structs.contains=function(a,b){return"function"==typeof a.contains?a.contains(b):"function"==typeof a.containsValue?a.containsValue(b):goog.isArrayLike(a)||goog.isString(a)?goog.array.contains(a,b):goog.object.containsValue(a,b)};
|
|
goog.structs.isEmpty=function(a){return"function"==typeof a.isEmpty?a.isEmpty():goog.isArrayLike(a)||goog.isString(a)?goog.array.isEmpty(a):goog.object.isEmpty(a)};goog.structs.clear=function(a){"function"==typeof a.clear?a.clear():goog.isArrayLike(a)?goog.array.clear(a):goog.object.clear(a)};
|
|
goog.structs.forEach=function(a,b,c){if("function"==typeof a.forEach)a.forEach(b,c);else if(goog.isArrayLike(a)||goog.isString(a))goog.array.forEach(a,b,c);else for(var d=goog.structs.getKeys(a),e=goog.structs.getValues(a),f=e.length,g=0;g<f;g++)b.call(c,e[g],d&&d[g],a)};
|
|
goog.structs.filter=function(a,b,c){if("function"==typeof a.filter)return a.filter(b,c);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.filter(a,b,c);var d,e=goog.structs.getKeys(a),f=goog.structs.getValues(a),g=f.length;if(e){d={};for(var h=0;h<g;h++)b.call(c,f[h],e[h],a)&&(d[e[h]]=f[h])}else for(d=[],h=0;h<g;h++)b.call(c,f[h],void 0,a)&&d.push(f[h]);return d};
|
|
goog.structs.map=function(a,b,c){if("function"==typeof a.map)return a.map(b,c);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.map(a,b,c);var d,e=goog.structs.getKeys(a),f=goog.structs.getValues(a),g=f.length;if(e){d={};for(var h=0;h<g;h++)d[e[h]]=b.call(c,f[h],e[h],a)}else for(d=[],h=0;h<g;h++)d[h]=b.call(c,f[h],void 0,a);return d};
|
|
goog.structs.some=function(a,b,c){if("function"==typeof a.some)return a.some(b,c);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.some(a,b,c);for(var d=goog.structs.getKeys(a),e=goog.structs.getValues(a),f=e.length,g=0;g<f;g++)if(b.call(c,e[g],d&&d[g],a))return!0;return!1};
|
|
goog.structs.every=function(a,b,c){if("function"==typeof a.every)return a.every(b,c);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.every(a,b,c);for(var d=goog.structs.getKeys(a),e=goog.structs.getValues(a),f=e.length,g=0;g<f;g++)if(!b.call(c,e[g],d&&d[g],a))return!1;return!0};goog.iter={};goog.iter.StopIteration="StopIteration"in goog.global?goog.global.StopIteration:Error("StopIteration");goog.iter.Iterator=function(){};goog.iter.Iterator.prototype.next=function(){throw goog.iter.StopIteration;};goog.iter.Iterator.prototype.__iterator__=function(a){return this};
|
|
goog.iter.toIterator=function(a){if(a instanceof goog.iter.Iterator)return a;if("function"==typeof a.__iterator__)return a.__iterator__(!1);if(goog.isArrayLike(a)){var b=0,c=new goog.iter.Iterator;c.next=function(){for(;;){if(b>=a.length)throw goog.iter.StopIteration;if(b in a)return a[b++];b++}};return c}throw Error("Not implemented");};
|
|
goog.iter.forEach=function(a,b,c){if(goog.isArrayLike(a))try{goog.array.forEach(a,b,c)}catch(d){if(d!==goog.iter.StopIteration)throw d;}else{a=goog.iter.toIterator(a);try{for(;;)b.call(c,a.next(),void 0,a)}catch(e){if(e!==goog.iter.StopIteration)throw e;}}};goog.iter.filter=function(a,b,c){var d=goog.iter.toIterator(a);a=new goog.iter.Iterator;a.next=function(){for(;;){var a=d.next();if(b.call(c,a,void 0,d))return a}};return a};
|
|
goog.iter.range=function(a,b,c){var d=0,e=a,f=c||1;1<arguments.length&&(d=a,e=b);if(0==f)throw Error("Range step argument must not be zero");var g=new goog.iter.Iterator;g.next=function(){if(0<f&&d>=e||0>f&&d<=e)throw goog.iter.StopIteration;var a=d;d+=f;return a};return g};goog.iter.join=function(a,b){return goog.iter.toArray(a).join(b)};goog.iter.map=function(a,b,c){var d=goog.iter.toIterator(a);a=new goog.iter.Iterator;a.next=function(){for(;;){var a=d.next();return b.call(c,a,void 0,d)}};return a};
|
|
goog.iter.reduce=function(a,b,c,d){var e=c;goog.iter.forEach(a,function(a){e=b.call(d,e,a)});return e};goog.iter.some=function(a,b,c){a=goog.iter.toIterator(a);try{for(;;)if(b.call(c,a.next(),void 0,a))return!0}catch(d){if(d!==goog.iter.StopIteration)throw d;}return!1};goog.iter.every=function(a,b,c){a=goog.iter.toIterator(a);try{for(;;)if(!b.call(c,a.next(),void 0,a))return!1}catch(d){if(d!==goog.iter.StopIteration)throw d;}return!0};
|
|
goog.iter.chain=function(a){var b=arguments,c=b.length,d=0,e=new goog.iter.Iterator;e.next=function(){try{if(d>=c)throw goog.iter.StopIteration;return goog.iter.toIterator(b[d]).next()}catch(a){if(a!==goog.iter.StopIteration||d>=c)throw a;d++;return this.next()}};return e};goog.iter.dropWhile=function(a,b,c){var d=goog.iter.toIterator(a);a=new goog.iter.Iterator;var e=!0;a.next=function(){for(;;){var a=d.next();if(!e||!b.call(c,a,void 0,d))return e=!1,a}};return a};
|
|
goog.iter.takeWhile=function(a,b,c){var d=goog.iter.toIterator(a);a=new goog.iter.Iterator;var e=!0;a.next=function(){for(;;)if(e){var a=d.next();if(b.call(c,a,void 0,d))return a;e=!1}else throw goog.iter.StopIteration;};return a};goog.iter.toArray=function(a){if(goog.isArrayLike(a))return goog.array.toArray(a);a=goog.iter.toIterator(a);var b=[];goog.iter.forEach(a,function(a){b.push(a)});return b};
|
|
goog.iter.equals=function(a,b){a=goog.iter.toIterator(a);b=goog.iter.toIterator(b);var c,d;try{for(;;){c=d=!1;var e=a.next();c=!0;var f=b.next();d=!0;if(e!=f)break}}catch(g){if(g!==goog.iter.StopIteration)throw g;if(c&&!d)return!1;if(!d)try{b.next()}catch(h){if(h!==goog.iter.StopIteration)throw h;return!0}}return!1};goog.iter.nextOrValue=function(a,b){try{return goog.iter.toIterator(a).next()}catch(c){if(c!=goog.iter.StopIteration)throw c;return b}};
|
|
goog.iter.product=function(a){if(goog.array.some(arguments,function(a){return!a.length})||!arguments.length)return new goog.iter.Iterator;var b=new goog.iter.Iterator,c=arguments,d=goog.array.repeat(0,c.length);b.next=function(){if(d){for(var a=goog.array.map(d,function(a,b){return c[b][a]}),b=d.length-1;0<=b;b--){if(d[b]<c[b].length-1){d[b]++;break}if(0==b){d=null;break}d[b]=0}return a}throw goog.iter.StopIteration;};return b};
|
|
goog.iter.cycle=function(a){var b=goog.iter.toIterator(a),c=[],d=0;a=new goog.iter.Iterator;var e=!1;a.next=function(){var a=null;if(!e)try{return a=b.next(),c.push(a),a}catch(g){if(g!=goog.iter.StopIteration||goog.array.isEmpty(c))throw g;e=!0}a=c[d];d=(d+1)%c.length;return a};return a};goog.structs.Map=function(a,b){this.map_={};this.keys_=[];var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.addAll(a)};goog.structs.Map.prototype.count_=0;goog.structs.Map.prototype.version_=0;goog.structs.Map.prototype.getCount=function(){return this.count_};
|
|
goog.structs.Map.prototype.getValues=function(){this.cleanupKeysArray_();for(var a=[],b=0;b<this.keys_.length;b++)a.push(this.map_[this.keys_[b]]);return a};goog.structs.Map.prototype.getKeys=function(){this.cleanupKeysArray_();return this.keys_.concat()};goog.structs.Map.prototype.containsKey=function(a){return goog.structs.Map.hasKey_(this.map_,a)};
|
|
goog.structs.Map.prototype.containsValue=function(a){for(var b=0;b<this.keys_.length;b++){var c=this.keys_[b];if(goog.structs.Map.hasKey_(this.map_,c)&&this.map_[c]==a)return!0}return!1};goog.structs.Map.prototype.equals=function(a,b){if(this===a)return!0;if(this.count_!=a.getCount())return!1;var c=b||goog.structs.Map.defaultEquals;this.cleanupKeysArray_();for(var d,e=0;d=this.keys_[e];e++)if(!c(this.get(d),a.get(d)))return!1;return!0};goog.structs.Map.defaultEquals=function(a,b){return a===b};
|
|
goog.structs.Map.prototype.isEmpty=function(){return 0==this.count_};goog.structs.Map.prototype.clear=function(){this.map_={};this.version_=this.count_=this.keys_.length=0};goog.structs.Map.prototype.remove=function(a){return goog.structs.Map.hasKey_(this.map_,a)?(delete this.map_[a],this.count_--,this.version_++,this.keys_.length>2*this.count_&&this.cleanupKeysArray_(),!0):!1};
|
|
goog.structs.Map.prototype.cleanupKeysArray_=function(){if(this.count_!=this.keys_.length){for(var a=0,b=0;a<this.keys_.length;){var c=this.keys_[a];goog.structs.Map.hasKey_(this.map_,c)&&(this.keys_[b++]=c);a++}this.keys_.length=b}if(this.count_!=this.keys_.length){for(var d={},b=a=0;a<this.keys_.length;)c=this.keys_[a],goog.structs.Map.hasKey_(d,c)||(this.keys_[b++]=c,d[c]=1),a++;this.keys_.length=b}};
|
|
goog.structs.Map.prototype.get=function(a,b){return goog.structs.Map.hasKey_(this.map_,a)?this.map_[a]:b};goog.structs.Map.prototype.set=function(a,b){goog.structs.Map.hasKey_(this.map_,a)||(this.count_++,this.keys_.push(a),this.version_++);this.map_[a]=b};goog.structs.Map.prototype.addAll=function(a){var b;a instanceof goog.structs.Map?(b=a.getKeys(),a=a.getValues()):(b=goog.object.getKeys(a),a=goog.object.getValues(a));for(var c=0;c<b.length;c++)this.set(b[c],a[c])};
|
|
goog.structs.Map.prototype.clone=function(){return new goog.structs.Map(this)};goog.structs.Map.prototype.transpose=function(){for(var a=new goog.structs.Map,b=0;b<this.keys_.length;b++){var c=this.keys_[b];a.set(this.map_[c],c)}return a};goog.structs.Map.prototype.toObject=function(){this.cleanupKeysArray_();for(var a={},b=0;b<this.keys_.length;b++){var c=this.keys_[b];a[c]=this.map_[c]}return a};goog.structs.Map.prototype.getKeyIterator=function(){return this.__iterator__(!0)};
|
|
goog.structs.Map.prototype.getValueIterator=function(){return this.__iterator__(!1)};goog.structs.Map.prototype.__iterator__=function(a){this.cleanupKeysArray_();var b=0,c=this.keys_,d=this.map_,e=this.version_,f=this,g=new goog.iter.Iterator;g.next=function(){for(;;){if(e!=f.version_)throw Error("The map has changed since the iterator was created");if(b>=c.length)throw goog.iter.StopIteration;var g=c[b++];return a?g:d[g]}};return g};
|
|
goog.structs.Map.hasKey_=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};goog.uri={};goog.uri.utils={};goog.uri.utils.CharCode_={AMPERSAND:38,EQUAL:61,HASH:35,QUESTION:63};goog.uri.utils.buildFromEncodedParts=function(a,b,c,d,e,f,g){var h="";a&&(h+=a+":");c&&(h+="//",b&&(h+=b+"@"),h+=c,d&&(h+=":"+d));e&&(h+=e);f&&(h+="?"+f);g&&(h+="#"+g);return h};goog.uri.utils.splitRe_=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?\x3d[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");
|
|
goog.uri.utils.ComponentIndex={SCHEME:1,USER_INFO:2,DOMAIN:3,PORT:4,PATH:5,QUERY_DATA:6,FRAGMENT:7};goog.uri.utils.split=function(a){goog.uri.utils.phishingProtection_();return a.match(goog.uri.utils.splitRe_)};goog.uri.utils.needsPhishingProtection_=goog.userAgent.WEBKIT;
|
|
goog.uri.utils.phishingProtection_=function(){if(goog.uri.utils.needsPhishingProtection_){goog.uri.utils.needsPhishingProtection_=!1;var a=goog.global.location;if(a){var b=a.href;if(b&&(b=goog.uri.utils.getDomain(b))&&b!=a.hostname)throw goog.uri.utils.needsPhishingProtection_=!0,Error();}}};goog.uri.utils.decodeIfPossible_=function(a){return a&&decodeURIComponent(a)};goog.uri.utils.getComponentByIndex_=function(a,b){return goog.uri.utils.split(b)[a]||null};
|
|
goog.uri.utils.getScheme=function(a){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.SCHEME,a)};goog.uri.utils.getEffectiveScheme=function(a){a=goog.uri.utils.getScheme(a);!a&&self.location&&(a=self.location.protocol,a=a.substr(0,a.length-1));return a?a.toLowerCase():""};goog.uri.utils.getUserInfoEncoded=function(a){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.USER_INFO,a)};goog.uri.utils.getUserInfo=function(a){return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getUserInfoEncoded(a))};
|
|
goog.uri.utils.getDomainEncoded=function(a){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.DOMAIN,a)};goog.uri.utils.getDomain=function(a){return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getDomainEncoded(a))};goog.uri.utils.getPort=function(a){return Number(goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PORT,a))||null};goog.uri.utils.getPathEncoded=function(a){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PATH,a)};
|
|
goog.uri.utils.getPath=function(a){return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getPathEncoded(a))};goog.uri.utils.getQueryData=function(a){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.QUERY_DATA,a)};goog.uri.utils.getFragmentEncoded=function(a){var b=a.indexOf("#");return 0>b?null:a.substr(b+1)};goog.uri.utils.setFragmentEncoded=function(a,b){return goog.uri.utils.removeFragment(a)+(b?"#"+b:"")};goog.uri.utils.getFragment=function(a){return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getFragmentEncoded(a))};
|
|
goog.uri.utils.getHost=function(a){a=goog.uri.utils.split(a);return goog.uri.utils.buildFromEncodedParts(a[goog.uri.utils.ComponentIndex.SCHEME],a[goog.uri.utils.ComponentIndex.USER_INFO],a[goog.uri.utils.ComponentIndex.DOMAIN],a[goog.uri.utils.ComponentIndex.PORT])};goog.uri.utils.getPathAndAfter=function(a){a=goog.uri.utils.split(a);return goog.uri.utils.buildFromEncodedParts(null,null,null,null,a[goog.uri.utils.ComponentIndex.PATH],a[goog.uri.utils.ComponentIndex.QUERY_DATA],a[goog.uri.utils.ComponentIndex.FRAGMENT])};
|
|
goog.uri.utils.removeFragment=function(a){var b=a.indexOf("#");return 0>b?a:a.substr(0,b)};goog.uri.utils.haveSameDomain=function(a,b){var c=goog.uri.utils.split(a),d=goog.uri.utils.split(b);return c[goog.uri.utils.ComponentIndex.DOMAIN]==d[goog.uri.utils.ComponentIndex.DOMAIN]&&c[goog.uri.utils.ComponentIndex.SCHEME]==d[goog.uri.utils.ComponentIndex.SCHEME]&&c[goog.uri.utils.ComponentIndex.PORT]==d[goog.uri.utils.ComponentIndex.PORT]};
|
|
goog.uri.utils.assertNoFragmentsOrQueries_=function(a){if(goog.DEBUG&&(0<=a.indexOf("#")||0<=a.indexOf("?")))throw Error("goog.uri.utils: Fragment or query identifiers are not supported: ["+a+"]");};goog.uri.utils.appendQueryData_=function(a){if(a[1]){var b=a[0],c=b.indexOf("#");0<=c&&(a.push(b.substr(c)),a[0]=b=b.substr(0,c));c=b.indexOf("?");0>c?a[1]="?":c==b.length-1&&(a[1]=void 0)}return a.join("")};
|
|
goog.uri.utils.appendKeyValuePairs_=function(a,b,c){if(goog.isArray(b))for(var d=0;d<b.length;d++)goog.uri.utils.appendKeyValuePairs_(a,String(b[d]),c);else null!=b&&c.push("\x26",a,""===b?"":"\x3d",goog.string.urlEncode(b))};goog.uri.utils.buildQueryDataBuffer_=function(a,b,c){for(c=c||0;c<b.length;c+=2)goog.uri.utils.appendKeyValuePairs_(b[c],b[c+1],a);return a};goog.uri.utils.buildQueryData=function(a,b){var c=goog.uri.utils.buildQueryDataBuffer_([],a,b);c[0]="";return c.join("")};
|
|
goog.uri.utils.buildQueryDataBufferFromMap_=function(a,b){for(var c in b)goog.uri.utils.appendKeyValuePairs_(c,b[c],a);return a};goog.uri.utils.buildQueryDataFromMap=function(a){a=goog.uri.utils.buildQueryDataBufferFromMap_([],a);a[0]="";return a.join("")};goog.uri.utils.appendParams=function(a,b){return goog.uri.utils.appendQueryData_(2==arguments.length?goog.uri.utils.buildQueryDataBuffer_([a],arguments[1],0):goog.uri.utils.buildQueryDataBuffer_([a],arguments,1))};
|
|
goog.uri.utils.appendParamsFromMap=function(a,b){return goog.uri.utils.appendQueryData_(goog.uri.utils.buildQueryDataBufferFromMap_([a],b))};goog.uri.utils.appendParam=function(a,b,c){a=[a,"\x26",b];goog.isDefAndNotNull(c)&&a.push("\x3d",goog.string.urlEncode(c));return goog.uri.utils.appendQueryData_(a)};
|
|
goog.uri.utils.findParam_=function(a,b,c,d){for(var e=c.length;0<=(b=a.indexOf(c,b))&&b<d;){var f=a.charCodeAt(b-1);if(f==goog.uri.utils.CharCode_.AMPERSAND||f==goog.uri.utils.CharCode_.QUESTION)if(f=a.charCodeAt(b+e),!f||f==goog.uri.utils.CharCode_.EQUAL||f==goog.uri.utils.CharCode_.AMPERSAND||f==goog.uri.utils.CharCode_.HASH)return b;b+=e+1}return-1};goog.uri.utils.hashOrEndRe_=/#|$/;goog.uri.utils.hasParam=function(a,b){return 0<=goog.uri.utils.findParam_(a,0,b,a.search(goog.uri.utils.hashOrEndRe_))};
|
|
goog.uri.utils.getParamValue=function(a,b){var c=a.search(goog.uri.utils.hashOrEndRe_),d=goog.uri.utils.findParam_(a,0,b,c);if(0>d)return null;var e=a.indexOf("\x26",d);if(0>e||e>c)e=c;d+=b.length+1;return goog.string.urlDecode(a.substr(d,e-d))};goog.uri.utils.getParamValues=function(a,b){for(var c=a.search(goog.uri.utils.hashOrEndRe_),d=0,e,f=[];0<=(e=goog.uri.utils.findParam_(a,d,b,c));){d=a.indexOf("\x26",e);if(0>d||d>c)d=c;e+=b.length+1;f.push(goog.string.urlDecode(a.substr(e,d-e)))}return f};
|
|
goog.uri.utils.trailingQueryPunctuationRe_=/[?&]($|#)/;goog.uri.utils.removeParam=function(a,b){for(var c=a.search(goog.uri.utils.hashOrEndRe_),d=0,e,f=[];0<=(e=goog.uri.utils.findParam_(a,d,b,c));)f.push(a.substring(d,e)),d=Math.min(a.indexOf("\x26",e)+1||c,c);f.push(a.substr(d));return f.join("").replace(goog.uri.utils.trailingQueryPunctuationRe_,"$1")};goog.uri.utils.setParam=function(a,b,c){return goog.uri.utils.appendParam(goog.uri.utils.removeParam(a,b),b,c)};
|
|
goog.uri.utils.appendPath=function(a,b){goog.uri.utils.assertNoFragmentsOrQueries_(a);goog.string.endsWith(a,"/")&&(a=a.substr(0,a.length-1));goog.string.startsWith(b,"/")&&(b=b.substr(1));return goog.string.buildString(a,"/",b)};goog.uri.utils.StandardQueryParam={RANDOM:"zx"};goog.uri.utils.makeUnique=function(a){return goog.uri.utils.setParam(a,goog.uri.utils.StandardQueryParam.RANDOM,goog.string.getRandomString())};goog.Uri=function(a,b){var c;a instanceof goog.Uri?(this.ignoreCase_=goog.isDef(b)?b:a.getIgnoreCase(),this.setScheme(a.getScheme()),this.setUserInfo(a.getUserInfo()),this.setDomain(a.getDomain()),this.setPort(a.getPort()),this.setPath(a.getPath()),this.setQueryData(a.getQueryData().clone()),this.setFragment(a.getFragment())):a&&(c=goog.uri.utils.split(String(a)))?(this.ignoreCase_=!!b,this.setScheme(c[goog.uri.utils.ComponentIndex.SCHEME]||"",!0),this.setUserInfo(c[goog.uri.utils.ComponentIndex.USER_INFO]||
|
|
"",!0),this.setDomain(c[goog.uri.utils.ComponentIndex.DOMAIN]||"",!0),this.setPort(c[goog.uri.utils.ComponentIndex.PORT]),this.setPath(c[goog.uri.utils.ComponentIndex.PATH]||"",!0),this.setQueryData(c[goog.uri.utils.ComponentIndex.QUERY_DATA]||"",!0),this.setFragment(c[goog.uri.utils.ComponentIndex.FRAGMENT]||"",!0)):(this.ignoreCase_=!!b,this.queryData_=new goog.Uri.QueryData(null,null,this.ignoreCase_))};goog.Uri.preserveParameterTypesCompatibilityFlag=!1;goog.Uri.RANDOM_PARAM=goog.uri.utils.StandardQueryParam.RANDOM;
|
|
goog.Uri.prototype.scheme_="";goog.Uri.prototype.userInfo_="";goog.Uri.prototype.domain_="";goog.Uri.prototype.port_=null;goog.Uri.prototype.path_="";goog.Uri.prototype.fragment_="";goog.Uri.prototype.isReadOnly_=!1;goog.Uri.prototype.ignoreCase_=!1;
|
|
goog.Uri.prototype.toString=function(){var a=[],b=this.getScheme();b&&a.push(goog.Uri.encodeSpecialChars_(b,goog.Uri.reDisallowedInSchemeOrUserInfo_),":");if(b=this.getDomain()){a.push("//");var c=this.getUserInfo();c&&a.push(goog.Uri.encodeSpecialChars_(c,goog.Uri.reDisallowedInSchemeOrUserInfo_),"@");a.push(goog.string.urlEncode(b));b=this.getPort();null!=b&&a.push(":",String(b))}if(b=this.getPath())this.hasDomain()&&"/"!=b.charAt(0)&&a.push("/"),a.push(goog.Uri.encodeSpecialChars_(b,"/"==b.charAt(0)?
|
|
goog.Uri.reDisallowedInAbsolutePath_:goog.Uri.reDisallowedInRelativePath_));(b=this.getEncodedQuery())&&a.push("?",b);(b=this.getFragment())&&a.push("#",goog.Uri.encodeSpecialChars_(b,goog.Uri.reDisallowedInFragment_));return a.join("")};
|
|
goog.Uri.prototype.resolve=function(a){var b=this.clone(),c=a.hasScheme();c?b.setScheme(a.getScheme()):c=a.hasUserInfo();c?b.setUserInfo(a.getUserInfo()):c=a.hasDomain();c?b.setDomain(a.getDomain()):c=a.hasPort();var d=a.getPath();if(c)b.setPort(a.getPort());else if(c=a.hasPath()){if("/"!=d.charAt(0))if(this.hasDomain()&&!this.hasPath())d="/"+d;else{var e=b.getPath().lastIndexOf("/");-1!=e&&(d=b.getPath().substr(0,e+1)+d)}d=goog.Uri.removeDotSegments(d)}c?b.setPath(d):c=a.hasQuery();c?b.setQueryData(a.getDecodedQuery()):
|
|
c=a.hasFragment();c&&b.setFragment(a.getFragment());return b};goog.Uri.prototype.clone=function(){return new goog.Uri(this)};goog.Uri.prototype.getScheme=function(){return this.scheme_};goog.Uri.prototype.setScheme=function(a,b){this.enforceReadOnly();if(this.scheme_=b?goog.Uri.decodeOrEmpty_(a):a)this.scheme_=this.scheme_.replace(/:$/,"");return this};goog.Uri.prototype.hasScheme=function(){return!!this.scheme_};goog.Uri.prototype.getUserInfo=function(){return this.userInfo_};
|
|
goog.Uri.prototype.setUserInfo=function(a,b){this.enforceReadOnly();this.userInfo_=b?goog.Uri.decodeOrEmpty_(a):a;return this};goog.Uri.prototype.hasUserInfo=function(){return!!this.userInfo_};goog.Uri.prototype.getDomain=function(){return this.domain_};goog.Uri.prototype.setDomain=function(a,b){this.enforceReadOnly();this.domain_=b?goog.Uri.decodeOrEmpty_(a):a;return this};goog.Uri.prototype.hasDomain=function(){return!!this.domain_};goog.Uri.prototype.getPort=function(){return this.port_};
|
|
goog.Uri.prototype.setPort=function(a){this.enforceReadOnly();if(a){a=Number(a);if(isNaN(a)||0>a)throw Error("Bad port number "+a);this.port_=a}else this.port_=null;return this};goog.Uri.prototype.hasPort=function(){return null!=this.port_};goog.Uri.prototype.getPath=function(){return this.path_};goog.Uri.prototype.setPath=function(a,b){this.enforceReadOnly();this.path_=b?goog.Uri.decodeOrEmpty_(a):a;return this};goog.Uri.prototype.hasPath=function(){return!!this.path_};
|
|
goog.Uri.prototype.hasQuery=function(){return""!==this.queryData_.toString()};goog.Uri.prototype.setQueryData=function(a,b){this.enforceReadOnly();a instanceof goog.Uri.QueryData?(this.queryData_=a,this.queryData_.setIgnoreCase(this.ignoreCase_)):(b||(a=goog.Uri.encodeSpecialChars_(a,goog.Uri.reDisallowedInQuery_)),this.queryData_=new goog.Uri.QueryData(a,null,this.ignoreCase_));return this};goog.Uri.prototype.setQuery=function(a,b){return this.setQueryData(a,b)};
|
|
goog.Uri.prototype.getEncodedQuery=function(){return this.queryData_.toString()};goog.Uri.prototype.getDecodedQuery=function(){return this.queryData_.toDecodedString()};goog.Uri.prototype.getQueryData=function(){return this.queryData_};goog.Uri.prototype.getQuery=function(){return this.getEncodedQuery()};goog.Uri.prototype.setParameterValue=function(a,b){this.enforceReadOnly();this.queryData_.set(a,b);return this};
|
|
goog.Uri.prototype.setParameterValues=function(a,b){this.enforceReadOnly();goog.isArray(b)||(b=[String(b)]);this.queryData_.setValues(a,b);return this};goog.Uri.prototype.getParameterValues=function(a){return this.queryData_.getValues(a)};goog.Uri.prototype.getParameterValue=function(a){return this.queryData_.get(a)};goog.Uri.prototype.getFragment=function(){return this.fragment_};goog.Uri.prototype.setFragment=function(a,b){this.enforceReadOnly();this.fragment_=b?goog.Uri.decodeOrEmpty_(a):a;return this};
|
|
goog.Uri.prototype.hasFragment=function(){return!!this.fragment_};goog.Uri.prototype.hasSameDomainAs=function(a){return(!this.hasDomain()&&!a.hasDomain()||this.getDomain()==a.getDomain())&&(!this.hasPort()&&!a.hasPort()||this.getPort()==a.getPort())};goog.Uri.prototype.makeUnique=function(){this.enforceReadOnly();this.setParameterValue(goog.Uri.RANDOM_PARAM,goog.string.getRandomString());return this};goog.Uri.prototype.removeParameter=function(a){this.enforceReadOnly();this.queryData_.remove(a);return this};
|
|
goog.Uri.prototype.setReadOnly=function(a){this.isReadOnly_=a;return this};goog.Uri.prototype.isReadOnly=function(){return this.isReadOnly_};goog.Uri.prototype.enforceReadOnly=function(){if(this.isReadOnly_)throw Error("Tried to modify a read-only Uri");};goog.Uri.prototype.setIgnoreCase=function(a){this.ignoreCase_=a;this.queryData_&&this.queryData_.setIgnoreCase(a);return this};goog.Uri.prototype.getIgnoreCase=function(){return this.ignoreCase_};
|
|
goog.Uri.parse=function(a,b){return a instanceof goog.Uri?a.clone():new goog.Uri(a,b)};goog.Uri.create=function(a,b,c,d,e,f,g,h){h=new goog.Uri(null,h);a&&h.setScheme(a);b&&h.setUserInfo(b);c&&h.setDomain(c);d&&h.setPort(d);e&&h.setPath(e);f&&h.setQueryData(f);g&&h.setFragment(g);return h};goog.Uri.resolve=function(a,b){a instanceof goog.Uri||(a=goog.Uri.parse(a));b instanceof goog.Uri||(b=goog.Uri.parse(b));return a.resolve(b)};
|
|
goog.Uri.removeDotSegments=function(a){if(".."==a||"."==a)return"";if(goog.string.contains(a,"./")||goog.string.contains(a,"/.")){var b=goog.string.startsWith(a,"/");a=a.split("/");for(var c=[],d=0;d<a.length;){var e=a[d++];"."==e?b&&d==a.length&&c.push(""):".."==e?((1<c.length||1==c.length&&""!=c[0])&&c.pop(),b&&d==a.length&&c.push("")):(c.push(e),b=!0)}return c.join("/")}return a};goog.Uri.decodeOrEmpty_=function(a){return a?decodeURIComponent(a):""};
|
|
goog.Uri.encodeSpecialChars_=function(a,b){return goog.isString(a)?encodeURI(a).replace(b,goog.Uri.encodeChar_):null};goog.Uri.encodeChar_=function(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)};goog.Uri.reDisallowedInSchemeOrUserInfo_=/[#\/\?@]/g;goog.Uri.reDisallowedInRelativePath_=/[\#\?:]/g;goog.Uri.reDisallowedInAbsolutePath_=/[\#\?]/g;goog.Uri.reDisallowedInQuery_=/[\#\?@]/g;goog.Uri.reDisallowedInFragment_=/#/g;
|
|
goog.Uri.haveSameDomain=function(a,b){var c=goog.uri.utils.split(a),d=goog.uri.utils.split(b);return c[goog.uri.utils.ComponentIndex.DOMAIN]==d[goog.uri.utils.ComponentIndex.DOMAIN]&&c[goog.uri.utils.ComponentIndex.PORT]==d[goog.uri.utils.ComponentIndex.PORT]};goog.Uri.QueryData=function(a,b,c){this.encodedQuery_=a||null;this.ignoreCase_=!!c};
|
|
goog.Uri.QueryData.prototype.ensureKeyMapInitialized_=function(){if(!this.keyMap_&&(this.keyMap_=new goog.structs.Map,this.count_=0,this.encodedQuery_))for(var a=this.encodedQuery_.split("\x26"),b=0;b<a.length;b++){var c=a[b].indexOf("\x3d"),d=null,e=null;0<=c?(d=a[b].substring(0,c),e=a[b].substring(c+1)):d=a[b];d=goog.string.urlDecode(d);d=this.getKeyName_(d);this.add(d,e?goog.string.urlDecode(e):"")}};
|
|
goog.Uri.QueryData.createFromMap=function(a,b,c){b=goog.structs.getKeys(a);if("undefined"==typeof b)throw Error("Keys are undefined");c=new goog.Uri.QueryData(null,null,c);a=goog.structs.getValues(a);for(var d=0;d<b.length;d++){var e=b[d],f=a[d];goog.isArray(f)?c.setValues(e,f):c.add(e,f)}return c};
|
|
goog.Uri.QueryData.createFromKeysValues=function(a,b,c,d){if(a.length!=b.length)throw Error("Mismatched lengths for keys/values");c=new goog.Uri.QueryData(null,null,d);for(d=0;d<a.length;d++)c.add(a[d],b[d]);return c};goog.Uri.QueryData.prototype.keyMap_=null;goog.Uri.QueryData.prototype.count_=null;goog.Uri.QueryData.prototype.getCount=function(){this.ensureKeyMapInitialized_();return this.count_};
|
|
goog.Uri.QueryData.prototype.add=function(a,b){this.ensureKeyMapInitialized_();this.invalidateCache_();a=this.getKeyName_(a);var c=this.keyMap_.get(a);c||this.keyMap_.set(a,c=[]);c.push(b);this.count_++;return this};goog.Uri.QueryData.prototype.remove=function(a){this.ensureKeyMapInitialized_();a=this.getKeyName_(a);return this.keyMap_.containsKey(a)?(this.invalidateCache_(),this.count_-=this.keyMap_.get(a).length,this.keyMap_.remove(a)):!1};
|
|
goog.Uri.QueryData.prototype.clear=function(){this.invalidateCache_();this.keyMap_=null;this.count_=0};goog.Uri.QueryData.prototype.isEmpty=function(){this.ensureKeyMapInitialized_();return 0==this.count_};goog.Uri.QueryData.prototype.containsKey=function(a){this.ensureKeyMapInitialized_();a=this.getKeyName_(a);return this.keyMap_.containsKey(a)};goog.Uri.QueryData.prototype.containsValue=function(a){var b=this.getValues();return goog.array.contains(b,a)};
|
|
goog.Uri.QueryData.prototype.getKeys=function(){this.ensureKeyMapInitialized_();for(var a=this.keyMap_.getValues(),b=this.keyMap_.getKeys(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};goog.Uri.QueryData.prototype.getValues=function(a){this.ensureKeyMapInitialized_();var b=[];if(a)this.containsKey(a)&&(b=goog.array.concat(b,this.keyMap_.get(this.getKeyName_(a))));else{a=this.keyMap_.getValues();for(var c=0;c<a.length;c++)b=goog.array.concat(b,a[c])}return b};
|
|
goog.Uri.QueryData.prototype.set=function(a,b){this.ensureKeyMapInitialized_();this.invalidateCache_();a=this.getKeyName_(a);this.containsKey(a)&&(this.count_-=this.keyMap_.get(a).length);this.keyMap_.set(a,[b]);this.count_++;return this};goog.Uri.QueryData.prototype.get=function(a,b){var c=a?this.getValues(a):[];return goog.Uri.preserveParameterTypesCompatibilityFlag?0<c.length?c[0]:b:0<c.length?String(c[0]):b};
|
|
goog.Uri.QueryData.prototype.setValues=function(a,b){this.remove(a);0<b.length&&(this.invalidateCache_(),this.keyMap_.set(this.getKeyName_(a),goog.array.clone(b)),this.count_+=b.length)};
|
|
goog.Uri.QueryData.prototype.toString=function(){if(this.encodedQuery_)return this.encodedQuery_;if(!this.keyMap_)return"";for(var a=[],b=this.keyMap_.getKeys(),c=0;c<b.length;c++)for(var d=b[c],e=goog.string.urlEncode(d),d=this.getValues(d),f=0;f<d.length;f++){var g=e;""!==d[f]&&(g+="\x3d"+goog.string.urlEncode(d[f]));a.push(g)}return this.encodedQuery_=a.join("\x26")};goog.Uri.QueryData.prototype.toDecodedString=function(){return goog.Uri.decodeOrEmpty_(this.toString())};
|
|
goog.Uri.QueryData.prototype.invalidateCache_=function(){this.encodedQuery_=null};goog.Uri.QueryData.prototype.filterKeys=function(a){this.ensureKeyMapInitialized_();goog.structs.forEach(this.keyMap_,function(b,c,d){goog.array.contains(a,c)||this.remove(c)},this);return this};goog.Uri.QueryData.prototype.clone=function(){var a=new goog.Uri.QueryData;a.encodedQuery_=this.encodedQuery_;this.keyMap_&&(a.keyMap_=this.keyMap_.clone(),a.count_=this.count_);return a};
|
|
goog.Uri.QueryData.prototype.getKeyName_=function(a){a=String(a);this.ignoreCase_&&(a=a.toLowerCase());return a};goog.Uri.QueryData.prototype.setIgnoreCase=function(a){a&&!this.ignoreCase_&&(this.ensureKeyMapInitialized_(),this.invalidateCache_(),goog.structs.forEach(this.keyMap_,function(a,c){var d=c.toLowerCase();c!=d&&(this.remove(c),this.setValues(d,a))},this));this.ignoreCase_=a};
|
|
goog.Uri.QueryData.prototype.extend=function(a){for(var b=0;b<arguments.length;b++)goog.structs.forEach(arguments[b],function(a,b){this.add(b,a)},this)};goog.async={};goog.async.AnimationDelay=function(a,b,c){goog.Disposable.call(this);this.listener_=a;this.handler_=c;this.win_=b||window;this.callback_=goog.bind(this.doAction_,this)};goog.inherits(goog.async.AnimationDelay,goog.Disposable);goog.async.AnimationDelay.prototype.id_=null;goog.async.AnimationDelay.prototype.usingListeners_=!1;goog.async.AnimationDelay.TIMEOUT=20;goog.async.AnimationDelay.MOZ_BEFORE_PAINT_EVENT_="MozBeforePaint";
|
|
goog.async.AnimationDelay.prototype.start=function(){this.stop();this.usingListeners_=!1;var a=this.getRaf_(),b=this.getCancelRaf_();a&&!b&&this.win_.mozRequestAnimationFrame?(this.id_=goog.events.listen(this.win_,goog.async.AnimationDelay.MOZ_BEFORE_PAINT_EVENT_,this.callback_),this.win_.mozRequestAnimationFrame(null),this.usingListeners_=!0):this.id_=a&&b?a.call(this.win_,this.callback_):this.win_.setTimeout(goog.functions.lock(this.callback_),goog.async.AnimationDelay.TIMEOUT)};
|
|
goog.async.AnimationDelay.prototype.stop=function(){if(this.isActive()){var a=this.getRaf_(),b=this.getCancelRaf_();a&&!b&&this.win_.mozRequestAnimationFrame?goog.events.unlistenByKey(this.id_):a&&b?b.call(this.win_,this.id_):this.win_.clearTimeout(this.id_)}this.id_=null};goog.async.AnimationDelay.prototype.fire=function(){this.stop();this.doAction_()};goog.async.AnimationDelay.prototype.fireIfActive=function(){this.isActive()&&this.fire()};
|
|
goog.async.AnimationDelay.prototype.isActive=function(){return null!=this.id_};goog.async.AnimationDelay.prototype.doAction_=function(){this.usingListeners_&&this.id_&&goog.events.unlistenByKey(this.id_);this.id_=null;this.listener_.call(this.handler_,goog.now())};goog.async.AnimationDelay.prototype.disposeInternal=function(){this.stop();goog.async.AnimationDelay.superClass_.disposeInternal.call(this)};
|
|
goog.async.AnimationDelay.prototype.getRaf_=function(){var a=this.win_;return a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||null};goog.async.AnimationDelay.prototype.getCancelRaf_=function(){var a=this.win_;return a.cancelRequestAnimationFrame||a.webkitCancelRequestAnimationFrame||a.mozCancelRequestAnimationFrame||a.oCancelRequestAnimationFrame||a.msCancelRequestAnimationFrame||null};goog.async.nextTick=function(a,b){var c=a;b&&(c=goog.bind(a,b));c=goog.async.nextTick.wrapCallback_(c);goog.isFunction(goog.global.setImmediate)?goog.global.setImmediate(c):(goog.async.nextTick.setImmediate_||(goog.async.nextTick.setImmediate_=goog.async.nextTick.getSetImmediateEmulator_()),goog.async.nextTick.setImmediate_(c))};
|
|
goog.async.nextTick.getSetImmediateEmulator_=function(){var a=goog.global.MessageChannel;"undefined"===typeof a&&("undefined"!==typeof window&&window.postMessage&&window.addEventListener)&&(a=function(){var a=document.createElement("iframe");a.style.display="none";a.src="";document.body.appendChild(a);var b=a.contentWindow,a=b.document;a.open();a.write("");a.close();var c="callImmediate"+Math.random(),d=b.location.protocol+"//"+b.location.host,a=goog.bind(function(a){if(a.origin==d||a.data==c)this.port1.onmessage()},
|
|
this);b.addEventListener("message",a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,d)}}});if("undefined"!==typeof a){var b=new a,c={},d=c;b.port1.onmessage=function(){c=c.next;var a=c.cb;c.cb=null;a()};return function(a){d.next={cb:a};d=d.next;b.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("script")?function(a){var b=document.createElement("script");b.onreadystatechange=function(){b.onreadystatechange=null;b.parentNode.removeChild(b);
|
|
b=null;a();a=null};document.documentElement.appendChild(b)}:function(a){goog.global.setTimeout(a,0)}};goog.async.nextTick.wrapCallback_=goog.functions.identity;goog.structs.Collection=function(){};goog.structs.Set=function(a){this.map_=new goog.structs.Map;a&&this.addAll(a)};goog.structs.Set.getKey_=function(a){var b=typeof a;return"object"==b&&a||"function"==b?"o"+goog.getUid(a):b.substr(0,1)+a};goog.structs.Set.prototype.getCount=function(){return this.map_.getCount()};goog.structs.Set.prototype.add=function(a){this.map_.set(goog.structs.Set.getKey_(a),a)};goog.structs.Set.prototype.addAll=function(a){a=goog.structs.getValues(a);for(var b=a.length,c=0;c<b;c++)this.add(a[c])};
|
|
goog.structs.Set.prototype.removeAll=function(a){a=goog.structs.getValues(a);for(var b=a.length,c=0;c<b;c++)this.remove(a[c])};goog.structs.Set.prototype.remove=function(a){return this.map_.remove(goog.structs.Set.getKey_(a))};goog.structs.Set.prototype.clear=function(){this.map_.clear()};goog.structs.Set.prototype.isEmpty=function(){return this.map_.isEmpty()};goog.structs.Set.prototype.contains=function(a){return this.map_.containsKey(goog.structs.Set.getKey_(a))};
|
|
goog.structs.Set.prototype.containsAll=function(a){return goog.structs.every(a,this.contains,this)};goog.structs.Set.prototype.intersection=function(a){var b=new goog.structs.Set;a=goog.structs.getValues(a);for(var c=0;c<a.length;c++){var d=a[c];this.contains(d)&&b.add(d)}return b};goog.structs.Set.prototype.difference=function(a){var b=this.clone();b.removeAll(a);return b};goog.structs.Set.prototype.getValues=function(){return this.map_.getValues()};goog.structs.Set.prototype.clone=function(){return new goog.structs.Set(this)};
|
|
goog.structs.Set.prototype.equals=function(a){return this.getCount()==goog.structs.getCount(a)&&this.isSubsetOf(a)};goog.structs.Set.prototype.isSubsetOf=function(a){var b=goog.structs.getCount(a);if(this.getCount()>b)return!1;!(a instanceof goog.structs.Set)&&5<b&&(a=new goog.structs.Set(a));return goog.structs.every(this,function(b){return goog.structs.contains(a,b)})};goog.structs.Set.prototype.__iterator__=function(a){return this.map_.__iterator__(!1)};goog.debug.LOGGING_ENABLED=goog.DEBUG;goog.debug.MAX_STACK_DEPTH=50;goog.debug.setFunctionResolver=function(a){goog.debug.fnNameResolver_=a};goog.debug.fnNameCache_={};goog.dom.ViewportSizeMonitor=function(a){goog.events.EventTarget.call(this);this.window_=a||window;this.listenerKey_=goog.events.listen(this.window_,goog.events.EventType.RESIZE,this.handleResize_,!1,this);this.size_=goog.dom.getViewportSize(this.window_)};goog.inherits(goog.dom.ViewportSizeMonitor,goog.events.EventTarget);
|
|
goog.dom.ViewportSizeMonitor.getInstanceForWindow=function(a){a=a||window;var b=goog.getUid(a);return goog.dom.ViewportSizeMonitor.windowInstanceMap_[b]=goog.dom.ViewportSizeMonitor.windowInstanceMap_[b]||new goog.dom.ViewportSizeMonitor(a)};goog.dom.ViewportSizeMonitor.removeInstanceForWindow=function(a){a=goog.getUid(a||window);goog.dispose(goog.dom.ViewportSizeMonitor.windowInstanceMap_[a]);delete goog.dom.ViewportSizeMonitor.windowInstanceMap_[a]};
|
|
goog.dom.ViewportSizeMonitor.windowInstanceMap_={};goog.dom.ViewportSizeMonitor.prototype.listenerKey_=null;goog.dom.ViewportSizeMonitor.prototype.window_=null;goog.dom.ViewportSizeMonitor.prototype.size_=null;goog.dom.ViewportSizeMonitor.prototype.getSize=function(){return this.size_?this.size_.clone():null};
|
|
goog.dom.ViewportSizeMonitor.prototype.disposeInternal=function(){goog.dom.ViewportSizeMonitor.superClass_.disposeInternal.call(this);this.listenerKey_&&(goog.events.unlistenByKey(this.listenerKey_),this.listenerKey_=null);this.size_=this.window_=null};goog.dom.ViewportSizeMonitor.prototype.handleResize_=function(a){a=goog.dom.getViewportSize(this.window_);goog.math.Size.equals(a,this.size_)||(this.size_=a,this.dispatchEvent(goog.events.EventType.RESIZE))};goog.events.KeyCodes={WIN_KEY_FF_LINUX:0,MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,FF_SEMICOLON:59,FF_EQUALS:61,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,
|
|
X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SCROLL_LOCK:145,FIRST_MEDIA_KEY:166,LAST_MEDIA_KEY:183,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,TILDE:192,
|
|
SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,PHANTOM:255};
|
|
goog.events.KeyCodes.isTextModifyingKeyEvent=function(a){if(a.altKey&&!a.ctrlKey||a.metaKey||a.keyCode>=goog.events.KeyCodes.F1&&a.keyCode<=goog.events.KeyCodes.F12)return!1;switch(a.keyCode){case goog.events.KeyCodes.ALT:case goog.events.KeyCodes.CAPS_LOCK:case goog.events.KeyCodes.CONTEXT_MENU:case goog.events.KeyCodes.CTRL:case goog.events.KeyCodes.DOWN:case goog.events.KeyCodes.END:case goog.events.KeyCodes.ESC:case goog.events.KeyCodes.HOME:case goog.events.KeyCodes.INSERT:case goog.events.KeyCodes.LEFT:case goog.events.KeyCodes.MAC_FF_META:case goog.events.KeyCodes.META:case goog.events.KeyCodes.NUMLOCK:case goog.events.KeyCodes.NUM_CENTER:case goog.events.KeyCodes.PAGE_DOWN:case goog.events.KeyCodes.PAGE_UP:case goog.events.KeyCodes.PAUSE:case goog.events.KeyCodes.PHANTOM:case goog.events.KeyCodes.PRINT_SCREEN:case goog.events.KeyCodes.RIGHT:case goog.events.KeyCodes.SCROLL_LOCK:case goog.events.KeyCodes.SHIFT:case goog.events.KeyCodes.UP:case goog.events.KeyCodes.WIN_KEY:case goog.events.KeyCodes.WIN_KEY_RIGHT:return!1;case goog.events.KeyCodes.WIN_KEY_FF_LINUX:return!goog.userAgent.GECKO;
|
|
default:return a.keyCode<goog.events.KeyCodes.FIRST_MEDIA_KEY||a.keyCode>goog.events.KeyCodes.LAST_MEDIA_KEY}};
|
|
goog.events.KeyCodes.firesKeyPressEvent=function(a,b,c,d,e){if(!(goog.userAgent.IE||goog.userAgent.WEBKIT&&goog.userAgent.isVersionOrHigher("525")))return!0;if(goog.userAgent.MAC&&e)return goog.events.KeyCodes.isCharacterKey(a);if(e&&!d||!c&&(b==goog.events.KeyCodes.CTRL||b==goog.events.KeyCodes.ALT||goog.userAgent.MAC&&b==goog.events.KeyCodes.META))return!1;if(goog.userAgent.WEBKIT&&d&&c)switch(a){case goog.events.KeyCodes.BACKSLASH:case goog.events.KeyCodes.OPEN_SQUARE_BRACKET:case goog.events.KeyCodes.CLOSE_SQUARE_BRACKET:case goog.events.KeyCodes.TILDE:case goog.events.KeyCodes.SEMICOLON:case goog.events.KeyCodes.DASH:case goog.events.KeyCodes.EQUALS:case goog.events.KeyCodes.COMMA:case goog.events.KeyCodes.PERIOD:case goog.events.KeyCodes.SLASH:case goog.events.KeyCodes.APOSTROPHE:case goog.events.KeyCodes.SINGLE_QUOTE:return!1}if(goog.userAgent.IE&&
|
|
d&&b==a)return!1;switch(a){case goog.events.KeyCodes.ENTER:return!(goog.userAgent.IE&&goog.userAgent.isDocumentModeOrHigher(9));case goog.events.KeyCodes.ESC:return!goog.userAgent.WEBKIT}return goog.events.KeyCodes.isCharacterKey(a)};
|
|
goog.events.KeyCodes.isCharacterKey=function(a){if(a>=goog.events.KeyCodes.ZERO&&a<=goog.events.KeyCodes.NINE||a>=goog.events.KeyCodes.NUM_ZERO&&a<=goog.events.KeyCodes.NUM_MULTIPLY||a>=goog.events.KeyCodes.A&&a<=goog.events.KeyCodes.Z||goog.userAgent.WEBKIT&&0==a)return!0;switch(a){case goog.events.KeyCodes.SPACE:case goog.events.KeyCodes.QUESTION_MARK:case goog.events.KeyCodes.NUM_PLUS:case goog.events.KeyCodes.NUM_MINUS:case goog.events.KeyCodes.NUM_PERIOD:case goog.events.KeyCodes.NUM_DIVISION:case goog.events.KeyCodes.SEMICOLON:case goog.events.KeyCodes.FF_SEMICOLON:case goog.events.KeyCodes.DASH:case goog.events.KeyCodes.EQUALS:case goog.events.KeyCodes.FF_EQUALS:case goog.events.KeyCodes.COMMA:case goog.events.KeyCodes.PERIOD:case goog.events.KeyCodes.SLASH:case goog.events.KeyCodes.APOSTROPHE:case goog.events.KeyCodes.SINGLE_QUOTE:case goog.events.KeyCodes.OPEN_SQUARE_BRACKET:case goog.events.KeyCodes.BACKSLASH:case goog.events.KeyCodes.CLOSE_SQUARE_BRACKET:return!0;
|
|
default:return!1}};goog.events.KeyCodes.normalizeGeckoKeyCode=function(a){switch(a){case goog.events.KeyCodes.FF_EQUALS:return goog.events.KeyCodes.EQUALS;case goog.events.KeyCodes.FF_SEMICOLON:return goog.events.KeyCodes.SEMICOLON;case goog.events.KeyCodes.MAC_FF_META:return goog.events.KeyCodes.META;case goog.events.KeyCodes.WIN_KEY_FF_LINUX:return goog.events.KeyCodes.WIN_KEY;default:return a}};goog.events.KeyHandler=function(a,b){goog.events.EventTarget.call(this);a&&this.attach(a,b)};goog.inherits(goog.events.KeyHandler,goog.events.EventTarget);goog.events.KeyHandler.prototype.element_=null;goog.events.KeyHandler.prototype.keyPressKey_=null;goog.events.KeyHandler.prototype.keyDownKey_=null;goog.events.KeyHandler.prototype.keyUpKey_=null;goog.events.KeyHandler.prototype.lastKey_=-1;goog.events.KeyHandler.prototype.keyCode_=-1;goog.events.KeyHandler.prototype.altKey_=!1;
|
|
goog.events.KeyHandler.EventType={KEY:"key"};
|
|
goog.events.KeyHandler.safariKey_={3:goog.events.KeyCodes.ENTER,12:goog.events.KeyCodes.NUMLOCK,63232:goog.events.KeyCodes.UP,63233:goog.events.KeyCodes.DOWN,63234:goog.events.KeyCodes.LEFT,63235:goog.events.KeyCodes.RIGHT,63236:goog.events.KeyCodes.F1,63237:goog.events.KeyCodes.F2,63238:goog.events.KeyCodes.F3,63239:goog.events.KeyCodes.F4,63240:goog.events.KeyCodes.F5,63241:goog.events.KeyCodes.F6,63242:goog.events.KeyCodes.F7,63243:goog.events.KeyCodes.F8,63244:goog.events.KeyCodes.F9,63245:goog.events.KeyCodes.F10,
|
|
63246:goog.events.KeyCodes.F11,63247:goog.events.KeyCodes.F12,63248:goog.events.KeyCodes.PRINT_SCREEN,63272:goog.events.KeyCodes.DELETE,63273:goog.events.KeyCodes.HOME,63275:goog.events.KeyCodes.END,63276:goog.events.KeyCodes.PAGE_UP,63277:goog.events.KeyCodes.PAGE_DOWN,63289:goog.events.KeyCodes.NUMLOCK,63302:goog.events.KeyCodes.INSERT};
|
|
goog.events.KeyHandler.keyIdentifier_={Up:goog.events.KeyCodes.UP,Down:goog.events.KeyCodes.DOWN,Left:goog.events.KeyCodes.LEFT,Right:goog.events.KeyCodes.RIGHT,Enter:goog.events.KeyCodes.ENTER,F1:goog.events.KeyCodes.F1,F2:goog.events.KeyCodes.F2,F3:goog.events.KeyCodes.F3,F4:goog.events.KeyCodes.F4,F5:goog.events.KeyCodes.F5,F6:goog.events.KeyCodes.F6,F7:goog.events.KeyCodes.F7,F8:goog.events.KeyCodes.F8,F9:goog.events.KeyCodes.F9,F10:goog.events.KeyCodes.F10,F11:goog.events.KeyCodes.F11,F12:goog.events.KeyCodes.F12,
|
|
"U+007F":goog.events.KeyCodes.DELETE,Home:goog.events.KeyCodes.HOME,End:goog.events.KeyCodes.END,PageUp:goog.events.KeyCodes.PAGE_UP,PageDown:goog.events.KeyCodes.PAGE_DOWN,Insert:goog.events.KeyCodes.INSERT};goog.events.KeyHandler.USES_KEYDOWN_=goog.userAgent.IE||goog.userAgent.WEBKIT&&goog.userAgent.isVersionOrHigher("525");goog.events.KeyHandler.SAVE_ALT_FOR_KEYPRESS_=goog.userAgent.MAC&&goog.userAgent.GECKO;
|
|
goog.events.KeyHandler.prototype.handleKeyDown_=function(a){goog.userAgent.WEBKIT&&(this.lastKey_==goog.events.KeyCodes.CTRL&&!a.ctrlKey||this.lastKey_==goog.events.KeyCodes.ALT&&!a.altKey||goog.userAgent.MAC&&this.lastKey_==goog.events.KeyCodes.META&&!a.metaKey)&&(this.keyCode_=this.lastKey_=-1);-1==this.lastKey_&&(a.ctrlKey&&a.keyCode!=goog.events.KeyCodes.CTRL?this.lastKey_=goog.events.KeyCodes.CTRL:a.altKey&&a.keyCode!=goog.events.KeyCodes.ALT?this.lastKey_=goog.events.KeyCodes.ALT:a.metaKey&&
|
|
a.keyCode!=goog.events.KeyCodes.META&&(this.lastKey_=goog.events.KeyCodes.META));goog.events.KeyHandler.USES_KEYDOWN_&&!goog.events.KeyCodes.firesKeyPressEvent(a.keyCode,this.lastKey_,a.shiftKey,a.ctrlKey,a.altKey)?this.handleEvent(a):(this.keyCode_=goog.userAgent.GECKO?goog.events.KeyCodes.normalizeGeckoKeyCode(a.keyCode):a.keyCode,goog.events.KeyHandler.SAVE_ALT_FOR_KEYPRESS_&&(this.altKey_=a.altKey))};goog.events.KeyHandler.prototype.resetState=function(){this.keyCode_=this.lastKey_=-1};
|
|
goog.events.KeyHandler.prototype.handleKeyup_=function(a){this.resetState();this.altKey_=a.altKey};
|
|
goog.events.KeyHandler.prototype.handleEvent=function(a){var b=a.getBrowserEvent(),c,d,e=b.altKey;goog.userAgent.IE&&a.type==goog.events.EventType.KEYPRESS?(c=this.keyCode_,d=c!=goog.events.KeyCodes.ENTER&&c!=goog.events.KeyCodes.ESC?b.keyCode:0):goog.userAgent.WEBKIT&&a.type==goog.events.EventType.KEYPRESS?(c=this.keyCode_,d=0<=b.charCode&&63232>b.charCode&&goog.events.KeyCodes.isCharacterKey(c)?b.charCode:0):goog.userAgent.OPERA?(c=this.keyCode_,d=goog.events.KeyCodes.isCharacterKey(c)?b.keyCode:
|
|
0):(c=b.keyCode||this.keyCode_,d=b.charCode||0,goog.events.KeyHandler.SAVE_ALT_FOR_KEYPRESS_&&(e=this.altKey_),goog.userAgent.MAC&&(d==goog.events.KeyCodes.QUESTION_MARK&&c==goog.events.KeyCodes.WIN_KEY)&&(c=goog.events.KeyCodes.SLASH));var f=c,g=b.keyIdentifier;c?63232<=c&&c in goog.events.KeyHandler.safariKey_?f=goog.events.KeyHandler.safariKey_[c]:25==c&&a.shiftKey&&(f=9):g&&g in goog.events.KeyHandler.keyIdentifier_&&(f=goog.events.KeyHandler.keyIdentifier_[g]);a=f==this.lastKey_;this.lastKey_=
|
|
f;b=new goog.events.KeyEvent(f,d,a,b);b.altKey=e;this.dispatchEvent(b)};goog.events.KeyHandler.prototype.getElement=function(){return this.element_};
|
|
goog.events.KeyHandler.prototype.attach=function(a,b){this.keyUpKey_&&this.detach();this.element_=a;this.keyPressKey_=goog.events.listen(this.element_,goog.events.EventType.KEYPRESS,this,b);this.keyDownKey_=goog.events.listen(this.element_,goog.events.EventType.KEYDOWN,this.handleKeyDown_,b,this);this.keyUpKey_=goog.events.listen(this.element_,goog.events.EventType.KEYUP,this.handleKeyup_,b,this)};
|
|
goog.events.KeyHandler.prototype.detach=function(){this.keyPressKey_&&(goog.events.unlistenByKey(this.keyPressKey_),goog.events.unlistenByKey(this.keyDownKey_),goog.events.unlistenByKey(this.keyUpKey_),this.keyUpKey_=this.keyDownKey_=this.keyPressKey_=null);this.element_=null;this.keyCode_=this.lastKey_=-1};goog.events.KeyHandler.prototype.disposeInternal=function(){goog.events.KeyHandler.superClass_.disposeInternal.call(this);this.detach()};
|
|
goog.events.KeyEvent=function(a,b,c,d){goog.events.BrowserEvent.call(this,d);this.type=goog.events.KeyHandler.EventType.KEY;this.keyCode=a;this.charCode=b;this.repeat=c};goog.inherits(goog.events.KeyEvent,goog.events.BrowserEvent);goog.dom.vendor={};goog.dom.vendor.getVendorJsPrefix=function(){return goog.userAgent.WEBKIT?"Webkit":goog.userAgent.GECKO?"Moz":goog.userAgent.IE?"ms":goog.userAgent.OPERA?"O":null};goog.dom.vendor.getVendorPrefix=function(){return goog.userAgent.WEBKIT?"-webkit":goog.userAgent.GECKO?"-moz":goog.userAgent.IE?"-ms":goog.userAgent.OPERA?"-o":null};goog.math.Box=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d};goog.math.Box.boundingBox=function(a){for(var b=new goog.math.Box(arguments[0].y,arguments[0].x,arguments[0].y,arguments[0].x),c=1;c<arguments.length;c++){var d=arguments[c];b.top=Math.min(b.top,d.y);b.right=Math.max(b.right,d.x);b.bottom=Math.max(b.bottom,d.y);b.left=Math.min(b.left,d.x)}return b};goog.math.Box.prototype.clone=function(){return new goog.math.Box(this.top,this.right,this.bottom,this.left)};
|
|
goog.DEBUG&&(goog.math.Box.prototype.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"});goog.math.Box.prototype.contains=function(a){return goog.math.Box.contains(this,a)};goog.math.Box.prototype.expand=function(a,b,c,d){goog.isObject(a)?(this.top-=a.top,this.right+=a.right,this.bottom+=a.bottom,this.left-=a.left):(this.top-=a,this.right+=b,this.bottom+=c,this.left-=d);return this};
|
|
goog.math.Box.prototype.expandToInclude=function(a){this.left=Math.min(this.left,a.left);this.top=Math.min(this.top,a.top);this.right=Math.max(this.right,a.right);this.bottom=Math.max(this.bottom,a.bottom)};goog.math.Box.equals=function(a,b){return a==b?!0:a&&b?a.top==b.top&&a.right==b.right&&a.bottom==b.bottom&&a.left==b.left:!1};
|
|
goog.math.Box.contains=function(a,b){return a&&b?b instanceof goog.math.Box?b.left>=a.left&&b.right<=a.right&&b.top>=a.top&&b.bottom<=a.bottom:b.x>=a.left&&b.x<=a.right&&b.y>=a.top&&b.y<=a.bottom:!1};goog.math.Box.relativePositionX=function(a,b){return b.x<a.left?b.x-a.left:b.x>a.right?b.x-a.right:0};goog.math.Box.relativePositionY=function(a,b){return b.y<a.top?b.y-a.top:b.y>a.bottom?b.y-a.bottom:0};
|
|
goog.math.Box.distance=function(a,b){var c=goog.math.Box.relativePositionX(a,b),d=goog.math.Box.relativePositionY(a,b);return Math.sqrt(c*c+d*d)};goog.math.Box.intersects=function(a,b){return a.left<=b.right&&b.left<=a.right&&a.top<=b.bottom&&b.top<=a.bottom};goog.math.Box.intersectsWithPadding=function(a,b,c){return a.left<=b.right+c&&b.left<=a.right+c&&a.top<=b.bottom+c&&b.top<=a.bottom+c};
|
|
goog.math.Box.prototype.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};goog.math.Box.prototype.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};
|
|
goog.math.Box.prototype.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this};goog.math.Box.prototype.translate=function(a,b){a instanceof goog.math.Coordinate?(this.left+=a.x,this.right+=a.x,this.top+=a.y,this.bottom+=a.y):(this.left+=a,this.right+=a,goog.isNumber(b)&&(this.top+=b,this.bottom+=b));return this};
|
|
goog.math.Box.prototype.scale=function(a,b){var c=goog.isNumber(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};goog.math.Rect=function(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d};goog.math.Rect.prototype.clone=function(){return new goog.math.Rect(this.left,this.top,this.width,this.height)};goog.math.Rect.prototype.toBox=function(){return new goog.math.Box(this.top,this.left+this.width,this.top+this.height,this.left)};goog.math.Rect.createFromBox=function(a){return new goog.math.Rect(a.left,a.top,a.right-a.left,a.bottom-a.top)};
|
|
goog.DEBUG&&(goog.math.Rect.prototype.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"});goog.math.Rect.equals=function(a,b){return a==b?!0:a&&b?a.left==b.left&&a.width==b.width&&a.top==b.top&&a.height==b.height:!1};
|
|
goog.math.Rect.prototype.intersection=function(a){var b=Math.max(this.left,a.left),c=Math.min(this.left+this.width,a.left+a.width);if(b<=c){var d=Math.max(this.top,a.top);a=Math.min(this.top+this.height,a.top+a.height);if(d<=a)return this.left=b,this.top=d,this.width=c-b,this.height=a-d,!0}return!1};
|
|
goog.math.Rect.intersection=function(a,b){var c=Math.max(a.left,b.left),d=Math.min(a.left+a.width,b.left+b.width);if(c<=d){var e=Math.max(a.top,b.top),f=Math.min(a.top+a.height,b.top+b.height);if(e<=f)return new goog.math.Rect(c,e,d-c,f-e)}return null};goog.math.Rect.intersects=function(a,b){return a.left<=b.left+b.width&&b.left<=a.left+a.width&&a.top<=b.top+b.height&&b.top<=a.top+a.height};goog.math.Rect.prototype.intersects=function(a){return goog.math.Rect.intersects(this,a)};
|
|
goog.math.Rect.difference=function(a,b){var c=goog.math.Rect.intersection(a,b);if(!c||!c.height||!c.width)return[a.clone()];var c=[],d=a.top,e=a.height,f=a.left+a.width,g=a.top+a.height,h=b.left+b.width,k=b.top+b.height;b.top>a.top&&(c.push(new goog.math.Rect(a.left,a.top,a.width,b.top-a.top)),d=b.top,e-=b.top-a.top);k<g&&(c.push(new goog.math.Rect(a.left,k,a.width,g-k)),e=k-d);b.left>a.left&&c.push(new goog.math.Rect(a.left,d,b.left-a.left,e));h<f&&c.push(new goog.math.Rect(h,d,f-h,e));return c};
|
|
goog.math.Rect.prototype.difference=function(a){return goog.math.Rect.difference(this,a)};goog.math.Rect.prototype.boundingRect=function(a){var b=Math.max(this.left+this.width,a.left+a.width),c=Math.max(this.top+this.height,a.top+a.height);this.left=Math.min(this.left,a.left);this.top=Math.min(this.top,a.top);this.width=b-this.left;this.height=c-this.top};goog.math.Rect.boundingRect=function(a,b){if(!a||!b)return null;var c=a.clone();c.boundingRect(b);return c};
|
|
goog.math.Rect.prototype.contains=function(a){return a instanceof goog.math.Rect?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};goog.math.Rect.prototype.squaredDistance=function(a){var b=a.x<this.left?this.left-a.x:Math.max(a.x-(this.left+this.width),0);a=a.y<this.top?this.top-a.y:Math.max(a.y-(this.top+this.height),0);return b*b+a*a};
|
|
goog.math.Rect.prototype.distance=function(a){return Math.sqrt(this.squaredDistance(a))};goog.math.Rect.prototype.getSize=function(){return new goog.math.Size(this.width,this.height)};goog.math.Rect.prototype.getTopLeft=function(){return new goog.math.Coordinate(this.left,this.top)};goog.math.Rect.prototype.getCenter=function(){return new goog.math.Coordinate(this.left+this.width/2,this.top+this.height/2)};
|
|
goog.math.Rect.prototype.getBottomRight=function(){return new goog.math.Coordinate(this.left+this.width,this.top+this.height)};goog.math.Rect.prototype.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};goog.math.Rect.prototype.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};
|
|
goog.math.Rect.prototype.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};goog.math.Rect.prototype.translate=function(a,b){a instanceof goog.math.Coordinate?(this.left+=a.x,this.top+=a.y):(this.left+=a,goog.isNumber(b)&&(this.top+=b));return this};goog.math.Rect.prototype.scale=function(a,b){var c=goog.isNumber(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};goog.style={};goog.style.GET_BOUNDING_CLIENT_RECT_ALWAYS_EXISTS=!1;goog.style.setStyle=function(a,b,c){goog.isString(b)?goog.style.setStyle_(a,c,b):goog.object.forEach(b,goog.partial(goog.style.setStyle_,a))};goog.style.setStyle_=function(a,b,c){(c=goog.style.getVendorJsStyleName_(a,c))&&(a.style[c]=b)};goog.style.getVendorJsStyleName_=function(a,b){var c=goog.string.toCamelCase(b);if(void 0===a.style[c]){var d=goog.dom.vendor.getVendorJsPrefix()+goog.string.toTitleCase(b);if(void 0!==a.style[d])return d}return c};
|
|
goog.style.getVendorStyleName_=function(a,b){var c=goog.string.toCamelCase(b);return void 0===a.style[c]&&(c=goog.dom.vendor.getVendorJsPrefix()+goog.string.toTitleCase(b),void 0!==a.style[c])?goog.dom.vendor.getVendorPrefix()+"-"+b:b};goog.style.getStyle=function(a,b){var c=a.style[goog.string.toCamelCase(b)];return"undefined"!==typeof c?c:a.style[goog.style.getVendorJsStyleName_(a,b)]||""};
|
|
goog.style.getComputedStyle=function(a,b){var c=goog.dom.getOwnerDocument(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""};goog.style.getCascadedStyle=function(a,b){return a.currentStyle?a.currentStyle[b]:null};goog.style.getStyle_=function(a,b){return goog.style.getComputedStyle(a,b)||goog.style.getCascadedStyle(a,b)||a.style&&a.style[b]};
|
|
goog.style.getComputedPosition=function(a){return goog.style.getStyle_(a,"position")};goog.style.getBackgroundColor=function(a){return goog.style.getStyle_(a,"backgroundColor")};goog.style.getComputedOverflowX=function(a){return goog.style.getStyle_(a,"overflowX")};goog.style.getComputedOverflowY=function(a){return goog.style.getStyle_(a,"overflowY")};goog.style.getComputedZIndex=function(a){return goog.style.getStyle_(a,"zIndex")};
|
|
goog.style.getComputedTextAlign=function(a){return goog.style.getStyle_(a,"textAlign")};goog.style.getComputedCursor=function(a){return goog.style.getStyle_(a,"cursor")};goog.style.setPosition=function(a,b,c){var d,e=goog.userAgent.GECKO&&(goog.userAgent.MAC||goog.userAgent.X11)&&goog.userAgent.isVersionOrHigher("1.9");b instanceof goog.math.Coordinate?(d=b.x,b=b.y):(d=b,b=c);a.style.left=goog.style.getPixelStyleValue_(d,e);a.style.top=goog.style.getPixelStyleValue_(b,e)};
|
|
goog.style.getPosition=function(a){return new goog.math.Coordinate(a.offsetLeft,a.offsetTop)};goog.style.getClientViewportElement=function(a){a=a?goog.dom.getOwnerDocument(a):goog.dom.getDocument();return!goog.userAgent.IE||goog.userAgent.isDocumentModeOrHigher(9)||goog.dom.getDomHelper(a).isCss1CompatMode()?a.documentElement:a.body};goog.style.getViewportPageOffset=function(a){var b=a.body;a=a.documentElement;return new goog.math.Coordinate(b.scrollLeft||a.scrollLeft,b.scrollTop||a.scrollTop)};
|
|
goog.style.getBoundingClientRect_=function(a){var b;try{b=a.getBoundingClientRect()}catch(c){return{left:0,top:0,right:0,bottom:0}}goog.userAgent.IE&&(a=a.ownerDocument,b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b};
|
|
goog.style.getOffsetParent=function(a){if(goog.userAgent.IE&&!goog.userAgent.isDocumentModeOrHigher(8))return a.offsetParent;var b=goog.dom.getOwnerDocument(a),c=goog.style.getStyle_(a,"position"),d="fixed"==c||"absolute"==c;for(a=a.parentNode;a&&a!=b;a=a.parentNode)if(c=goog.style.getStyle_(a,"position"),d=d&&"static"==c&&a!=b.documentElement&&a!=b.body,!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||"fixed"==c||"absolute"==c||"relative"==c))return a;return null};
|
|
goog.style.getVisibleRectForElement=function(a){for(var b=new goog.math.Box(0,Infinity,Infinity,0),c=goog.dom.getDomHelper(a),d=c.getDocument().body,e=c.getDocument().documentElement,f=c.getDocumentScrollElement();a=goog.style.getOffsetParent(a);)if(!(goog.userAgent.IE&&0==a.clientWidth||goog.userAgent.WEBKIT&&0==a.clientHeight&&a==d||a==d||a==e||"visible"==goog.style.getStyle_(a,"overflow"))){var g=goog.style.getPageOffset(a),h=goog.style.getClientLeftTop(a);g.x+=h.x;g.y+=h.y;b.top=Math.max(b.top,
|
|
g.y);b.right=Math.min(b.right,g.x+a.clientWidth);b.bottom=Math.min(b.bottom,g.y+a.clientHeight);b.left=Math.max(b.left,g.x)}d=f.scrollLeft;f=f.scrollTop;b.left=Math.max(b.left,d);b.top=Math.max(b.top,f);c=c.getViewportSize();b.right=Math.min(b.right,d+c.width);b.bottom=Math.min(b.bottom,f+c.height);return 0<=b.top&&0<=b.left&&b.bottom>b.top&&b.right>b.left?b:null};
|
|
goog.style.getContainerOffsetToScrollInto=function(a,b,c){var d=goog.style.getPageOffset(a),e=goog.style.getPageOffset(b),f=goog.style.getBorderBox(b),g=d.x-e.x-f.left,d=d.y-e.y-f.top,e=b.clientWidth-a.offsetWidth;a=b.clientHeight-a.offsetHeight;f=b.scrollLeft;b=b.scrollTop;c?(f+=g-e/2,b+=d-a/2):(f+=Math.min(g,Math.max(g-e,0)),b+=Math.min(d,Math.max(d-a,0)));return new goog.math.Coordinate(f,b)};
|
|
goog.style.scrollIntoContainerView=function(a,b,c){a=goog.style.getContainerOffsetToScrollInto(a,b,c);b.scrollLeft=a.x;b.scrollTop=a.y};
|
|
goog.style.getClientLeftTop=function(a){if(goog.userAgent.GECKO&&!goog.userAgent.isVersionOrHigher("1.9")){var b=parseFloat(goog.style.getComputedStyle(a,"borderLeftWidth"));if(goog.style.isRightToLeft(a))var c=a.offsetWidth-a.clientWidth-b-parseFloat(goog.style.getComputedStyle(a,"borderRightWidth")),b=b+c;return new goog.math.Coordinate(b,parseFloat(goog.style.getComputedStyle(a,"borderTopWidth")))}return new goog.math.Coordinate(a.clientLeft,a.clientTop)};
|
|
goog.style.getPageOffset=function(a){var b,c=goog.dom.getOwnerDocument(a),d=goog.style.getStyle_(a,"position"),e=!goog.style.GET_BOUNDING_CLIENT_RECT_ALWAYS_EXISTS&&goog.userAgent.GECKO&&c.getBoxObjectFor&&!a.getBoundingClientRect&&"absolute"==d&&(b=c.getBoxObjectFor(a))&&(0>b.screenX||0>b.screenY),f=new goog.math.Coordinate(0,0),g=goog.style.getClientViewportElement(c);if(a==g)return f;if(goog.style.GET_BOUNDING_CLIENT_RECT_ALWAYS_EXISTS||a.getBoundingClientRect)b=goog.style.getBoundingClientRect_(a),
|
|
a=goog.dom.getDomHelper(c).getDocumentScroll(),f.x=b.left+a.x,f.y=b.top+a.y;else if(c.getBoxObjectFor&&!e)b=c.getBoxObjectFor(a),a=c.getBoxObjectFor(g),f.x=b.screenX-a.screenX,f.y=b.screenY-a.screenY;else{b=a;do{f.x+=b.offsetLeft;f.y+=b.offsetTop;b!=a&&(f.x+=b.clientLeft||0,f.y+=b.clientTop||0);if(goog.userAgent.WEBKIT&&"fixed"==goog.style.getComputedPosition(b)){f.x+=c.body.scrollLeft;f.y+=c.body.scrollTop;break}b=b.offsetParent}while(b&&b!=a);if(goog.userAgent.OPERA||goog.userAgent.WEBKIT&&"absolute"==
|
|
d)f.y-=c.body.offsetTop;for(b=a;(b=goog.style.getOffsetParent(b))&&b!=c.body&&b!=g;)f.x-=b.scrollLeft,goog.userAgent.OPERA&&"TR"==b.tagName||(f.y-=b.scrollTop)}return f};goog.style.getPageOffsetLeft=function(a){return goog.style.getPageOffset(a).x};goog.style.getPageOffsetTop=function(a){return goog.style.getPageOffset(a).y};
|
|
goog.style.getFramedPageOffset=function(a,b){var c=new goog.math.Coordinate(0,0),d=goog.dom.getWindow(goog.dom.getOwnerDocument(a)),e=a;do{var f=d==b?goog.style.getPageOffset(e):goog.style.getClientPositionForElement_(null);c.x+=f.x;c.y+=f.y}while(d&&d!=b&&(e=d.frameElement)&&(d=d.parent));return c};
|
|
goog.style.translateRectForAnotherFrame=function(a,b,c){if(b.getDocument()!=c.getDocument()){var d=b.getDocument().body;c=goog.style.getFramedPageOffset(d,c.getWindow());c=goog.math.Coordinate.difference(c,goog.style.getPageOffset(d));goog.userAgent.IE&&!b.isCss1CompatMode()&&(c=goog.math.Coordinate.difference(c,b.getDocumentScroll()));a.left+=c.x;a.top+=c.y}};
|
|
goog.style.getRelativePosition=function(a,b){var c=goog.style.getClientPosition(a),d=goog.style.getClientPosition(b);return new goog.math.Coordinate(c.x-d.x,c.y-d.y)};
|
|
goog.style.getClientPositionForElement_=function(a){var b;if(goog.style.GET_BOUNDING_CLIENT_RECT_ALWAYS_EXISTS||a.getBoundingClientRect)b=goog.style.getBoundingClientRect_(a),b=new goog.math.Coordinate(b.left,b.top);else{b=goog.dom.getDomHelper(a).getDocumentScroll();var c=goog.style.getPageOffset(a);b=new goog.math.Coordinate(c.x-b.x,c.y-b.y)}return goog.userAgent.GECKO&&!goog.userAgent.isVersionOrHigher(12)?goog.math.Coordinate.sum(b,goog.style.getCssTranslation(a)):b};
|
|
goog.style.getClientPosition=function(a){if(a.nodeType==goog.dom.NodeType.ELEMENT)return goog.style.getClientPositionForElement_(a);var b=goog.isFunction(a.getBrowserEvent),c=a;a.targetTouches?c=a.targetTouches[0]:b&&a.getBrowserEvent().targetTouches&&(c=a.getBrowserEvent().targetTouches[0]);return new goog.math.Coordinate(c.clientX,c.clientY)};
|
|
goog.style.setPageOffset=function(a,b,c){var d=goog.style.getPageOffset(a);b instanceof goog.math.Coordinate&&(c=b.y,b=b.x);goog.style.setPosition(a,a.offsetLeft+(b-d.x),a.offsetTop+(c-d.y))};goog.style.setSize=function(a,b,c){if(b instanceof goog.math.Size)c=b.height,b=b.width;else if(void 0==c)throw Error("missing height argument");goog.style.setWidth(a,b);goog.style.setHeight(a,c)};goog.style.getPixelStyleValue_=function(a,b){"number"==typeof a&&(a=(b?Math.round(a):a)+"px");return a};
|
|
goog.style.setHeight=function(a,b){a.style.height=goog.style.getPixelStyleValue_(b,!0)};goog.style.setWidth=function(a,b){a.style.width=goog.style.getPixelStyleValue_(b,!0)};goog.style.getSize=function(a){return goog.style.evaluateWithTemporaryDisplay_(goog.style.getSizeWithDisplay_,a)};
|
|
goog.style.evaluateWithTemporaryDisplay_=function(a,b){if("none"!=goog.style.getStyle_(b,"display"))return a(b);var c=b.style,d=c.display,e=c.visibility,f=c.position;c.visibility="hidden";c.position="absolute";c.display="inline";var g=a(b);c.display=d;c.position=f;c.visibility=e;return g};
|
|
goog.style.getSizeWithDisplay_=function(a){var b=a.offsetWidth,c=a.offsetHeight,d=goog.userAgent.WEBKIT&&!b&&!c;return goog.isDef(b)&&!d||!a.getBoundingClientRect?new goog.math.Size(b,c):(a=goog.style.getBoundingClientRect_(a),new goog.math.Size(a.right-a.left,a.bottom-a.top))};goog.style.getTransformedSize=function(a){if(!a.getBoundingClientRect)return null;a=goog.style.evaluateWithTemporaryDisplay_(goog.style.getBoundingClientRect_,a);return new goog.math.Size(a.right-a.left,a.bottom-a.top)};
|
|
goog.style.getBounds=function(a){var b=goog.style.getPageOffset(a);a=goog.style.getSize(a);return new goog.math.Rect(b.x,b.y,a.width,a.height)};goog.style.toCamelCase=function(a){return goog.string.toCamelCase(String(a))};goog.style.toSelectorCase=function(a){return goog.string.toSelectorCase(a)};
|
|
goog.style.getOpacity=function(a){var b=a.style;a="";"opacity"in b?a=b.opacity:"MozOpacity"in b?a=b.MozOpacity:"filter"in b&&(b=b.filter.match(/alpha\(opacity=([\d.]+)\)/))&&(a=String(b[1]/100));return""==a?a:Number(a)};goog.style.setOpacity=function(a,b){var c=a.style;"opacity"in c?c.opacity=b:"MozOpacity"in c?c.MozOpacity=b:"filter"in c&&(c.filter=""===b?"":"alpha(opacity\x3d"+100*b+")")};
|
|
goog.style.setTransparentBackgroundImage=function(a,b){var c=a.style;goog.userAgent.IE&&!goog.userAgent.isVersionOrHigher("8")?c.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src\x3d"'+b+'", sizingMethod\x3d"crop")':(c.backgroundImage="url("+b+")",c.backgroundPosition="top left",c.backgroundRepeat="no-repeat")};goog.style.clearTransparentBackgroundImage=function(a){a=a.style;"filter"in a?a.filter="":a.backgroundImage="none"};
|
|
goog.style.showElement=function(a,b){goog.style.setElementShown(a,b)};goog.style.setElementShown=function(a,b){a.style.display=b?"":"none"};goog.style.isElementShown=function(a){return"none"!=a.style.display};
|
|
goog.style.installStyles=function(a,b){var c=goog.dom.getDomHelper(b),d=null;if(goog.userAgent.IE)d=c.getDocument().createStyleSheet(),goog.style.setStyles(d,a);else{var e=c.getElementsByTagNameAndClass("head")[0];e||(d=c.getElementsByTagNameAndClass("body")[0],e=c.createDom("head"),d.parentNode.insertBefore(e,d));d=c.createDom("style");goog.style.setStyles(d,a);c.appendChild(e,d)}return d};goog.style.uninstallStyles=function(a){goog.dom.removeNode(a.ownerNode||a.owningElement||a)};
|
|
goog.style.setStyles=function(a,b){goog.userAgent.IE?a.cssText=b:a.innerHTML=b};goog.style.setPreWrap=function(a){a=a.style;goog.userAgent.IE&&!goog.userAgent.isVersionOrHigher("8")?(a.whiteSpace="pre",a.wordWrap="break-word"):a.whiteSpace=goog.userAgent.GECKO?"-moz-pre-wrap":"pre-wrap"};
|
|
goog.style.setInlineBlock=function(a){a=a.style;a.position="relative";goog.userAgent.IE&&!goog.userAgent.isVersionOrHigher("8")?(a.zoom="1",a.display="inline"):a.display=goog.userAgent.GECKO?goog.userAgent.isVersionOrHigher("1.9a")?"inline-block":"-moz-inline-box":"inline-block"};goog.style.isRightToLeft=function(a){return"rtl"==goog.style.getStyle_(a,"direction")};goog.style.unselectableStyle_=goog.userAgent.GECKO?"MozUserSelect":goog.userAgent.WEBKIT?"WebkitUserSelect":null;
|
|
goog.style.isUnselectable=function(a){return goog.style.unselectableStyle_?"none"==a.style[goog.style.unselectableStyle_].toLowerCase():goog.userAgent.IE||goog.userAgent.OPERA?"on"==a.getAttribute("unselectable"):!1};
|
|
goog.style.setUnselectable=function(a,b,c){c=c?null:a.getElementsByTagName("*");var d=goog.style.unselectableStyle_;if(d){if(b=b?"none":"",a.style[d]=b,c){a=0;for(var e;e=c[a];a++)e.style[d]=b}}else if(goog.userAgent.IE||goog.userAgent.OPERA)if(b=b?"on":"",a.setAttribute("unselectable",b),c)for(a=0;e=c[a];a++)e.setAttribute("unselectable",b)};goog.style.getBorderBoxSize=function(a){return new goog.math.Size(a.offsetWidth,a.offsetHeight)};
|
|
goog.style.setBorderBoxSize=function(a,b){var c=goog.dom.getOwnerDocument(a),d=goog.dom.getDomHelper(c).isCss1CompatMode();if(!goog.userAgent.IE||d&&goog.userAgent.isVersionOrHigher("8"))goog.style.setBoxSizingSize_(a,b,"border-box");else if(c=a.style,d){var d=goog.style.getPaddingBox(a),e=goog.style.getBorderBox(a);c.pixelWidth=b.width-e.left-d.left-d.right-e.right;c.pixelHeight=b.height-e.top-d.top-d.bottom-e.bottom}else c.pixelWidth=b.width,c.pixelHeight=b.height};
|
|
goog.style.getContentBoxSize=function(a){var b=goog.dom.getOwnerDocument(a),c=goog.userAgent.IE&&a.currentStyle;if(c&&goog.dom.getDomHelper(b).isCss1CompatMode()&&"auto"!=c.width&&"auto"!=c.height&&!c.boxSizing)return b=goog.style.getIePixelValue_(a,c.width,"width","pixelWidth"),a=goog.style.getIePixelValue_(a,c.height,"height","pixelHeight"),new goog.math.Size(b,a);c=goog.style.getBorderBoxSize(a);b=goog.style.getPaddingBox(a);a=goog.style.getBorderBox(a);return new goog.math.Size(c.width-a.left-
|
|
b.left-b.right-a.right,c.height-a.top-b.top-b.bottom-a.bottom)};
|
|
goog.style.setContentBoxSize=function(a,b){var c=goog.dom.getOwnerDocument(a),d=goog.dom.getDomHelper(c).isCss1CompatMode();if(!goog.userAgent.IE||d&&goog.userAgent.isVersionOrHigher("8"))goog.style.setBoxSizingSize_(a,b,"content-box");else if(c=a.style,d)c.pixelWidth=b.width,c.pixelHeight=b.height;else{var d=goog.style.getPaddingBox(a),e=goog.style.getBorderBox(a);c.pixelWidth=b.width+e.left+d.left+d.right+e.right;c.pixelHeight=b.height+e.top+d.top+d.bottom+e.bottom}};
|
|
goog.style.setBoxSizingSize_=function(a,b,c){a=a.style;goog.userAgent.GECKO?a.MozBoxSizing=c:goog.userAgent.WEBKIT?a.WebkitBoxSizing=c:a.boxSizing=c;a.width=Math.max(b.width,0)+"px";a.height=Math.max(b.height,0)+"px"};goog.style.getIePixelValue_=function(a,b,c,d){if(/^\d+px?$/.test(b))return parseInt(b,10);var e=a.style[c],f=a.runtimeStyle[c];a.runtimeStyle[c]=a.currentStyle[c];a.style[c]=b;b=a.style[d];a.style[c]=e;a.runtimeStyle[c]=f;return b};
|
|
goog.style.getIePixelDistance_=function(a,b){var c=goog.style.getCascadedStyle(a,b);return c?goog.style.getIePixelValue_(a,c,"left","pixelLeft"):0};
|
|
goog.style.getBox_=function(a,b){if(goog.userAgent.IE){var c=goog.style.getIePixelDistance_(a,b+"Left"),d=goog.style.getIePixelDistance_(a,b+"Right"),e=goog.style.getIePixelDistance_(a,b+"Top"),f=goog.style.getIePixelDistance_(a,b+"Bottom");return new goog.math.Box(e,d,f,c)}c=goog.style.getComputedStyle(a,b+"Left");d=goog.style.getComputedStyle(a,b+"Right");e=goog.style.getComputedStyle(a,b+"Top");f=goog.style.getComputedStyle(a,b+"Bottom");return new goog.math.Box(parseFloat(e),parseFloat(d),parseFloat(f),
|
|
parseFloat(c))};goog.style.getPaddingBox=function(a){return goog.style.getBox_(a,"padding")};goog.style.getMarginBox=function(a){return goog.style.getBox_(a,"margin")};goog.style.ieBorderWidthKeywords_={thin:2,medium:4,thick:6};
|
|
goog.style.getIePixelBorder_=function(a,b){if("none"==goog.style.getCascadedStyle(a,b+"Style"))return 0;var c=goog.style.getCascadedStyle(a,b+"Width");return c in goog.style.ieBorderWidthKeywords_?goog.style.ieBorderWidthKeywords_[c]:goog.style.getIePixelValue_(a,c,"left","pixelLeft")};
|
|
goog.style.getBorderBox=function(a){if(goog.userAgent.IE){var b=goog.style.getIePixelBorder_(a,"borderLeft"),c=goog.style.getIePixelBorder_(a,"borderRight"),d=goog.style.getIePixelBorder_(a,"borderTop");a=goog.style.getIePixelBorder_(a,"borderBottom");return new goog.math.Box(d,c,a,b)}b=goog.style.getComputedStyle(a,"borderLeftWidth");c=goog.style.getComputedStyle(a,"borderRightWidth");d=goog.style.getComputedStyle(a,"borderTopWidth");a=goog.style.getComputedStyle(a,"borderBottomWidth");return new goog.math.Box(parseFloat(d),
|
|
parseFloat(c),parseFloat(a),parseFloat(b))};goog.style.getFontFamily=function(a){var b=goog.dom.getOwnerDocument(a),c="";if(b.body.createTextRange){b=b.body.createTextRange();b.moveToElementText(a);try{c=b.queryCommandValue("FontName")}catch(d){c=""}}c||(c=goog.style.getStyle_(a,"fontFamily"));a=c.split(",");1<a.length&&(c=a[0]);return goog.string.stripQuotes(c,"\"'")};goog.style.lengthUnitRegex_=/[^\d]+$/;
|
|
goog.style.getLengthUnits=function(a){return(a=a.match(goog.style.lengthUnitRegex_))&&a[0]||null};goog.style.ABSOLUTE_CSS_LENGTH_UNITS_={cm:1,"in":1,mm:1,pc:1,pt:1};goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_={em:1,ex:1};
|
|
goog.style.getFontSize=function(a){var b=goog.style.getStyle_(a,"fontSize"),c=goog.style.getLengthUnits(b);if(b&&"px"==c)return parseInt(b,10);if(goog.userAgent.IE){if(c in goog.style.ABSOLUTE_CSS_LENGTH_UNITS_)return goog.style.getIePixelValue_(a,b,"left","pixelLeft");if(a.parentNode&&a.parentNode.nodeType==goog.dom.NodeType.ELEMENT&&c in goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_)return a=a.parentNode,c=goog.style.getStyle_(a,"fontSize"),goog.style.getIePixelValue_(a,b==c?"1em":b,"left","pixelLeft")}c=
|
|
goog.dom.createDom("span",{style:"visibility:hidden;position:absolute;line-height:0;padding:0;margin:0;border:0;height:1em;"});goog.dom.appendChild(a,c);b=c.offsetHeight;goog.dom.removeNode(c);return b};goog.style.parseStyleAttribute=function(a){var b={};goog.array.forEach(a.split(/\s*;\s*/),function(a){a=a.split(/\s*:\s*/);2==a.length&&(b[goog.string.toCamelCase(a[0].toLowerCase())]=a[1])});return b};
|
|
goog.style.toStyleAttribute=function(a){var b=[];goog.object.forEach(a,function(a,d){b.push(goog.string.toSelectorCase(d),":",a,";")});return b.join("")};goog.style.setFloat=function(a,b){a.style[goog.userAgent.IE?"styleFloat":"cssFloat"]=b};goog.style.getFloat=function(a){return a.style[goog.userAgent.IE?"styleFloat":"cssFloat"]||""};
|
|
goog.style.getScrollbarWidth=function(a){var b=goog.dom.createElement("div");a&&(b.className=a);b.style.cssText="overflow:auto;position:absolute;top:0;width:100px;height:100px";a=goog.dom.createElement("div");goog.style.setSize(a,"200px","200px");b.appendChild(a);goog.dom.appendChild(goog.dom.getDocument().body,b);a=b.offsetWidth-b.clientWidth;goog.dom.removeNode(b);return a};goog.style.MATRIX_TRANSLATION_REGEX_=/matrix\([0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, ([0-9\.\-]+)p?x?, ([0-9\.\-]+)p?x?\)/;
|
|
goog.style.getCssTranslation=function(a){var b;goog.userAgent.IE?b="-ms-transform":goog.userAgent.WEBKIT?b="-webkit-transform":goog.userAgent.OPERA?b="-o-transform":goog.userAgent.GECKO&&(b="-moz-transform");var c;b&&(c=goog.style.getStyle_(a,b));c||(c=goog.style.getStyle_(a,"transform"));return c?(a=c.match(goog.style.MATRIX_TRANSLATION_REGEX_))?new goog.math.Coordinate(parseFloat(a[1]),parseFloat(a[2])):new goog.math.Coordinate(0,0):new goog.math.Coordinate(0,0)};goog.events.MouseWheelHandler=function(a,b){goog.events.EventTarget.call(this);this.element_=a;var c=goog.dom.isElement(this.element_)?this.element_:this.element_?this.element_.body:null;this.isRtl_=!!c&&goog.style.isRightToLeft(c);this.listenKey_=goog.events.listen(this.element_,goog.userAgent.GECKO?"DOMMouseScroll":"mousewheel",this,b)};goog.inherits(goog.events.MouseWheelHandler,goog.events.EventTarget);goog.events.MouseWheelHandler.EventType={MOUSEWHEEL:"mousewheel"};
|
|
goog.events.MouseWheelHandler.prototype.setMaxDeltaX=function(a){this.maxDeltaX_=a};goog.events.MouseWheelHandler.prototype.setMaxDeltaY=function(a){this.maxDeltaY_=a};
|
|
goog.events.MouseWheelHandler.prototype.handleEvent=function(a){var b=0,c=0,d=0;a=a.getBrowserEvent();if("mousewheel"==a.type){c=1;if(goog.userAgent.IE||goog.userAgent.WEBKIT&&(goog.userAgent.WINDOWS||goog.userAgent.isVersionOrHigher("532.0")))c=40;d=goog.events.MouseWheelHandler.smartScale_(-a.wheelDelta,c);goog.isDef(a.wheelDeltaX)?(b=goog.events.MouseWheelHandler.smartScale_(-a.wheelDeltaX,c),c=goog.events.MouseWheelHandler.smartScale_(-a.wheelDeltaY,c)):c=d}else d=a.detail,100<d?d=3:-100>d&&(d=
|
|
-3),goog.isDef(a.axis)&&a.axis===a.HORIZONTAL_AXIS?b=d:c=d;goog.isNumber(this.maxDeltaX_)&&(b=goog.math.clamp(b,-this.maxDeltaX_,this.maxDeltaX_));goog.isNumber(this.maxDeltaY_)&&(c=goog.math.clamp(c,-this.maxDeltaY_,this.maxDeltaY_));this.isRtl_&&(b=-b);b=new goog.events.MouseWheelEvent(d,a,b,c);this.dispatchEvent(b)};goog.events.MouseWheelHandler.smartScale_=function(a,b){return goog.userAgent.WEBKIT&&(goog.userAgent.MAC||goog.userAgent.LINUX)&&0!=a%b?a:a/b};
|
|
goog.events.MouseWheelHandler.prototype.disposeInternal=function(){goog.events.MouseWheelHandler.superClass_.disposeInternal.call(this);goog.events.unlistenByKey(this.listenKey_);this.listenKey_=null};goog.events.MouseWheelEvent=function(a,b,c,d){goog.events.BrowserEvent.call(this,b);this.type=goog.events.MouseWheelHandler.EventType.MOUSEWHEEL;this.detail=a;this.deltaX=c;this.deltaY=d};goog.inherits(goog.events.MouseWheelEvent,goog.events.BrowserEvent);ol.control={};ol.control.Control=function(a){ol.Object.call(this);this.element=goog.isDef(a.element)?a.element:null;this.target_=goog.isDef(a.target)?goog.dom.getElement(a.target):null;this.map_=null;this.listenerKeys=[]};goog.inherits(ol.control.Control,ol.Object);ol.control.Control.prototype.disposeInternal=function(){goog.dom.removeNode(this.element);ol.control.Control.superClass_.disposeInternal.call(this)};ol.control.Control.prototype.getMap=function(){return this.map_};
|
|
ol.control.Control.prototype.handleMapPostrender=goog.nullFunction;
|
|
ol.control.Control.prototype.setMap=function(a){goog.isNull(this.map_)||goog.dom.removeNode(this.element);goog.array.isEmpty(this.listenerKeys)||(goog.array.forEach(this.listenerKeys,goog.events.unlistenByKey),this.listenerKeys.length=0);this.map_=a;if(!goog.isNull(this.map_)){var b=goog.isNull(this.target_)?a.getOverlayContainerStopEvent():this.target_;goog.dom.appendChild(b,this.element);this.handleMapPostrender!==goog.nullFunction&&this.listenerKeys.push(goog.events.listen(a,ol.MapEventType.POSTRENDER,
|
|
this.handleMapPostrender,!1,this));a.render()}};ol.css={};ol.css.CLASS_UNSELECTABLE="ol-unselectable";ol.css.CLASS_UNSUPPORTED="ol-unsupported";ol.control.Attribution=function(a){a=goog.isDef(a)?a:{};this.ulElement_=goog.dom.createElement(goog.dom.TagName.UL);var b=goog.isDef(a.className)?a.className:"ol-attribution",b=goog.dom.createDom(goog.dom.TagName.DIV,{"class":b+" "+ol.css.CLASS_UNSELECTABLE},this.ulElement_);ol.control.Control.call(this,{element:b,target:a.target});this.renderedVisible_=!0;this.attributionElements_={};this.attributionElementRenderedVisible_={}};goog.inherits(ol.control.Attribution,ol.control.Control);
|
|
ol.control.Attribution.prototype.getSourceAttributions=function(a){var b,c,d,e,f,g,h,k,l,m=a.layersArray,n=goog.object.clone(a.attributions),p={};b=0;for(c=m.length;b<c;b++)if(d=m[b].getSource(),l=goog.getUid(d).toString(),k=d.getAttributions(),!goog.isNull(k))for(d=0,e=k.length;d<e;d++)g=k[d],h=goog.getUid(g).toString(),h in n||(f=a.usedTiles[l],goog.isDef(f)&&g.intersectsAnyTileRange(f)?(h in p&&delete p[h],n[h]=g):p[h]=g);return[n,p]};ol.control.Attribution.prototype.handleMapPostrender=function(a){this.updateElement_(a.frameState)};
|
|
ol.control.Attribution.prototype.updateElement_=function(a){if(goog.isNull(a))this.renderedVisible_&&(goog.style.setElementShown(this.element,!1),this.renderedVisible_=!1);else{var b=this.getSourceAttributions(a);a=b[0];var b=b[1],c,d;for(d in this.attributionElements_)d in a?(this.attributionElementRenderedVisible_[d]||(goog.style.setElementShown(this.attributionElements_[d],!0),this.attributionElementRenderedVisible_[d]=!0),delete a[d]):d in b?(this.attributionElementRenderedVisible_[d]&&(goog.style.setElementShown(this.attributionElements_[d],
|
|
!1),delete this.attributionElementRenderedVisible_[d]),delete b[d]):(goog.dom.removeNode(this.attributionElements_[d]),delete this.attributionElements_[d],delete this.attributionElementRenderedVisible_[d]);for(d in a)c=goog.dom.createElement(goog.dom.TagName.LI),c.innerHTML=a[d].getHTML(),goog.dom.appendChild(this.ulElement_,c),this.attributionElements_[d]=c,this.attributionElementRenderedVisible_[d]=!0;for(d in b)c=goog.dom.createElement(goog.dom.TagName.LI),c.innerHTML=b[d].getHTML(),goog.style.setElementShown(c,
|
|
!1),goog.dom.appendChild(this.ulElement_,c),this.attributionElements_[d]=c;d=!goog.object.isEmpty(this.attributionElementRenderedVisible_);this.renderedVisible_!=d&&(goog.style.setElementShown(this.element,d),this.renderedVisible_=d)}};ol.control.Logo=function(a){a=goog.isDef(a)?a:{};this.ulElement_=goog.dom.createElement(goog.dom.TagName.UL);var b=goog.isDef(a.className)?a.className:"ol-logo",b=goog.dom.createDom(goog.dom.TagName.DIV,{"class":b+" "+ol.css.CLASS_UNSELECTABLE},this.ulElement_);ol.control.Control.call(this,{element:b,target:a.target});this.renderedVisible_=!0;this.logoElements_={}};goog.inherits(ol.control.Logo,ol.control.Control);ol.control.Logo.prototype.handleMapPostrender=function(a){this.updateElement_(a.frameState)};
|
|
ol.control.Logo.prototype.updateElement_=function(a){if(goog.isNull(a))this.renderedVisible_&&(goog.style.setElementShown(this.element,!1),this.renderedVisible_=!1);else{var b;a=a.logos;var c=this.logoElements_;for(b in c)b in a||(goog.dom.removeNode(c[b]),delete c[b]);for(var d in a)if(!(d in c)){b=new Image;b.src=d;var e=a[d];""===e?e=b:(e=goog.dom.createDom(goog.dom.TagName.A,{href:e,target:"_blank"}),e.appendChild(b));b=goog.dom.createDom(goog.dom.TagName.LI,void 0,e);goog.dom.appendChild(this.ulElement_,
|
|
b);c[d]=b}d=!goog.object.isEmpty(a);this.renderedVisible_!=d&&(goog.style.setElementShown(this.element,d),this.renderedVisible_=d)}};ol.control.Zoom=function(a){a=goog.isDef(a)?a:{};var b=goog.isDef(a.className)?a.className:"ol-zoom",c=goog.isDef(a.delta)?a.delta:1,d=goog.isDef(a.zoomInLabel)?a.zoomInLabel:"+",e=goog.isDef(a.zoomOutLabel)?a.zoomOutLabel:"\u2212",f=goog.isDef(a.zoomInTipLabel)?a.zoomInTipLabel:"Zoom in",g=goog.isDef(a.zoomOutTipLabel)?a.zoomOutTipLabel:"Zoom out",f=goog.dom.createDom(goog.dom.TagName.SPAN,{role:"tooltip"},f),d=goog.dom.createDom(goog.dom.TagName.BUTTON,{"class":b+"-in ol-has-tooltip",name:"ZoomIn",
|
|
type:"button"},f,d);goog.events.listen(d,[goog.events.EventType.TOUCHEND,goog.events.EventType.CLICK],goog.partial(ol.control.Zoom.prototype.zoomByDelta_,c),!1,this);goog.events.listen(d,[goog.events.EventType.MOUSEOUT,goog.events.EventType.FOCUSOUT],function(){this.blur()},!1);g=goog.dom.createDom(goog.dom.TagName.SPAN,{role:"tooltip",type:"button"},g);e=goog.dom.createDom(goog.dom.TagName.BUTTON,{"class":b+"-out ol-has-tooltip",name:"ZoomOut"},g,e);goog.events.listen(e,[goog.events.EventType.TOUCHEND,
|
|
goog.events.EventType.CLICK],goog.partial(ol.control.Zoom.prototype.zoomByDelta_,-c),!1,this);goog.events.listen(e,[goog.events.EventType.MOUSEOUT,goog.events.EventType.FOCUSOUT],function(){this.blur()},!1);b=goog.dom.createDom(goog.dom.TagName.DIV,b+" "+ol.css.CLASS_UNSELECTABLE,d,e);ol.control.Control.call(this,{element:b,target:a.target});this.duration_=goog.isDef(a.duration)?a.duration:250};goog.inherits(ol.control.Zoom,ol.control.Control);
|
|
ol.control.Zoom.prototype.zoomByDelta_=function(a,b){b.preventDefault();var c=this.getMap(),d=c.getView().getView2D(),e=d.getResolution();goog.isDef(e)&&(0<this.duration_&&c.beforeRender(ol.animation.zoom({resolution:e,duration:this.duration_,easing:ol.easing.easeOut})),c=d.constrainResolution(e,a),d.setResolution(c))};ol.control.defaults=function(a){var b=goog.isDef(a)?a:{};a=new ol.Collection;if(goog.isDef(b.zoom)?b.zoom:1){var c=goog.isDef(b.zoomOptions)?b.zoomOptions:void 0;a.push(new ol.control.Zoom(c))}if(goog.isDef(b.attribution)?b.attribution:1)c=goog.isDef(b.attributionOptions)?b.attributionOptions:void 0,a.push(new ol.control.Attribution(c));if(goog.isDef(b.logo)?b.logo:1)b=goog.isDef(b.logoOptions)?b.logoOptions:void 0,a.push(new ol.control.Logo(b));return a};ol.Kinetic=function(a,b,c){this.decay_=a;this.minVelocity_=b;this.delay_=c;this.points_=[];this.initialVelocity_=this.angle_=0};ol.Kinetic.prototype.begin=function(){this.initialVelocity_=this.angle_=this.points_.length=0};ol.Kinetic.prototype.update=function(a,b){this.points_.push(a,b,goog.now())};
|
|
ol.Kinetic.prototype.end=function(){var a=goog.now()-this.delay_,b=this.points_.length-3;if(this.points_[b+2]<a)return!1;for(var c=b-3;0<=c&&this.points_[c+2]>a;)c-=3;if(0<=c){var a=this.points_[b+2]-this.points_[c+2],d=this.points_[b]-this.points_[c],b=this.points_[b+1]-this.points_[c+1];this.angle_=Math.atan2(b,d);this.initialVelocity_=Math.sqrt(d*d+b*b)/a;return this.initialVelocity_>this.minVelocity_}return!1};
|
|
ol.Kinetic.prototype.pan=function(a){var b=this.decay_,c=this.initialVelocity_,d=this.minVelocity_,e=this.getDuration_();return ol.animation.pan({source:a,duration:e,easing:function(a){return c*(Math.exp(b*a*e)-1)/(d-c)}})};ol.Kinetic.prototype.getDuration_=function(){return Math.log(this.minVelocity_/this.initialVelocity_)/this.decay_};ol.Kinetic.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_};ol.Kinetic.prototype.getAngle=function(){return this.angle_};ol.interaction.DoubleClickZoom=function(a){a=goog.isDef(a)?a:{};this.delta_=goog.isDef(a.delta)?a.delta:1;ol.interaction.Interaction.call(this);this.duration_=goog.isDef(a.duration)?a.duration:250};goog.inherits(ol.interaction.DoubleClickZoom,ol.interaction.Interaction);
|
|
ol.interaction.DoubleClickZoom.prototype.handleMapBrowserEvent=function(a){var b=!1,c=a.browserEvent;if(a.type==ol.MapBrowserEvent.EventType.DBLCLICK){var b=a.map,d=a.coordinate,c=c.shiftKey?-this.delta_:this.delta_,e=b.getView().getView2D();ol.interaction.Interaction.zoomByDelta(b,e,c,d,this.duration_);a.preventDefault();b=!0}return!b};ol.interaction.DragPan=function(a){ol.interaction.Drag.call(this);a=goog.isDef(a)?a:{};this.condition_=goog.isDef(a.condition)?a.condition:ol.events.condition.noModifierKeys;this.kinetic_=a.kinetic;this.kineticPreRenderFn_=null};goog.inherits(ol.interaction.DragPan,ol.interaction.Drag);
|
|
ol.interaction.DragPan.prototype.handleDrag=function(a){this.kinetic_&&this.kinetic_.update(a.browserEvent.clientX,a.browserEvent.clientY);a=a.map;var b=a.getView(),c=b.getView2DState(),d=[-c.resolution*this.deltaX,c.resolution*this.deltaY];ol.coordinate.rotate(d,c.rotation);ol.coordinate.add(d,this.startCenter);d=b.constrainCenter(d);a.render();b.setCenter(d)};
|
|
ol.interaction.DragPan.prototype.handleDragEnd=function(a){a=a.map;var b=a.getView();b.setHint(ol.ViewHint.INTERACTING,-1);if(this.kinetic_&&this.kinetic_.end()){var b=b.getView2D(),c=b.getView2DState(),d=this.kinetic_.getDistance(),e=this.kinetic_.getAngle();this.kineticPreRenderFn_=this.kinetic_.pan(c.center);a.beforeRender(this.kineticPreRenderFn_);c=a.getPixelFromCoordinate(c.center);d=a.getCoordinateFromPixel([c[0]-d*Math.cos(e),c[1]-d*Math.sin(e)]);d=b.constrainCenter(d);b.setCenter(d)}a.render()};
|
|
ol.interaction.DragPan.prototype.handleDragStart=function(a){var b=a.browserEvent;return b.isMouseActionButton()&&this.condition_(a)?(this.kinetic_&&(this.kinetic_.begin(),this.kinetic_.update(b.clientX,b.clientY)),a=a.map,a.getView().setHint(ol.ViewHint.INTERACTING,1),a.render(),!0):!1};
|
|
ol.interaction.DragPan.prototype.handleDown=function(a){var b=a.map,c=b.getView();!goog.isNull(this.kineticPreRenderFn_)&&b.removePreRenderFunction(this.kineticPreRenderFn_)&&(b.render(),c.setCenter(a.frameState.view2DState.center),this.kineticPreRenderFn_=null)};ol.interaction.DRAGROTATE_ANIMATION_DURATION=250;ol.interaction.DragRotate=function(a){a=goog.isDef(a)?a:{};ol.interaction.Drag.call(this);this.condition_=goog.isDef(a.condition)?a.condition:ol.events.condition.altShiftKeysOnly;this.lastAngle_=void 0};goog.inherits(ol.interaction.DragRotate,ol.interaction.Drag);
|
|
ol.interaction.DragRotate.prototype.handleDrag=function(a){var b=a.map,c=b.getSize();a=a.pixel;c=Math.atan2(c[1]/2-a[1],a[0]-c[0]/2);if(goog.isDef(this.lastAngle_)){a=c-this.lastAngle_;var d=b.getView().getView2D(),e=d.getView2DState();b.render();ol.interaction.Interaction.rotateWithoutConstraints(b,d,e.rotation-a)}this.lastAngle_=c};
|
|
ol.interaction.DragRotate.prototype.handleDragEnd=function(a){a=a.map;var b=a.getView();b.setHint(ol.ViewHint.INTERACTING,-1);var b=b.getView2D(),c=b.getView2DState();ol.interaction.Interaction.rotate(a,b,c.rotation,void 0,ol.interaction.DRAGROTATE_ANIMATION_DURATION)};ol.interaction.DragRotate.prototype.handleDragStart=function(a){return a.browserEvent.isMouseActionButton()&&this.condition_(a)?(a=a.map,a.getView().setHint(ol.ViewHint.INTERACTING,1),a.render(),this.lastAngle_=void 0,!0):!1};ol.interaction.DRAGZOOM_ANIMATION_DURATION=200;ol.interaction.DragZoom=function(a){var b=goog.isDef(a)?a:{};a=goog.isDef(b.condition)?b.condition:ol.events.condition.shiftKeyOnly;b=goog.isDef(b.style)?b.style:new ol.style.Style({stroke:new ol.style.Stroke({color:[0,0,255,1]})});ol.interaction.DragBox.call(this,{condition:a,style:b})};goog.inherits(ol.interaction.DragZoom,ol.interaction.DragBox);
|
|
ol.interaction.DragZoom.prototype.onBoxEnd=function(){var a=this.getMap(),b=a.getView().getView2D(),c=this.getGeometry().getExtent(),d=ol.extent.getCenter(c);ol.interaction.Interaction.zoom(a,b,b.getResolutionForExtent(c,a.getSize()),d,ol.interaction.DRAGZOOM_ANIMATION_DURATION)};ol.interaction.KEYBOARD_PAN_DURATION=100;ol.interaction.KeyboardPan=function(a){ol.interaction.Interaction.call(this);a=goog.isDef(a)?a:{};this.condition_=goog.isDef(a.condition)?a.condition:goog.functions.and(ol.events.condition.noModifierKeys,ol.events.condition.targetNotEditable);this.pixelDelta_=goog.isDef(a.pixelDelta)?a.pixelDelta:128};goog.inherits(ol.interaction.KeyboardPan,ol.interaction.Interaction);
|
|
ol.interaction.KeyboardPan.prototype.handleMapBrowserEvent=function(a){var b=!1;if(a.type==goog.events.KeyHandler.EventType.KEY){var c=a.browserEvent.keyCode;if(this.condition_(a)&&(c==goog.events.KeyCodes.DOWN||c==goog.events.KeyCodes.LEFT||c==goog.events.KeyCodes.RIGHT||c==goog.events.KeyCodes.UP)){var b=a.map,d=b.getView(),e=d.getView2DState(),f=e.resolution*this.pixelDelta_,g=0,h=0;c==goog.events.KeyCodes.DOWN?h=-f:c==goog.events.KeyCodes.LEFT?g=-f:c==goog.events.KeyCodes.RIGHT?g=f:h=f;c=[g,h];
|
|
ol.coordinate.rotate(c,e.rotation);ol.interaction.Interaction.pan(b,d,c,ol.interaction.KEYBOARD_PAN_DURATION);a.preventDefault();b=!0}}return!b};ol.interaction.KeyboardZoom=function(a){ol.interaction.Interaction.call(this);a=goog.isDef(a)?a:{};this.condition_=goog.isDef(a.condition)?a.condition:ol.events.condition.targetNotEditable;this.delta_=goog.isDef(a.delta)?a.delta:1;this.duration_=goog.isDef(a.duration)?a.duration:100};goog.inherits(ol.interaction.KeyboardZoom,ol.interaction.Interaction);
|
|
ol.interaction.KeyboardZoom.prototype.handleMapBrowserEvent=function(a){var b=!1;if(a.type==goog.events.KeyHandler.EventType.KEY){var c=a.browserEvent.charCode;if(this.condition_(a)&&(43==c||45==c)){b=a.map;c=43==c?this.delta_:-this.delta_;b.render();var d=b.getView().getView2D();ol.interaction.Interaction.zoomByDelta(b,d,c,void 0,this.duration_);a.preventDefault();b=!0}}return!b};ol.interaction.MOUSEWHEELZOOM_MAXDELTA=1;ol.interaction.MOUSEWHEELZOOM_TIMEOUT_DURATION=80;ol.interaction.MouseWheelZoom=function(a){a=goog.isDef(a)?a:{};ol.interaction.Interaction.call(this);this.delta_=0;this.duration_=goog.isDef(a.duration)?a.duration:250;this.lastAnchor_=null;this.timeoutId_=this.startTime_=void 0};goog.inherits(ol.interaction.MouseWheelZoom,ol.interaction.Interaction);
|
|
ol.interaction.MouseWheelZoom.prototype.handleMapBrowserEvent=function(a){var b=!1;if(a.type==goog.events.MouseWheelHandler.EventType.MOUSEWHEEL){var b=a.map,c=a.browserEvent;this.lastAnchor_=a.coordinate;this.delta_+=c.deltaY/3;goog.isDef(this.startTime_)||(this.startTime_=goog.now());c=Math.max(ol.interaction.MOUSEWHEELZOOM_TIMEOUT_DURATION-(goog.now()-this.startTime_),0);goog.global.clearTimeout(this.timeoutId_);this.timeoutId_=goog.global.setTimeout(goog.bind(this.doZoom_,this,b),c);a.preventDefault();
|
|
b=!0}return!b};ol.interaction.MouseWheelZoom.prototype.doZoom_=function(a){var b=ol.interaction.MOUSEWHEELZOOM_MAXDELTA,b=goog.math.clamp(this.delta_,-b,b),c=a.getView().getView2D();a.render();ol.interaction.Interaction.zoomByDelta(a,c,-b,this.lastAnchor_,this.duration_);this.delta_=0;this.lastAnchor_=null;this.timeoutId_=this.startTime_=void 0};ol.interaction.Touch=function(){ol.interaction.Interaction.call(this);this.handled_=!1;this.trackedTouches_={};this.targetTouches=[]};goog.inherits(ol.interaction.Touch,ol.interaction.Interaction);ol.interaction.Touch.centroid=function(a){for(var b=a.length,c=0,d=0,e=0;e<b;e++)c+=a[e].clientX,d+=a[e].clientY;return[c/b,d/b]};ol.interaction.Touch.isTouchEvent_=function(a){a=a.type;return a===ol.MapBrowserEvent.EventType.TOUCHSTART||a===ol.MapBrowserEvent.EventType.TOUCHMOVE||a===ol.MapBrowserEvent.EventType.TOUCHEND};
|
|
ol.interaction.Touch.prototype.updateTrackedTouches_=function(a){if(ol.interaction.Touch.isTouchEvent_(a)){var b=a.originalEvent;goog.isDef(b.targetTouches)?this.targetTouches=b.targetTouches:goog.isDef(b.pointerId)&&(a.type==ol.MapBrowserEvent.EventType.TOUCHEND?delete this.trackedTouches_[b.pointerId]:this.trackedTouches_[b.pointerId]=b,this.targetTouches=goog.object.getValues(this.trackedTouches_))}};ol.interaction.Touch.prototype.handleTouchMove=goog.nullFunction;
|
|
ol.interaction.Touch.prototype.handleTouchEnd=goog.functions.FALSE;ol.interaction.Touch.prototype.handleTouchStart=goog.functions.FALSE;
|
|
ol.interaction.Touch.prototype.handleMapBrowserEvent=function(a){var b=a.map.getView();this.updateTrackedTouches_(a);this.handled_&&(a.type==ol.MapBrowserEvent.EventType.TOUCHMOVE?this.handleTouchMove(a):a.type==ol.MapBrowserEvent.EventType.TOUCHEND&&((this.handled_=this.handleTouchEnd(a))||b.setHint(ol.ViewHint.INTERACTING,-1)));a.type==ol.MapBrowserEvent.EventType.TOUCHSTART&&(a=this.handleTouchStart(a),!this.handled_&&a&&b.setHint(ol.ViewHint.INTERACTING,1),this.handled_=a);return!0};ol.interaction.TouchPan=function(a){ol.interaction.Touch.call(this);this.kinetic_=(goog.isDef(a)?a:{}).kinetic;this.lastCentroid=this.kineticPreRenderFn_=null;this.noKinetic_=!1};goog.inherits(ol.interaction.TouchPan,ol.interaction.Touch);
|
|
ol.interaction.TouchPan.prototype.handleTouchMove=function(a){var b=ol.interaction.Touch.centroid(this.targetTouches);if(!goog.isNull(this.lastCentroid)){this.kinetic_&&this.kinetic_.update(b[0],b[1]);var c=this.lastCentroid[0]-b[0],d=b[1]-this.lastCentroid[1];a=a.map;var e=a.getView().getView2D(),f=e.getView2DState(),c=[c,d];ol.coordinate.scale(c,f.resolution);ol.coordinate.rotate(c,f.rotation);ol.coordinate.add(c,f.center);c=e.constrainCenter(c);a.render();e.setCenter(c)}this.lastCentroid=b};
|
|
ol.interaction.TouchPan.prototype.handleTouchEnd=function(a){a=a.map;var b=a.getView().getView2D();if(0===this.targetTouches.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var c=this.kinetic_.getDistance(),d=this.kinetic_.getAngle(),e=b.getCenter();this.kineticPreRenderFn_=this.kinetic_.pan(e);a.beforeRender(this.kineticPreRenderFn_);e=a.getPixelFromCoordinate(e);c=a.getCoordinateFromPixel([e[0]-c*Math.cos(d),e[1]-c*Math.sin(d)]);c=b.constrainCenter(c);b.setCenter(c)}a.render();
|
|
return!1}this.lastCentroid=null;return!0};ol.interaction.TouchPan.prototype.handleTouchStart=function(a){if(0<this.targetTouches.length){var b=a.map,c=b.getView().getView2D();this.lastCentroid=null;b.render();!goog.isNull(this.kineticPreRenderFn_)&&b.removePreRenderFunction(this.kineticPreRenderFn_)&&(c.setCenter(a.frameState.view2DState.center),this.kineticPreRenderFn_=null);this.kinetic_&&this.kinetic_.begin();this.noKinetic_=1<this.targetTouches.length;return!0}return!1};ol.interaction.TOUCHROTATE_ANIMATION_DURATION=250;ol.interaction.TouchRotate=function(a){ol.interaction.Touch.call(this);a=goog.isDef(a)?a:{};this.anchor_=null;this.lastAngle_=void 0;this.rotating_=!1;this.rotationDelta_=0;this.threshold_=goog.isDef(a.threshold)?a.threshold:0.3};goog.inherits(ol.interaction.TouchRotate,ol.interaction.Touch);
|
|
ol.interaction.TouchRotate.prototype.handleTouchMove=function(a){var b=0,c=this.targetTouches[0],d=this.targetTouches[1],c=Math.atan2(d.clientY-c.clientY,d.clientX-c.clientX);goog.isDef(this.lastAngle_)&&(b=c-this.lastAngle_,this.rotationDelta_+=b,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0));this.lastAngle_=c;a=a.map;c=goog.style.getClientPosition(a.getViewport());d=ol.interaction.Touch.centroid(this.targetTouches);d[0]-=c.x;d[1]-=c.y;this.anchor_=a.getCoordinateFromPixel(d);
|
|
this.rotating_&&(c=a.getView().getView2D(),d=c.getView2DState(),a.render(),ol.interaction.Interaction.rotateWithoutConstraints(a,c,d.rotation+b,this.anchor_))};ol.interaction.TouchRotate.prototype.handleTouchEnd=function(a){if(2>this.targetTouches.length){a=a.map;var b=a.getView().getView2D(),c=b.getView2DState();this.rotating_&&ol.interaction.Interaction.rotate(a,b,c.rotation,this.anchor_,ol.interaction.TOUCHROTATE_ANIMATION_DURATION);return!1}return!0};
|
|
ol.interaction.TouchRotate.prototype.handleTouchStart=function(a){return 2<=this.targetTouches.length?(a=a.map,this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,a.render(),!0):!1};ol.interaction.TouchZoom=function(a){a=goog.isDef(a)?a:{};ol.interaction.Touch.call(this);this.anchor_=null;this.duration_=goog.isDef(a.duration)?a.duration:400;this.lastDistance_=void 0;this.lastScaleDelta_=1};goog.inherits(ol.interaction.TouchZoom,ol.interaction.Touch);
|
|
ol.interaction.TouchZoom.prototype.handleTouchMove=function(a){var b=1,c=this.targetTouches[0],d=this.targetTouches[1],e=c.clientX-d.clientX,c=c.clientY-d.clientY,e=Math.sqrt(e*e+c*c);goog.isDef(this.lastDistance_)&&(b=this.lastDistance_/e);this.lastDistance_=e;1!=b&&(this.lastScaleDelta_=b);a=a.map;var e=a.getView().getView2D(),c=e.getView2DState(),d=goog.style.getClientPosition(a.getViewport()),f=ol.interaction.Touch.centroid(this.targetTouches);f[0]-=d.x;f[1]-=d.y;this.anchor_=a.getCoordinateFromPixel(f);
|
|
a.render();ol.interaction.Interaction.zoomWithoutConstraints(a,e,c.resolution*b,this.anchor_)};ol.interaction.TouchZoom.prototype.handleTouchEnd=function(a){if(2>this.targetTouches.length){a=a.map;var b=a.getView().getView2D(),c=b.getView2DState();ol.interaction.Interaction.zoom(a,b,c.resolution,this.anchor_,this.duration_,this.lastScaleDelta_-1);return!1}return!0};
|
|
ol.interaction.TouchZoom.prototype.handleTouchStart=function(a){return 2<=this.targetTouches.length?(a=a.map,this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,a.render(),!0):!1};ol.interaction.defaults=function(a){a=goog.isDef(a)?a:{};var b=new ol.Collection,c=new ol.Kinetic(-0.005,0.05,100);(goog.isDef(a.altShiftDragRotate)?a.altShiftDragRotate:1)&&b.push(new ol.interaction.DragRotate);(goog.isDef(a.doubleClickZoom)?a.doubleClickZoom:1)&&b.push(new ol.interaction.DoubleClickZoom({delta:a.zoomDelta,duration:a.zoomDuration}));(goog.isDef(a.touchPan)?a.touchPan:1)&&b.push(new ol.interaction.TouchPan({kinetic:c}));(goog.isDef(a.touchRotate)?a.touchRotate:1)&&b.push(new ol.interaction.TouchRotate);
|
|
(goog.isDef(a.touchZoom)?a.touchZoom:1)&&b.push(new ol.interaction.TouchZoom({duration:a.zoomDuration}));(goog.isDef(a.dragPan)?a.dragPan:1)&&b.push(new ol.interaction.DragPan({kinetic:c}));if(goog.isDef(a.keyboard)?a.keyboard:1)b.push(new ol.interaction.KeyboardPan),b.push(new ol.interaction.KeyboardZoom({delta:a.zoomDelta,duration:a.zoomDuration}));(goog.isDef(a.mouseWheelZoom)?a.mouseWheelZoom:1)&&b.push(new ol.interaction.MouseWheelZoom({duration:a.zoomDuration}));(goog.isDef(a.shiftDragZoom)?
|
|
a.shiftDragZoom:1)&&b.push(new ol.interaction.DragZoom);return b};ol.layer.GroupProperty={LAYERS:"layers"};ol.layer.Group=function(a){var b=goog.isDef(a)?a:{};a=goog.object.clone(b);delete a.layers;b=b.layers;ol.layer.Base.call(this,a);this.listenerKeys_=null;goog.events.listen(this,ol.Object.getChangeEventType(ol.layer.GroupProperty.LAYERS),this.handleLayersChanged_,!1,this);goog.isDef(b)?goog.isArray(b)&&(b=new ol.Collection(goog.array.clone(b))):b=new ol.Collection;this.setLayers(b)};goog.inherits(ol.layer.Group,ol.layer.Base);
|
|
ol.layer.Group.prototype.handleLayerChange_=function(){this.getVisible()&&this.dispatchChangeEvent()};
|
|
ol.layer.Group.prototype.handleLayersChanged_=function(a){goog.isNull(this.listenerKeys_)||(goog.array.forEach(goog.object.getValues(this.listenerKeys_),goog.events.unlistenByKey),this.listenerKeys_=null);a=this.getLayers();if(goog.isDefAndNotNull(a)){this.listenerKeys_={add:goog.events.listen(a,ol.CollectionEventType.ADD,this.handleLayersAdd_,!1,this),remove:goog.events.listen(a,ol.CollectionEventType.REMOVE,this.handleLayersRemove_,!1,this)};a=a.getArray();var b,c,d;b=0;for(c=a.length;b<c;b++)d=
|
|
a[b],this.listenerKeys_[goog.getUid(d).toString()]=goog.events.listen(d,[ol.ObjectEventType.PROPERTYCHANGE,goog.events.EventType.CHANGE],this.handleLayerChange_,!1,this)}this.dispatchChangeEvent()};ol.layer.Group.prototype.handleLayersAdd_=function(a){a=a.element;this.listenerKeys_[goog.getUid(a).toString()]=goog.events.listen(a,[ol.ObjectEventType.PROPERTYCHANGE,goog.events.EventType.CHANGE],this.handleLayerChange_,!1,this);this.dispatchChangeEvent()};
|
|
ol.layer.Group.prototype.handleLayersRemove_=function(a){a=goog.getUid(a.element).toString();goog.events.unlistenByKey(this.listenerKeys_[a]);delete this.listenerKeys_[a];this.dispatchChangeEvent()};ol.layer.Group.prototype.getLayers=function(){return this.get(ol.layer.GroupProperty.LAYERS)};goog.exportProperty(ol.layer.Group.prototype,"getLayers",ol.layer.Group.prototype.getLayers);ol.layer.Group.prototype.setLayers=function(a){this.set(ol.layer.GroupProperty.LAYERS,a)};
|
|
goog.exportProperty(ol.layer.Group.prototype,"setLayers",ol.layer.Group.prototype.setLayers);ol.layer.Group.prototype.getLayersArray=function(a){var b=goog.isDef(a)?a:[];this.getLayers().forEach(function(a){a.getLayersArray(b)});return b};
|
|
ol.layer.Group.prototype.getLayerStatesArray=function(a){var b=goog.isDef(a)?a:{layers:[],layerStates:[]},c=b.layers.length;this.getLayers().forEach(function(a){a.getLayerStatesArray(b)});a=this.getLayerState();var d,e;for(d=b.layerStates.length;c<d;c++)e=b.layerStates[c],e.brightness=goog.math.clamp(e.brightness+a.brightness,-1,1),e.contrast*=a.contrast,e.hue+=a.hue,e.opacity*=a.opacity,e.saturation*=a.saturation,e.visible=e.visible&&a.visible,e.maxResolution=Math.min(e.maxResolution,a.maxResolution),
|
|
e.minResolution=Math.max(e.minResolution,a.minResolution);return b};ol.layer.Group.prototype.getSourceState=function(){return ol.source.State.READY};ol.math={};ol.math.cosh=function(a){return(Math.exp(a)+Math.exp(-a))/2};ol.math.coth=function(a){a=Math.exp(-2*a);return(1+a)/(1-a)};ol.math.csch=function(a){return 2/(Math.exp(a)-Math.exp(-a))};ol.math.roundUpToPowerOfTwo=function(a){return Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))};ol.math.sech=function(a){return 2/(Math.exp(a)+Math.exp(-a))};ol.math.sinh=function(a){return(Math.exp(a)-Math.exp(-a))/2};ol.math.tanh=function(a){a=Math.exp(-2*a);return(1-a)/(1+a)};ol.proj.EPSG3857=function(a){ol.proj.Projection.call(this,{code:a,units:ol.proj.Units.METERS,extent:ol.proj.EPSG3857.EXTENT,global:!0})};goog.inherits(ol.proj.EPSG3857,ol.proj.Projection);ol.proj.EPSG3857.RADIUS=6378137;ol.proj.EPSG3857.HALF_SIZE=Math.PI*ol.proj.EPSG3857.RADIUS;ol.proj.EPSG3857.EXTENT=[-ol.proj.EPSG3857.HALF_SIZE,-ol.proj.EPSG3857.HALF_SIZE,ol.proj.EPSG3857.HALF_SIZE,ol.proj.EPSG3857.HALF_SIZE];ol.proj.EPSG3857.CODES=["EPSG:3857","EPSG:102100","EPSG:102113","EPSG:900913","urn:ogc:def:crs:EPSG:6.18:3:3857"];
|
|
ol.proj.EPSG3857.PROJECTIONS=goog.array.map(ol.proj.EPSG3857.CODES,function(a){return new ol.proj.EPSG3857(a)});ol.proj.EPSG3857.fromEPSG4326=function(a,b,c){var d=a.length;c=1<c?c:2;goog.isDef(b)||(b=2<c?a.slice():Array(d));for(var e=0;e<d;e+=c)b[e]=ol.proj.EPSG3857.RADIUS*Math.PI*a[e]/180,b[e+1]=ol.proj.EPSG3857.RADIUS*Math.log(Math.tan(Math.PI*(a[e+1]+90)/360));return b};
|
|
ol.proj.EPSG3857.toEPSG4326=function(a,b,c){var d=a.length;c=1<c?c:2;goog.isDef(b)||(b=2<c?a.slice():Array(d));for(var e=0;e<d;e+=c)b[e]=180*a[e]/(ol.proj.EPSG3857.RADIUS*Math.PI),b[e+1]=360*Math.atan(Math.exp(a[e+1]/ol.proj.EPSG3857.RADIUS))/Math.PI-90;return b};ol.proj.EPSG3857.prototype.getPointResolution=function(a,b){return a/ol.math.cosh(b[1]/ol.proj.EPSG3857.RADIUS)};ol.proj.EPSG4326=function(a,b){ol.proj.Projection.call(this,{code:a,units:ol.proj.Units.DEGREES,extent:ol.proj.EPSG4326.EXTENT,axisOrientation:b,global:!0})};goog.inherits(ol.proj.EPSG4326,ol.proj.Projection);ol.proj.EPSG4326.EXTENT=[-180,-90,180,90];
|
|
ol.proj.EPSG4326.PROJECTIONS=[new ol.proj.EPSG4326("CRS:84"),new ol.proj.EPSG4326("EPSG:4326","neu"),new ol.proj.EPSG4326("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new ol.proj.EPSG4326("urn:ogc:def:crs:OGC:1.3:CRS84"),new ol.proj.EPSG4326("urn:ogc:def:crs:OGC:2:84"),new ol.proj.EPSG4326("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new ol.proj.EPSG4326("urn:x-ogc:def:crs:EPSG:4326","neu")];ol.proj.EPSG4326.prototype.getPointResolution=function(a,b){return a};ol.proj.common={};ol.proj.common.add=function(){ol.proj.addEquivalentProjections(ol.proj.EPSG3857.PROJECTIONS);ol.proj.addEquivalentProjections(ol.proj.EPSG4326.PROJECTIONS);ol.proj.addEquivalentTransforms(ol.proj.EPSG4326.PROJECTIONS,ol.proj.EPSG3857.PROJECTIONS,ol.proj.EPSG3857.fromEPSG4326,ol.proj.EPSG3857.toEPSG4326)};ol.ImageState={IDLE:0,LOADING:1,LOADED:2,ERROR:3};ol.ImageBase=function(a,b,c,d,e){goog.events.EventTarget.call(this);this.attributions_=e;this.extent_=a;this.pixelRatio_=c;this.resolution_=b;this.state=d};goog.inherits(ol.ImageBase,goog.events.EventTarget);ol.ImageBase.prototype.dispatchChangeEvent=function(){this.dispatchEvent(goog.events.EventType.CHANGE)};ol.ImageBase.prototype.getAttributions=function(){return this.attributions_};ol.ImageBase.prototype.getExtent=function(){return this.extent_};
|
|
ol.ImageBase.prototype.getPixelRatio=function(){return this.pixelRatio_};ol.ImageBase.prototype.getResolution=function(){return this.resolution_};ol.ImageBase.prototype.getState=function(){return this.state};ol.Image=function(a,b,c,d,e,f){ol.ImageBase.call(this,a,b,c,ol.ImageState.IDLE,d);this.src_=e;this.image_=new Image;goog.isNull(f)||(this.image_.crossOrigin=f);this.imageByContext_={};this.imageListenerKeys_=null;this.state=ol.ImageState.IDLE};goog.inherits(ol.Image,ol.ImageBase);
|
|
ol.Image.prototype.getImageElement=function(a){if(goog.isDef(a)){var b=goog.getUid(a);if(b in this.imageByContext_)return this.imageByContext_[b];a=goog.object.isEmpty(this.imageByContext_)?this.image_:this.image_.cloneNode(!1);return this.imageByContext_[b]=a}return this.image_};ol.Image.prototype.handleImageError_=function(){this.state=ol.ImageState.ERROR;this.unlistenImage_();this.dispatchChangeEvent()};
|
|
ol.Image.prototype.handleImageLoad_=function(){this.state=ol.ImageState.LOADED;this.unlistenImage_();this.dispatchChangeEvent()};ol.Image.prototype.load=function(){this.state==ol.ImageState.IDLE&&(this.state=ol.ImageState.LOADING,this.imageListenerKeys_=[goog.events.listenOnce(this.image_,goog.events.EventType.ERROR,this.handleImageError_,!1,this),goog.events.listenOnce(this.image_,goog.events.EventType.LOAD,this.handleImageLoad_,!1,this)],this.image_.src=this.src_)};
|
|
ol.Image.prototype.unlistenImage_=function(){goog.array.forEach(this.imageListenerKeys_,goog.events.unlistenByKey);this.imageListenerKeys_=null};ol.tilegrid={};ol.DEFAULT_TILE_SIZE=256;ol.DEFAULT_MAX_ZOOM=42;
|
|
ol.tilegrid.TileGrid=function(a){this.minZoom=goog.isDef(a.minZoom)?a.minZoom:0;this.resolutions_=a.resolutions;this.maxZoom=this.resolutions_.length-1;this.origin_=goog.isDef(a.origin)?a.origin:null;this.origins_=null;goog.isDef(a.origins)&&(this.origins_=a.origins);this.tileSizes_=null;goog.isDef(a.tileSizes)&&(this.tileSizes_=a.tileSizes);this.tileSize_=goog.isDef(a.tileSize)?a.tileSize:goog.isNull(this.tileSizes_)?ol.DEFAULT_TILE_SIZE:void 0};
|
|
ol.tilegrid.TileGrid.tmpTileCoord_=new ol.TileCoord(0,0,0);ol.tilegrid.TileGrid.prototype.forEachTileCoordParentTileRange=function(a,b,c,d,e){e=this.getTileCoordExtent(a,e);for(a=a.z-1;a>=this.minZoom;){if(b.call(c,a,this.getTileRangeForExtentAndZ(e,a,d)))return!0;--a}return!1};ol.tilegrid.TileGrid.prototype.getMaxZoom=function(){return this.maxZoom};ol.tilegrid.TileGrid.prototype.getMinZoom=function(){return this.minZoom};
|
|
ol.tilegrid.TileGrid.prototype.getOrigin=function(a){return goog.isNull(this.origin_)?this.origins_[a]:this.origin_};ol.tilegrid.TileGrid.prototype.getResolution=function(a){return this.resolutions_[a]};ol.tilegrid.TileGrid.prototype.getResolutions=function(){return this.resolutions_};ol.tilegrid.TileGrid.prototype.getTileCoordChildTileRange=function(a,b,c){return a.z<this.maxZoom?(c=this.getTileCoordExtent(a,c),this.getTileRangeForExtentAndZ(c,a.z+1,b)):null};
|
|
ol.tilegrid.TileGrid.prototype.getTileRangeExtent=function(a,b,c){var d=this.getOrigin(a),e=this.getResolution(a);a=this.getTileSize(a);return ol.extent.createOrUpdate(d[0]+b.minX*a*e,d[1]+b.minY*a*e,d[0]+(b.maxX+1)*a*e,d[1]+(b.maxY+1)*a*e,c)};
|
|
ol.tilegrid.TileGrid.prototype.getTileRangeForExtentAndResolution=function(a,b,c){var d=ol.tilegrid.TileGrid.tmpTileCoord_;this.getTileCoordForXYAndResolution_(a[0],a[1],b,!1,d);var e=d.x,f=d.y;this.getTileCoordForXYAndResolution_(a[2],a[3],b,!0,d);return ol.TileRange.createOrUpdate(e,d.x,f,d.y,c)};ol.tilegrid.TileGrid.prototype.getTileRangeForExtentAndZ=function(a,b,c){b=this.getResolution(b);return this.getTileRangeForExtentAndResolution(a,b,c)};
|
|
ol.tilegrid.TileGrid.prototype.getTileCoordCenter=function(a){var b=this.getOrigin(a.z),c=this.getResolution(a.z),d=this.getTileSize(a.z);return[b[0]+(a.x+0.5)*d*c,b[1]+(a.y+0.5)*d*c]};ol.tilegrid.TileGrid.prototype.getTileCoordExtent=function(a,b){var c=this.getOrigin(a.z),d=this.getResolution(a.z),e=this.getTileSize(a.z),f=c[0]+a.x*e*d,c=c[1]+a.y*e*d;return ol.extent.createOrUpdate(f,c,f+e*d,c+e*d,b)};
|
|
ol.tilegrid.TileGrid.prototype.getTileCoordForCoordAndResolution=function(a,b,c){return this.getTileCoordForXYAndResolution_(a[0],a[1],b,!1,c)};ol.tilegrid.TileGrid.prototype.getTileCoordForXYAndResolution_=function(a,b,c,d,e){var f=this.getZForResolution(c),g=c/this.getResolution(f),h=this.getOrigin(f),k=this.getTileSize(f);a=g*(a-h[0])/(c*k);b=g*(b-h[1])/(c*k);d?(a=Math.ceil(a)-1,b=Math.ceil(b)-1):(a=Math.floor(a),b=Math.floor(b));return ol.TileCoord.createOrUpdate(f,a,b,e)};
|
|
ol.tilegrid.TileGrid.prototype.getTileCoordForCoordAndZ=function(a,b,c){b=this.getResolution(b);return this.getTileCoordForXYAndResolution_(a[0],a[1],b,!1,c)};ol.tilegrid.TileGrid.prototype.getTileCoordResolution=function(a){return this.resolutions_[a.z]};ol.tilegrid.TileGrid.prototype.getTileSize=function(a){return goog.isDef(this.tileSize_)?this.tileSize_:this.tileSizes_[a]};ol.tilegrid.TileGrid.prototype.getZForResolution=function(a){return ol.array.linearFindNearest(this.resolutions_,a,0)};
|
|
ol.tilegrid.getForProjection=function(a){var b=a.getDefaultTileGrid();goog.isNull(b)&&(b=ol.tilegrid.createForProjection(a),a.setDefaultTileGrid(b));return b};
|
|
ol.tilegrid.createForProjection=function(a,b,c){var d=a.getExtent();a=goog.isNull(d)?360*ol.proj.METERS_PER_UNIT[ol.proj.Units.DEGREES]/a.getMetersPerUnit():Math.max(d[2]-d[0],d[3]-d[1]);b=goog.isDef(b)?b:ol.DEFAULT_MAX_ZOOM;c=goog.isDef(c)?c:ol.DEFAULT_TILE_SIZE;b=Array(b+1);a/=c;for(var e=0,f=b.length;e<f;++e)b[e]=a/Math.pow(2,e);return new ol.tilegrid.TileGrid({origin:goog.isNull(d)?[0,0]:ol.extent.getBottomLeft(d),resolutions:b,tileSize:c})};ol.source.Tile=function(a){ol.source.Source.call(this,{attributions:a.attributions,extent:a.extent,logo:a.logo,projection:a.projection});this.opaque_=goog.isDef(a.opaque)?a.opaque:!1;this.tileGrid=goog.isDef(a.tileGrid)?a.tileGrid:null};goog.inherits(ol.source.Tile,ol.source.Source);ol.source.Tile.prototype.canExpireCache=goog.functions.FALSE;
|
|
ol.source.Tile.prototype.findLoadedTiles=function(a,b,c,d){var e=!0,f,g,h,k;for(h=d.minX;h<=d.maxX;++h)for(k=d.minY;k<=d.maxY;++k)g=this.getKeyZXY(c,h,k),a[c]&&a[c][g]||(f=b(c,h,k),goog.isNull(f)?e=!1:(a[c]||(a[c]={}),a[c][g]=f));return e};ol.source.Tile.prototype.getGutter=function(){return 0};ol.source.Tile.prototype.getKeyZXY=ol.TileCoord.getKeyZXY;ol.source.Tile.prototype.getOpaque=function(){return this.opaque_};ol.source.Tile.prototype.getResolutions=function(){return this.tileGrid.getResolutions()};
|
|
ol.source.Tile.prototype.getTileGrid=function(){return this.tileGrid};ol.source.Tile.prototype.getTileGridForProjection=function(a){return goog.isNull(this.tileGrid)?ol.tilegrid.getForProjection(a):this.tileGrid};ol.source.Tile.prototype.getTilePixelSize=function(a,b,c){return this.getTileGridForProjection(c).getTileSize(a)};ol.source.Tile.prototype.useTile=goog.nullFunction;ol.renderer={};ol.renderer.Layer=function(a,b){goog.Disposable.call(this);this.mapRenderer_=a;this.layer_=b};goog.inherits(ol.renderer.Layer,goog.Disposable);ol.renderer.Layer.prototype.forEachFeatureAtPixel=goog.nullFunction;ol.renderer.Layer.prototype.getLayer=function(){return this.layer_};ol.renderer.Layer.prototype.getMap=function(){return this.mapRenderer_.getMap()};ol.renderer.Layer.prototype.getMapRenderer=function(){return this.mapRenderer_};
|
|
ol.renderer.Layer.prototype.handleImageChange=function(a){a.target.getState()===ol.ImageState.LOADED&&this.renderIfReadyAndVisible()};ol.renderer.Layer.prototype.renderIfReadyAndVisible=function(){var a=this.getLayer();a.getVisible()&&a.getSourceState()==ol.source.State.READY&&this.getMap().render()};ol.renderer.Layer.prototype.scheduleExpireCache=function(a,b){b.canExpireCache()&&a.postRenderFunctions.push(goog.partial(function(a,b,e){b=goog.getUid(a).toString();a.expireCache(e.usedTiles[b])},b))};
|
|
ol.renderer.Layer.prototype.updateAttributions=function(a,b){if(goog.isDefAndNotNull(b)){var c,d,e;d=0;for(e=b.length;d<e;++d)c=b[d],a[goog.getUid(c).toString()]=c}};ol.renderer.Layer.prototype.updateLogos=function(a,b){var c=b.getLogo();goog.isDef(c)&&(a.logos[c]="")};ol.renderer.Layer.prototype.updateUsedTiles=function(a,b,c,d){b=goog.getUid(b).toString();c=c.toString();b in a?c in a[b]?a[b][c].extend(d):a[b][c]=d:(a[b]={},a[b][c]=d)};
|
|
ol.renderer.Layer.prototype.createGetTileIfLoadedFunction=function(a,b,c,d){return function(e,f,g){e=b.getTile(e,f,g,c,d);return a(e)?e:null}};ol.renderer.Layer.prototype.snapCenterToPixel=function(a,b,c){return[b*(Math.round(a[0]/b)+c[0]%2/2),b*(Math.round(a[1]/b)+c[1]%2/2)]};
|
|
ol.renderer.Layer.prototype.manageTilePyramid=function(a,b,c,d,e,f,g,h,k,l){var m=goog.getUid(b).toString();m in a.wantedTiles||(a.wantedTiles[m]={});var n=a.wantedTiles[m];a=a.tileQueue;var p=c.getMinZoom(),r,q,u,s,v,t;goog.isDef(h)||(h=0);for(t=g;t>=p;--t)for(q=c.getTileRangeForExtentAndZ(f,t),u=c.getResolution(t),s=q.minX;s<=q.maxX;++s)for(v=q.minY;v<=q.maxY;++v)g-t<=h?(r=b.getTile(t,s,v,d,e),r.getState()==ol.TileState.IDLE&&(n[r.tileCoord.toString()]=!0,a.isKeyQueued(r.getKey())||a.enqueue([r,
|
|
m,c.getTileCoordCenter(r.tileCoord),u])),goog.isDef(k)&&k.call(l,r)):b.useTile(t,s,v)};ol.style.IconAnchorOrigin={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};ol.style.IconAnchorUnits={FRACTION:"fraction",PIXELS:"pixels"};
|
|
ol.style.Icon=function(a){a=goog.isDef(a)?a:{};this.anchor_=goog.isDef(a.anchor)?a.anchor:[0.5,0.5];this.anchorOrigin_=goog.isDef(a.anchorOrigin)?a.anchorOrigin:ol.style.IconAnchorOrigin.TOP_LEFT;this.anchorXUnits_=goog.isDef(a.anchorXUnits)?a.anchorXUnits:ol.style.IconAnchorUnits.FRACTION;this.anchorYUnits_=goog.isDef(a.anchorYUnits)?a.anchorYUnits:ol.style.IconAnchorUnits.FRACTION;var b=goog.isDef(a.crossOrigin)?a.crossOrigin:null;this.iconImage_=ol.style.IconImage_.get(a.src,b);this.size_=goog.isDef(a.size)?
|
|
a.size:null;var b=goog.isDef(a.opacity)?a.opacity:1,c=goog.isDef(a.rotateWithView)?a.rotateWithView:!1,d=goog.isDef(a.rotation)?a.rotation:0;a=goog.isDef(a.scale)?a.scale:1;ol.style.Image.call(this,{opacity:b,rotation:d,scale:a,snapToPixel:void 0,rotateWithView:c})};goog.inherits(ol.style.Icon,ol.style.Image);
|
|
ol.style.Icon.prototype.getAnchor=function(){var a=this.anchor_,b=this.getSize();if(this.anchorXUnits_==ol.style.IconAnchorUnits.FRACTION||this.anchorYUnits_==ol.style.IconAnchorUnits.FRACTION){if(goog.isNull(b))return null;a=this.anchor_.slice();this.anchorXUnits_==ol.style.IconAnchorUnits.FRACTION&&(a[0]*=b[0]);this.anchorYUnits_==ol.style.IconAnchorUnits.FRACTION&&(a[1]*=b[1])}if(this.anchorOrigin_!=ol.style.IconAnchorOrigin.TOP_LEFT){if(goog.isNull(b))return null;a===this.anchor_&&(a=this.anchor_.slice());
|
|
if(this.anchorOrigin_==ol.style.IconAnchorOrigin.TOP_RIGHT||this.anchorOrigin_==ol.style.IconAnchorOrigin.BOTTOM_RIGHT)a[0]=-a[0]+b[0];if(this.anchorOrigin_==ol.style.IconAnchorOrigin.BOTTOM_LEFT||this.anchorOrigin_==ol.style.IconAnchorOrigin.BOTTOM_RIGHT)a[1]+=b[1]}return a};ol.style.Icon.prototype.getImage=function(a){return this.iconImage_.getImage(a)};ol.style.Icon.prototype.getImageState=function(){return this.iconImage_.getImageState()};ol.style.Icon.prototype.getHitDetectionImage=function(a){return this.iconImage_.getHitDetectionImage(a)};
|
|
ol.style.Icon.prototype.getSrc=function(){return this.iconImage_.getSrc()};ol.style.Icon.prototype.getSize=function(){return goog.isNull(this.size_)?this.iconImage_.getSize():this.size_};ol.style.Icon.prototype.listenImageChange=function(a,b){return goog.events.listen(this.iconImage_,goog.events.EventType.CHANGE,a,!1,b)};ol.style.Icon.prototype.load=function(){this.iconImage_.load()};
|
|
ol.style.Icon.prototype.unlistenImageChange=function(a,b){goog.events.unlisten(this.iconImage_,goog.events.EventType.CHANGE,a,!1,b)};ol.style.IconImage_=function(a,b){goog.events.EventTarget.call(this);this.hitDetectionImage_=null;this.image_=new Image;goog.isNull(b)||(this.image_.crossOrigin=b);this.imageListenerKeys_=null;this.imageState_=ol.style.ImageState.IDLE;this.size_=null;this.src_=a;this.tainting_=!1};goog.inherits(ol.style.IconImage_,goog.events.EventTarget);
|
|
ol.style.IconImage_.get=function(a,b){var c=ol.style.IconImageCache.getInstance(),d=c.get(a,b);goog.isNull(d)&&(d=new ol.style.IconImage_(a,b),c.set(a,b,d));return d};ol.style.IconImage_.prototype.determineTainting_=function(){var a=goog.dom.createElement(goog.dom.TagName.CANVAS);a.width=1;a.height=1;a=a.getContext("2d");a.drawImage(this.image_,0,0);try{a.getImageData(0,0,1,1)}catch(b){this.tainting_=!0}};ol.style.IconImage_.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(goog.events.EventType.CHANGE)};
|
|
ol.style.IconImage_.prototype.handleImageError_=function(){this.imageState_=ol.style.ImageState.ERROR;this.unlistenImage_();this.dispatchChangeEvent_()};ol.style.IconImage_.prototype.handleImageLoad_=function(){this.imageState_=ol.style.ImageState.LOADED;this.size_=[this.image_.width,this.image_.height];this.unlistenImage_();this.determineTainting_();this.dispatchChangeEvent_()};ol.style.IconImage_.prototype.getImage=function(a){return this.image_};ol.style.IconImage_.prototype.getImageState=function(){return this.imageState_};
|
|
ol.style.IconImage_.prototype.getHitDetectionImage=function(a){if(goog.isNull(this.hitDetectionImage_))if(this.tainting_){a=goog.dom.createElement(goog.dom.TagName.CANVAS);var b=this.size_[0],c=this.size_[1];a.width=b;a.height=c;a.getContext("2d").fillRect(0,0,b,c);this.hitDetectionImage_=a}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_};ol.style.IconImage_.prototype.getSize=function(){return this.size_};ol.style.IconImage_.prototype.getSrc=function(){return this.src_};
|
|
ol.style.IconImage_.prototype.load=function(){if(this.imageState_==ol.style.ImageState.IDLE){this.imageState_=ol.style.ImageState.LOADING;this.imageListenerKeys_=[goog.events.listenOnce(this.image_,goog.events.EventType.ERROR,this.handleImageError_,!1,this),goog.events.listenOnce(this.image_,goog.events.EventType.LOAD,this.handleImageLoad_,!1,this)];try{this.image_.src=this.src_}catch(a){this.handleImageError_()}}};
|
|
ol.style.IconImage_.prototype.unlistenImage_=function(){goog.array.forEach(this.imageListenerKeys_,goog.events.unlistenByKey);this.imageListenerKeys_=null};ol.style.IconImageCache=function(){this.cache_={};this.cacheSize_=0;this.maxCacheSize_=32};goog.addSingletonGetter(ol.style.IconImageCache);ol.style.IconImageCache.getKey=function(a,b){return b+":"+a};ol.style.IconImageCache.prototype.clear=function(){this.cache_={};this.cacheSize_=0};
|
|
ol.style.IconImageCache.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var a=0,b,c;for(b in this.cache_)c=this.cache_[b],0!==(a++&3)||goog.events.hasListener(c)||(delete this.cache_[b],--this.cacheSize_)}};ol.style.IconImageCache.prototype.get=function(a,b){var c=ol.style.IconImageCache.getKey(a,b);return c in this.cache_?this.cache_[c]:null};ol.style.IconImageCache.prototype.set=function(a,b,c){a=ol.style.IconImageCache.getKey(a,b);this.cache_[a]=c;++this.cacheSize_};ol.vec={};ol.vec.Mat4={};ol.vec.Mat4.makeTransform2D=function(a,b,c,d,e,f,g,h){goog.vec.Mat4.makeIdentity(a);0===b&&0===c||goog.vec.Mat4.translate(a,b,c,0);1==d&&1==e||goog.vec.Mat4.scale(a,d,e,1);0!==f&&goog.vec.Mat4.rotateZ(a,f);0===g&&0===h||goog.vec.Mat4.translate(a,g,h,0);return a};
|
|
ol.vec.Mat4.equals2D=function(a,b){return goog.vec.Mat4.getElement(a,0,0)==goog.vec.Mat4.getElement(b,0,0)&&goog.vec.Mat4.getElement(a,1,0)==goog.vec.Mat4.getElement(b,1,0)&&goog.vec.Mat4.getElement(a,0,1)==goog.vec.Mat4.getElement(b,0,1)&&goog.vec.Mat4.getElement(a,1,1)==goog.vec.Mat4.getElement(b,1,1)&&goog.vec.Mat4.getElement(a,0,3)==goog.vec.Mat4.getElement(b,0,3)&&goog.vec.Mat4.getElement(a,1,3)==goog.vec.Mat4.getElement(b,1,3)};
|
|
ol.vec.Mat4.multVec2=function(a,b,c){var d=goog.vec.Mat4.getElement(a,0,0),e=goog.vec.Mat4.getElement(a,1,0),f=goog.vec.Mat4.getElement(a,0,1),g=goog.vec.Mat4.getElement(a,1,1),h=goog.vec.Mat4.getElement(a,0,3);a=goog.vec.Mat4.getElement(a,1,3);var k=b[0];b=b[1];c[0]=d*k+f*b+h;c[1]=e*k+g*b+a;return c};ol.renderer.Map=function(a,b){goog.Disposable.call(this);this.map_=b;this.layerRenderers_={}};goog.inherits(ol.renderer.Map,goog.Disposable);ol.renderer.Map.prototype.calculateMatrices2D=function(a){var b=a.view2DState,c=a.coordinateToPixelMatrix;ol.vec.Mat4.makeTransform2D(c,a.size[0]/2,a.size[1]/2,1/b.resolution,-1/b.resolution,-b.rotation,-b.center[0],-b.center[1]);goog.vec.Mat4.invert(c,a.pixelToCoordinateMatrix)};
|
|
ol.renderer.Map.prototype.createLayerRenderer=function(a){return new ol.renderer.Layer(this,a)};ol.renderer.Map.prototype.disposeInternal=function(){goog.object.forEach(this.layerRenderers_,function(a){goog.dispose(a)});ol.renderer.Map.superClass_.disposeInternal.call(this)};
|
|
ol.renderer.Map.prototype.forEachFeatureAtPixel=function(a,b,c,d,e,f){var g=this.map_.getLayerGroup().getLayersArray(),h;for(h=g.length-1;0<=h;--h){var k=g[h];if(k.getVisible()&&e.call(f,k)&&(k=this.getLayerRenderer(k).forEachFeatureAtPixel(a,b,c,d)))return k}};ol.renderer.Map.prototype.getLayerRenderer=function(a){var b=goog.getUid(a).toString();if(b in this.layerRenderers_)return this.layerRenderers_[b];a=this.createLayerRenderer(a);return this.layerRenderers_[b]=a};
|
|
ol.renderer.Map.prototype.getLayerRendererByKey=function(a){return this.layerRenderers_[a]};ol.renderer.Map.prototype.getLayerRenderers=function(){return this.layerRenderers_};ol.renderer.Map.prototype.getMap=function(){return this.map_};ol.renderer.Map.prototype.removeLayerRendererByKey_=function(a){var b=this.layerRenderers_[a];delete this.layerRenderers_[a];return b};ol.renderer.Map.prototype.renderFrame=goog.nullFunction;
|
|
ol.renderer.Map.prototype.removeUnusedLayerRenderers_=function(a,b){for(var c in this.layerRenderers_)!goog.isNull(b)&&c in b.layerStates||goog.dispose(this.removeLayerRendererByKey_(c))};ol.renderer.Map.prototype.scheduleExpireIconCache=function(a){a.postRenderFunctions.push(function(a,c){ol.style.IconImageCache.getInstance().expire()})};
|
|
ol.renderer.Map.prototype.scheduleRemoveUnusedLayerRenderers=function(a){for(var b in this.layerRenderers_)if(!(b in a.layerStates)){a.postRenderFunctions.push(goog.bind(this.removeUnusedLayerRenderers_,this));break}};ol.layer.Image=function(a){ol.layer.Layer.call(this,a)};goog.inherits(ol.layer.Image,ol.layer.Layer);ol.layer.TileProperty={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};ol.layer.Tile=function(a){ol.layer.Layer.call(this,a)};goog.inherits(ol.layer.Tile,ol.layer.Layer);ol.layer.Tile.prototype.getPreload=function(){return this.get(ol.layer.TileProperty.PRELOAD)};goog.exportProperty(ol.layer.Tile.prototype,"getPreload",ol.layer.Tile.prototype.getPreload);ol.layer.Tile.prototype.setPreload=function(a){this.set(ol.layer.TileProperty.PRELOAD,a)};
|
|
goog.exportProperty(ol.layer.Tile.prototype,"setPreload",ol.layer.Tile.prototype.setPreload);ol.layer.Tile.prototype.getUseInterimTilesOnError=function(){return this.get(ol.layer.TileProperty.USE_INTERIM_TILES_ON_ERROR)};goog.exportProperty(ol.layer.Tile.prototype,"getUseInterimTilesOnError",ol.layer.Tile.prototype.getUseInterimTilesOnError);ol.layer.Tile.prototype.setUseInterimTilesOnError=function(a){this.set(ol.layer.TileProperty.USE_INTERIM_TILES_ON_ERROR,a)};
|
|
goog.exportProperty(ol.layer.Tile.prototype,"setUseInterimTilesOnError",ol.layer.Tile.prototype.setUseInterimTilesOnError);ol.layer.VectorProperty={RENDER_GEOMETRY_FUNCTIONS:"renderGeometryFunctions"};ol.layer.Vector=function(a){a=goog.isDef(a)?a:{};var b=goog.object.clone(a);delete b.style;ol.layer.Layer.call(this,b);this.style_=null;this.styleFunction_=void 0;goog.isDef(a.style)&&this.setStyle(a.style)};goog.inherits(ol.layer.Vector,ol.layer.Layer);ol.layer.Vector.prototype.getRenderGeometryFunctions=function(){return this.get(ol.layer.VectorProperty.RENDER_GEOMETRY_FUNCTIONS)};
|
|
goog.exportProperty(ol.layer.Vector.prototype,"getRenderGeometryFunctions",ol.layer.Vector.prototype.getRenderGeometryFunctions);ol.layer.Vector.prototype.getStyle=function(){return this.style_};ol.layer.Vector.prototype.getStyleFunction=function(){return this.styleFunction_};ol.layer.Vector.prototype.setRenderGeometryFunctions=function(a){this.set(ol.layer.VectorProperty.RENDER_GEOMETRY_FUNCTIONS,a)};goog.exportProperty(ol.layer.Vector.prototype,"setRenderGeometryFunctions",ol.layer.Vector.prototype.setRenderGeometryFunctions);
|
|
ol.layer.Vector.prototype.setStyle=function(a){this.style_=a;this.styleFunction_=ol.feature.createStyleFunction(a);this.dispatchChangeEvent()};ol.render.canvas.Immediate=function(a,b,c,d,e){this.callbacksByZIndex_={};this.context_=a;this.pixelRatio_=b;this.extent_=c;this.transform_=d;this.viewRotation_=e;this.image_=this.strokeState_=this.fillState_=this.contextTextState_=this.contextStrokeState_=this.contextFillState_=null;this.imageOpacity_=this.imageHeight_=this.imageAnchorY_=this.imageAnchorX_=0;this.imageRotateWithView_=!1;this.imageScale_=this.imageRotation_=0;this.imageSnapToPixel_=!1;this.imageWidth_=0;this.text_="";this.textScale_=
|
|
this.textRotation_=0;this.textState_=this.textStrokeState_=this.textFillState_=null;this.pixelCoordinates_=[];this.tmpLocalTransform_=goog.vec.Mat4.createNumber()};
|
|
ol.render.canvas.Immediate.prototype.drawImages_=function(a,b,c,d){if(!goog.isNull(this.image_)){a=ol.geom.flat.transform2D(a,2,this.transform_,this.pixelCoordinates_);b=this.context_;c=this.tmpLocalTransform_;d=b.globalAlpha;1!=this.imageOpacity_&&(b.globalAlpha=d*this.imageOpacity_);var e=this.imageRotation_;this.imageRotateWithView_&&(e+=this.viewRotation_);var f,g;f=0;for(g=a.length;f<g;f+=2){var h=a[f]-this.imageAnchorX_,k=a[f+1]-this.imageAnchorY_;this.imageSnapToPixel_&&(h=h+0.5|0,k=k+0.5|
|
|
0);if(0!==e||1!=this.imageScale_){var l=h+this.imageAnchorX_,m=k+this.imageAnchorY_;ol.vec.Mat4.makeTransform2D(c,l,m,this.imageScale_,this.imageScale_,e,-l,-m);b.setTransform(goog.vec.Mat4.getElement(c,0,0),goog.vec.Mat4.getElement(c,1,0),goog.vec.Mat4.getElement(c,0,1),goog.vec.Mat4.getElement(c,1,1),goog.vec.Mat4.getElement(c,0,3),goog.vec.Mat4.getElement(c,1,3))}b.drawImage(this.image_,h,k,this.imageWidth_,this.imageHeight_)}0===e&&1==this.imageScale_||b.setTransform(1,0,0,1,0,0);1!=this.imageOpacity_&&
|
|
(b.globalAlpha=d)}};
|
|
ol.render.canvas.Immediate.prototype.drawText_=function(a,b,c,d){if(!goog.isNull(this.textState_)&&""!==this.text_){goog.isNull(this.textFillState_)||this.setContextFillState_(this.textFillState_);goog.isNull(this.textStrokeState_)||this.setContextStrokeState_(this.textStrokeState_);this.setContextTextState_(this.textState_);a=ol.geom.flat.transform2D(a,d,this.transform_,this.pixelCoordinates_);for(var e=this.context_;b<c;b+=d){var f=a[b],g=a[b+1];if(0!==this.textRotation_||1!=this.textScale_){var h=
|
|
ol.vec.Mat4.makeTransform2D(this.tmpLocalTransform_,f,g,this.textScale_,this.textScale_,this.textRotation_,-f,-g);e.setTransform(goog.vec.Mat4.getElement(h,0,0),goog.vec.Mat4.getElement(h,1,0),goog.vec.Mat4.getElement(h,0,1),goog.vec.Mat4.getElement(h,1,1),goog.vec.Mat4.getElement(h,0,3),goog.vec.Mat4.getElement(h,1,3))}goog.isNull(this.textStrokeState_)||e.strokeText(this.text_,f,g);goog.isNull(this.textFillState_)||e.fillText(this.text_,f,g)}0===this.textRotation_&&1==this.textScale_||e.setTransform(1,
|
|
0,0,1,0,0)}};ol.render.canvas.Immediate.prototype.moveToLineTo_=function(a,b,c,d){var e=this.context_;e.moveTo(a[b],a[b+1]);var f;for(f=b+2;f<c;f+=2)e.lineTo(a[f],a[f+1]);d&&e.lineTo(a[b],a[b+1]);return c};ol.render.canvas.Immediate.prototype.drawRings_=function(a,b,c){var d=this.context_,e,f;e=0;for(f=c.length;e<f;++e)b=this.moveToLineTo_(a,b,c[e],!0),d.closePath();return b};
|
|
ol.render.canvas.Immediate.prototype.drawAsync=function(a,b){var c=a.toString(),d=this.callbacksByZIndex_[c];goog.isDef(d)?d.push(b):this.callbacksByZIndex_[c]=[b]};
|
|
ol.render.canvas.Immediate.prototype.drawCircleGeometry=function(a,b){if(ol.extent.intersects(this.extent_,a.getExtent())){if(!goog.isNull(this.fillState_)||!goog.isNull(this.strokeState_)){goog.isNull(this.fillState_)||this.setContextFillState_(this.fillState_);goog.isNull(this.strokeState_)||this.setContextStrokeState_(this.strokeState_);var c=ol.geom.transformSimpleGeometry2D(a,this.transform_,this.pixelCoordinates_),d=c[2]-c[0],e=c[3]-c[1],d=Math.sqrt(d*d+e*e),e=this.context_;e.beginPath();e.arc(c[0],
|
|
c[1],d,0,2*Math.PI);goog.isNull(this.fillState_)||e.fill();goog.isNull(this.strokeState_)||e.stroke()}""!==this.text_&&this.drawText_(a.getCenter(),0,2,2)}};
|
|
ol.render.canvas.Immediate.prototype.drawFeature=function(a,b){var c=a.getGeometry();if(!goog.isNull(c)&&ol.extent.intersects(this.extent_,c.getExtent())){var d=b.getZIndex();goog.isDef(d)||(d=0);this.drawAsync(d,function(a){a.setFillStrokeStyle(b.getFill(),b.getStroke());a.setImageStyle(b.getImage());a.setTextStyle(b.getText());ol.render.canvas.Immediate.GEOMETRY_RENDERES_[c.getType()].call(a,c,null)})}};
|
|
ol.render.canvas.Immediate.prototype.drawGeometryCollectionGeometry=function(a,b){var c=a.getGeometriesArray(),d,e;d=0;for(e=c.length;d<e;++d){var f=c[d];ol.render.canvas.Immediate.GEOMETRY_RENDERES_[f.getType()].call(this,f,b)}};ol.render.canvas.Immediate.prototype.drawPointGeometry=function(a,b){var c=a.getFlatCoordinates(),d=a.getStride();goog.isNull(this.image_)||this.drawImages_(c,0,c.length,d);""!==this.text_&&this.drawText_(c,0,c.length,d)};
|
|
ol.render.canvas.Immediate.prototype.drawMultiPointGeometry=function(a,b){var c=a.getFlatCoordinates(),d=a.getStride();goog.isNull(this.image_)||this.drawImages_(c,0,c.length,d);""!==this.text_&&this.drawText_(c,0,c.length,d)};
|
|
ol.render.canvas.Immediate.prototype.drawLineStringGeometry=function(a,b){if(ol.extent.intersects(this.extent_,a.getExtent())){if(!goog.isNull(this.strokeState_)){this.setContextStrokeState_(this.strokeState_);var c=ol.geom.transformSimpleGeometry2D(a,this.transform_,this.pixelCoordinates_),d=this.context_;d.beginPath();this.moveToLineTo_(c,0,c.length,!1);d.stroke()}""!==this.text_&&(c=a.getFlatMidpoint(),this.drawText_(c,0,2,2))}};
|
|
ol.render.canvas.Immediate.prototype.drawMultiLineStringGeometry=function(a,b){var c=a.getExtent();if(ol.extent.intersects(this.extent_,c)){if(!goog.isNull(this.strokeState_)){this.setContextStrokeState_(this.strokeState_);var c=ol.geom.transformSimpleGeometry2D(a,this.transform_,this.pixelCoordinates_),d=this.context_;d.beginPath();var e=a.getEnds(),f=0,g,h;g=0;for(h=e.length;g<h;++g)f=this.moveToLineTo_(c,f,e[g],!1);d.stroke()}""!==this.text_&&(c=a.getFlatMidpoints(),this.drawText_(c,0,c.length,
|
|
2))}};
|
|
ol.render.canvas.Immediate.prototype.drawPolygonGeometry=function(a,b){if(ol.extent.intersects(this.extent_,a.getExtent())){var c;if(!goog.isNull(this.strokeState_)||!goog.isNull(this.fillState_)){goog.isNull(this.fillState_)||this.setContextFillState_(this.fillState_);goog.isNull(this.strokeState_)||this.setContextStrokeState_(this.strokeState_);c=ol.geom.transformSimpleGeometry2D(a,this.transform_,this.pixelCoordinates_);var d=this.context_;d.beginPath();this.drawRings_(c,0,a.getEnds());goog.isNull(this.fillState_)||d.fill();
|
|
goog.isNull(this.strokeState_)||d.stroke()}""!==this.text_&&(c=a.getFlatInteriorPoint(),this.drawText_(c,0,2,2))}};
|
|
ol.render.canvas.Immediate.prototype.drawMultiPolygonGeometry=function(a,b){if(ol.extent.intersects(this.extent_,a.getExtent())){var c;if(!goog.isNull(this.strokeState_)||!goog.isNull(this.fillState_)){goog.isNull(this.fillState_)||this.setContextFillState_(this.fillState_);goog.isNull(this.strokeState_)||this.setContextStrokeState_(this.strokeState_);c=ol.geom.transformSimpleGeometry2D(a,this.transform_,this.pixelCoordinates_);var d=this.context_,e=a.getEndss(),f=0,g,h;g=0;for(h=e.length;g<h;++g){var k=
|
|
e[g];d.beginPath();f=this.drawRings_(c,f,k);goog.isNull(this.fillState_)||d.fill();goog.isNull(this.strokeState_)||d.stroke()}}""!==this.text_&&(c=a.getFlatInteriorPoints(),this.drawText_(c,0,c.length,2))}};ol.render.canvas.Immediate.prototype.flush=function(){var a=goog.array.map(goog.object.getKeys(this.callbacksByZIndex_),Number);goog.array.sort(a);var b,c,d,e,f;b=0;for(c=a.length;b<c;++b)for(d=this.callbacksByZIndex_[a[b].toString()],e=0,f=d.length;e<f;++e)d[e](this)};
|
|
ol.render.canvas.Immediate.prototype.setContextFillState_=function(a){var b=this.context_,c=this.contextFillState_;goog.isNull(c)?(b.fillStyle=a.fillStyle,this.contextFillState_={fillStyle:a.fillStyle}):c.fillStyle!=a.fillStyle&&(c.fillStyle=b.fillStyle=a.fillStyle)};
|
|
ol.render.canvas.Immediate.prototype.setContextStrokeState_=function(a){var b=this.context_,c=this.contextStrokeState_;goog.isNull(c)?(b.lineCap=a.lineCap,ol.BrowserFeature.HAS_CANVAS_LINE_DASH&&b.setLineDash(a.lineDash),b.lineJoin=a.lineJoin,b.lineWidth=a.lineWidth,b.miterLimit=a.miterLimit,b.strokeStyle=a.strokeStyle,this.contextStrokeState_={lineCap:a.lineCap,lineDash:a.lineDash,lineJoin:a.lineJoin,lineWidth:a.lineWidth,miterLimit:a.miterLimit,strokeStyle:a.strokeStyle}):(c.lineCap!=a.lineCap&&
|
|
(c.lineCap=b.lineCap=a.lineCap),ol.BrowserFeature.HAS_CANVAS_LINE_DASH&&!goog.array.equals(c.lineDash,a.lineDash)&&b.setLineDash(c.lineDash=a.lineDash),c.lineJoin!=a.lineJoin&&(c.lineJoin=b.lineJoin=a.lineJoin),c.lineWidth!=a.lineWidth&&(c.lineWidth=b.lineWidth=a.lineWidth),c.miterLimit!=a.miterLimit&&(c.miterLimit=b.miterLimit=a.miterLimit),c.strokeStyle!=a.strokeStyle&&(c.strokeStyle=b.strokeStyle=a.strokeStyle))};
|
|
ol.render.canvas.Immediate.prototype.setContextTextState_=function(a){var b=this.context_,c=this.contextTextState_;goog.isNull(c)?(b.font=a.font,b.textAlign=a.textAlign,b.textBaseline=a.textBaseline,this.contextTextState_={font:a.font,textAlign:a.textAlign,textBaseline:a.textBaseline}):(c.font!=a.font&&(c.font=b.font=a.font),c.textAlign!=a.textAlign&&(c.textAlign=b.textAlign=a.textAlign),c.textBaseline!=a.textBaseline&&(c.textBaseline=b.textBaseline=a.textBaseline))};
|
|
ol.render.canvas.Immediate.prototype.setFillStrokeStyle=function(a,b){if(goog.isNull(a))this.fillState_=null;else{var c=a.getColor();this.fillState_={fillStyle:ol.color.asString(goog.isNull(c)?ol.render.canvas.defaultFillStyle:c)}}if(goog.isNull(b))this.strokeState_=null;else{var c=b.getColor(),d=b.getLineCap(),e=b.getLineDash(),f=b.getLineJoin(),g=b.getWidth(),h=b.getMiterLimit();this.strokeState_={lineCap:goog.isDef(d)?d:ol.render.canvas.defaultLineCap,lineDash:goog.isDefAndNotNull(e)?e:ol.render.canvas.defaultLineDash,
|
|
lineJoin:goog.isDef(f)?f:ol.render.canvas.defaultLineJoin,lineWidth:this.pixelRatio_*(goog.isDef(g)?g:ol.render.canvas.defaultLineWidth),miterLimit:goog.isDef(h)?h:ol.render.canvas.defaultMiterLimit,strokeStyle:ol.color.asString(goog.isNull(c)?ol.render.canvas.defaultStrokeStyle:c)}}};
|
|
ol.render.canvas.Immediate.prototype.setImageStyle=function(a){if(goog.isNull(a))this.image_=null;else{var b=a.getAnchor(),c=a.getImage(1),d=a.getOpacity(),e=a.getRotateWithView(),f=a.getRotation(),g=a.getScale(),h=a.getSize();a=a.getSnapToPixel();this.imageAnchorX_=b[0];this.imageAnchorY_=b[1];this.imageHeight_=h[1];this.image_=c;this.imageOpacity_=goog.isDef(d)?d:1;this.imageRotateWithView_=goog.isDef(e)?e:!1;this.imageRotation_=goog.isDef(f)?f:0;this.imageScale_=goog.isDef(g)?g:1;this.imageSnapToPixel_=
|
|
goog.isDef(a)?a:!1;this.imageWidth_=h[0]}};
|
|
ol.render.canvas.Immediate.prototype.setTextStyle=function(a){if(goog.isNull(a))this.text_="";else{var b=a.getFill();goog.isNull(b)?this.textFillState_=null:(b=b.getColor(),this.textFillState_={fillStyle:ol.color.asString(goog.isNull(b)?ol.render.canvas.defaultFillStyle:b)});var c=a.getStroke();if(goog.isNull(c))this.textStrokeState_=null;else{var b=c.getColor(),d=c.getLineCap(),e=c.getLineDash(),f=c.getLineJoin(),g=c.getWidth(),c=c.getMiterLimit();this.textStrokeState_={lineCap:goog.isDef(d)?d:ol.render.canvas.defaultLineCap,
|
|
lineDash:goog.isDefAndNotNull(e)?e:ol.render.canvas.defaultLineDash,lineJoin:goog.isDef(f)?f:ol.render.canvas.defaultLineJoin,lineWidth:this.pixelRatio_*(goog.isDef(g)?g:ol.render.canvas.defaultLineWidth),miterLimit:goog.isDef(c)?c:ol.render.canvas.defaultMiterLimit,strokeStyle:ol.color.asString(goog.isNull(b)?ol.render.canvas.defaultStrokeStyle:b)}}b=a.getFont();d=a.getRotation();e=a.getScale();f=a.getText();g=a.getTextAlign();a=a.getTextBaseline();this.textState_={font:goog.isDef(b)?b:ol.render.canvas.defaultFont,
|
|
textAlign:goog.isDef(g)?g:ol.render.canvas.defaultTextAlign,textBaseline:goog.isDef(a)?a:ol.render.canvas.defaultTextBaseline};this.text_=goog.isDef(f)?f:"";this.textRotation_=goog.isDef(d)?d:0;this.textScale_=this.pixelRatio_*(goog.isDef(e)?e:1)}};
|
|
ol.render.canvas.Immediate.GEOMETRY_RENDERES_={Point:ol.render.canvas.Immediate.prototype.drawPointGeometry,LineString:ol.render.canvas.Immediate.prototype.drawLineStringGeometry,Polygon:ol.render.canvas.Immediate.prototype.drawPolygonGeometry,MultiPoint:ol.render.canvas.Immediate.prototype.drawMultiPointGeometry,MultiLineString:ol.render.canvas.Immediate.prototype.drawMultiLineStringGeometry,MultiPolygon:ol.render.canvas.Immediate.prototype.drawMultiPolygonGeometry,GeometryCollection:ol.render.canvas.Immediate.prototype.drawGeometryCollectionGeometry,
|
|
Circle:ol.render.canvas.Immediate.prototype.drawCircleGeometry};ol.renderer.canvas={};ol.renderer.canvas.Layer=function(a,b){ol.renderer.Layer.call(this,a,b);this.transform_=goog.vec.Mat4.createNumber()};goog.inherits(ol.renderer.canvas.Layer,ol.renderer.Layer);
|
|
ol.renderer.canvas.Layer.prototype.composeFrame=function(a,b,c){this.dispatchPreComposeEvent(c,a);var d=this.getImage();if(!goog.isNull(d)){var e=this.getImageTransform();c.globalAlpha=b.opacity;if(0===a.view2DState.rotation){b=goog.vec.Mat4.getElement(e,0,3);var f=goog.vec.Mat4.getElement(e,1,3),g=d.width*goog.vec.Mat4.getElement(e,0,0),e=d.height*goog.vec.Mat4.getElement(e,1,1);c.drawImage(d,0,0,+d.width,+d.height,Math.round(b),Math.round(f),Math.round(g),Math.round(e))}else c.setTransform(goog.vec.Mat4.getElement(e,
|
|
0,0),goog.vec.Mat4.getElement(e,1,0),goog.vec.Mat4.getElement(e,0,1),goog.vec.Mat4.getElement(e,1,1),goog.vec.Mat4.getElement(e,0,3),goog.vec.Mat4.getElement(e,1,3)),c.drawImage(d,0,0),c.setTransform(1,0,0,1,0,0)}this.dispatchPostComposeEvent(c,a)};
|
|
ol.renderer.canvas.Layer.prototype.dispatchComposeEvent_=function(a,b,c,d){var e=this.getLayer();e.hasListener(a)&&(d=goog.isDef(d)?d:this.getTransform(c),d=new ol.render.canvas.Immediate(b,c.pixelRatio,c.extent,d,c.view2DState.rotation),a=new ol.render.Event(a,e,d,c,b,null),e.dispatchEvent(a),d.flush())};ol.renderer.canvas.Layer.prototype.dispatchPostComposeEvent=function(a,b,c){this.dispatchComposeEvent_(ol.render.EventType.POSTCOMPOSE,a,b,c)};
|
|
ol.renderer.canvas.Layer.prototype.dispatchPreComposeEvent=function(a,b,c){this.dispatchComposeEvent_(ol.render.EventType.PRECOMPOSE,a,b,c)};ol.renderer.canvas.Layer.prototype.dispatchRenderEvent=function(a,b,c){this.dispatchComposeEvent_(ol.render.EventType.RENDER,a,b,c)};
|
|
ol.renderer.canvas.Layer.prototype.getTransform=function(a){var b=a.view2DState,c=a.pixelRatio;return ol.vec.Mat4.makeTransform2D(this.transform_,c*a.size[0]/2,c*a.size[1]/2,c/b.resolution,-c/b.resolution,-b.rotation,-b.center[0],-b.center[1])};ol.source.Image=function(a){ol.source.Source.call(this,{attributions:a.attributions,extent:a.extent,logo:a.logo,projection:a.projection,state:a.state});this.resolutions_=goog.isDef(a.resolutions)?a.resolutions:null};goog.inherits(ol.source.Image,ol.source.Source);ol.source.Image.prototype.getResolutions=function(){return this.resolutions_};
|
|
ol.source.Image.prototype.findNearestResolution=function(a){goog.isNull(this.resolutions_)||(a=ol.array.linearFindNearest(this.resolutions_,a,0),a=this.resolutions_[a]);return a};ol.renderer.canvas.ImageLayer=function(a,b){ol.renderer.canvas.Layer.call(this,a,b);this.image_=null;this.imageTransform_=goog.vec.Mat4.createNumber()};goog.inherits(ol.renderer.canvas.ImageLayer,ol.renderer.canvas.Layer);ol.renderer.canvas.ImageLayer.prototype.forEachFeatureAtPixel=function(a,b,c,d){var e=this.getLayer();return e.getSource().forEachFeatureAtPixel(b.extent,b.view2DState.resolution,b.view2DState.rotation,a,function(a){return c.call(d,a,e)})};
|
|
ol.renderer.canvas.ImageLayer.prototype.getImage=function(){return goog.isNull(this.image_)?null:this.image_.getImageElement()};ol.renderer.canvas.ImageLayer.prototype.getImageTransform=function(){return this.imageTransform_};
|
|
ol.renderer.canvas.ImageLayer.prototype.prepareFrame=function(a,b){var c=a.pixelRatio,d=a.view2DState,e=d.center,f=d.resolution,g=d.rotation,h=this.getLayer().getSource(),k=a.viewHints;k[ol.ViewHint.ANIMATING]||k[ol.ViewHint.INTERACTING]||(d=h.getImage(a.extent,f,c,d.projection),goog.isNull(d)||(k=d.getState(),k==ol.ImageState.IDLE?(goog.events.listenOnce(d,goog.events.EventType.CHANGE,this.handleImageChange,!1,this),d.load()):k==ol.ImageState.LOADED&&(this.image_=d)));if(!goog.isNull(this.image_)){var d=
|
|
this.image_,k=d.getExtent(),l=d.getResolution(),m=d.getPixelRatio(),f=c*l/(f*m);ol.vec.Mat4.makeTransform2D(this.imageTransform_,c*a.size[0]/2,c*a.size[1]/2,f,f,g,m*(k[0]-e[0])/l,m*(e[1]-k[3])/l);this.updateAttributions(a.attributions,d.getAttributions());this.updateLogos(a,h)}};ol.renderer.canvas.TileLayer=function(a,b){ol.renderer.canvas.Layer.call(this,a,b);this.context_=this.canvasSize_=this.canvas_=null;this.imageTransform_=goog.vec.Mat4.createNumber();this.renderedCanvasZ_=NaN;this.renderedTiles_=this.renderedCanvasTileRange_=null};goog.inherits(ol.renderer.canvas.TileLayer,ol.renderer.canvas.Layer);ol.renderer.canvas.TileLayer.prototype.getImage=function(){return this.canvas_};ol.renderer.canvas.TileLayer.prototype.getImageTransform=function(){return this.imageTransform_};
|
|
ol.renderer.canvas.TileLayer.prototype.prepareFrame=function(a,b){var c=a.pixelRatio,d=a.view2DState,e=d.projection,f=this.getLayer(),g=f.getSource(),h=g.getTileGridForProjection(e),k=g.getGutter(),l=h.getZForResolution(d.resolution),m=g.getTilePixelSize(l,a.pixelRatio,e),n=m/h.getTileSize(l),p=h.getResolution(l),n=p/n,r=d.center,q;p==d.resolution?(r=this.snapCenterToPixel(r,p,a.size),q=ol.extent.getForView2DAndSize(r,p,d.rotation,a.size)):q=a.extent;var u=h.getTileRangeForExtentAndResolution(q,p),
|
|
s=m*u.getWidth(),v=m*u.getHeight(),t,B;goog.isNull(this.canvas_)?(t=goog.dom.createElement(goog.dom.TagName.CANVAS),t.width=s,t.height=v,B=t.getContext("2d"),this.canvas_=t,this.canvasSize_=[s,v],this.context_=B):(t=this.canvas_,B=this.context_,this.canvasSize_[0]<s||this.canvasSize_[1]<v?(t.width=s,t.height=v,this.canvasSize_=[s,v],this.renderedCanvasTileRange_=null):(s=this.canvasSize_[0],v=this.canvasSize_[1],l==this.renderedCanvasZ_&&this.renderedCanvasTileRange_.containsTileRange(u)||(this.renderedCanvasTileRange_=
|
|
null)));var w,z;goog.isNull(this.renderedCanvasTileRange_)?(s/=m,v/=m,w=u.minX-Math.floor((s-u.getWidth())/2),z=u.minY-Math.floor((v-u.getHeight())/2),this.renderedCanvasZ_=l,this.renderedCanvasTileRange_=new ol.TileRange(w,w+s-1,z,z+v-1),this.renderedTiles_=Array(s*v),v=this.renderedCanvasTileRange_):(v=this.renderedCanvasTileRange_,s=v.getWidth());t={};t[l]={};var x=[],A=this.createGetTileIfLoadedFunction(function(a){return!goog.isNull(a)&&a.getState()==ol.TileState.LOADED},g,c,e),C=goog.bind(g.findLoadedTiles,
|
|
g,t,A),A=f.getUseInterimTilesOnError();goog.isDef(A)||(A=!0);var G=ol.extent.createEmpty(),H=new ol.TileRange(0,0,0,0),E,y,D;for(z=u.minX;z<=u.maxX;++z)for(D=u.minY;D<=u.maxY;++D)y=g.getTile(l,z,D,c,e),w=y.getState(),w==ol.TileState.LOADED||w==ol.TileState.EMPTY||w==ol.TileState.ERROR&&!A?t[l][y.tileCoord.toString()]=y:(E=h.forEachTileCoordParentTileRange(y.tileCoord,C,null,H,G),E||(x.push(y),E=h.getTileCoordChildTileRange(y.tileCoord,H,G),goog.isNull(E)||C(l+1,E)));C=0;for(E=x.length;C<E;++C)y=x[C],
|
|
z=m*(y.tileCoord.x-v.minX),D=m*(v.maxY-y.tileCoord.y),B.clearRect(z,D,m,m);x=goog.array.map(goog.object.getKeys(t),Number);goog.array.sort(x);var F=g.getOpaque(),J=ol.extent.getTopLeft(h.getTileCoordExtent(new ol.TileCoord(l,v.minX,v.maxY),G)),I,K,N,M,L,O,C=0;for(E=x.length;C<E;++C)if(I=x[C],m=g.getTilePixelSize(I,c,e),M=t[I],I==l)for(N in M)y=M[N],K=(y.tileCoord.y-v.minY)*s+(y.tileCoord.x-v.minX),this.renderedTiles_[K]!=y&&(z=m*(y.tileCoord.x-v.minX),D=m*(v.maxY-y.tileCoord.y),w=y.getState(),w!=
|
|
ol.TileState.EMPTY&&(w!=ol.TileState.ERROR||A)&&F||B.clearRect(z,D,m,m),w==ol.TileState.LOADED&&B.drawImage(y.getImage(),k,k,m,m,z,D,m,m),this.renderedTiles_[K]=y);else for(N in I=h.getResolution(I)/p,M)for(y=M[N],K=h.getTileCoordExtent(y.tileCoord,G),z=(K[0]-J[0])/n,D=(J[1]-K[3])/n,O=I*m,L=I*m,w=y.getState(),w!=ol.TileState.EMPTY&&F||B.clearRect(z,D,O,L),w==ol.TileState.LOADED&&B.drawImage(y.getImage(),k,k,m,m,z,D,O,L),y=h.getTileRangeForExtentAndZ(K,l,H),w=Math.max(y.minX,v.minX),D=Math.min(y.maxX,
|
|
v.maxX),z=Math.max(y.minY,v.minY),y=Math.min(y.maxY,v.maxY);w<=D;++w)for(L=z;L<=y;++L)K=(L-v.minY)*s+(w-v.minX),this.renderedTiles_[K]=void 0;this.updateUsedTiles(a.usedTiles,g,l,u);this.manageTilePyramid(a,g,h,c,e,q,l,f.getPreload());this.scheduleExpireCache(a,g);this.updateLogos(a,g);ol.vec.Mat4.makeTransform2D(this.imageTransform_,c*a.size[0]/2,c*a.size[1]/2,c*n/d.resolution,c*n/d.resolution,d.rotation,(J[0]-r[0])/n,(r[1]-J[1])/n)};ol.render.ReplayType={IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};ol.render.REPLAY_ORDER=[ol.render.ReplayType.POLYGON,ol.render.ReplayType.LINE_STRING,ol.render.ReplayType.IMAGE,ol.render.ReplayType.TEXT];ol.render.IReplayGroup=function(){};ol.render.IReplayGroup.prototype.finish=function(){};ol.render.IReplayGroup.prototype.getReplay=function(a,b){};ol.render.IReplayGroup.prototype.isEmpty=function(){};ol.render.canvas.Instruction={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,DRAW_IMAGE:4,DRAW_TEXT:5,END_GEOMETRY:6,FILL:7,MOVE_TO_LINE_TO:8,SET_FILL_STYLE:9,SET_STROKE_STYLE:10,SET_TEXT_STYLE:11,STROKE:12};
|
|
ol.render.canvas.Replay=function(a,b){this.tolerance=a;this.maxExtent=b;this.beginGeometryInstruction2_=this.beginGeometryInstruction1_=null;this.instructions=[];this.coordinates=[];this.renderedTransform_=goog.vec.Mat4.createNumber();this.hitDetectionInstructions=[];this.pixelCoordinates_=[];this.extent_=ol.extent.createEmpty();this.tmpLocalTransform_=goog.vec.Mat4.createNumber()};
|
|
ol.render.canvas.Replay.prototype.appendFlatCoordinates=function(a,b,c,d,e){var f=this.coordinates.length,g=this.maxExtent,h=[a[b],a[b+1]],k=[NaN,NaN],l=!0,m,n,p;for(m=b+d;m<c;m+=d)k[0]=a[m],k[1]=a[m+1],p=ol.extent.coordinateRelationship(g,k),p!==n?(l&&(this.coordinates[f++]=h[0],this.coordinates[f++]=h[1]),this.coordinates[f++]=k[0],this.coordinates[f++]=k[1],l=!1):p===ol.extent.Relationship.INTERSECTING?(this.coordinates[f++]=k[0],this.coordinates[f++]=k[1],l=!1):l=!0,h[0]=k[0],h[1]=k[1],n=p;e&&
|
|
(this.coordinates[f++]=a[b],this.coordinates[f++]=a[b+1]);return f};ol.render.canvas.Replay.prototype.beginGeometry=function(a){this.beginGeometryInstruction1_=[ol.render.canvas.Instruction.BEGIN_GEOMETRY,a,0];this.instructions.push(this.beginGeometryInstruction1_);this.beginGeometryInstruction2_=[ol.render.canvas.Instruction.BEGIN_GEOMETRY,a,0];this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)};
|
|
ol.render.canvas.Replay.prototype.replay_=function(a,b,c,d,e,f,g){var h;ol.vec.Mat4.equals2D(c,this.renderedTransform_)?h=this.pixelCoordinates_:(h=ol.geom.flat.transform2D(this.coordinates,2,c,this.pixelCoordinates_),goog.vec.Mat4.setFromArray(this.renderedTransform_,c));c=0;for(var k=f.length,l=0,m,n=this.tmpLocalTransform_;c<k;){var p=f[c],r,q,u,s;switch(p[0]){case ol.render.canvas.Instruction.BEGIN_GEOMETRY:m=p[1];e(m)?++c:c=p[2];break;case ol.render.canvas.Instruction.BEGIN_PATH:a.beginPath();
|
|
++c;break;case ol.render.canvas.Instruction.CIRCLE:m=h[l];var v=h[l+1],t=h[l+2]-m,p=h[l+3]-v,t=Math.sqrt(t*t+p*p);a.arc(m,v,t,0,2*Math.PI,!0);l+=4;++c;break;case ol.render.canvas.Instruction.CLOSE_PATH:a.closePath();++c;break;case ol.render.canvas.Instruction.DRAW_IMAGE:l=p[1];m=p[2];r=p[3];u=p[4]*b;q=p[5]*b;var B=p[6]*b,w=p[7],v=p[9],t=p[10],z=p[11],x=p[12]*b;for(p[8]&&(v+=d);l<m;l+=2){p=h[l]-u;s=h[l+1]-q;z&&(p=p+0.5|0,s=s+0.5|0);if(1!=t||0!==v){var A=p+u,C=s+q;ol.vec.Mat4.makeTransform2D(n,A,C,
|
|
t,t,v,-A,-C);a.setTransform(goog.vec.Mat4.getElement(n,0,0),goog.vec.Mat4.getElement(n,1,0),goog.vec.Mat4.getElement(n,0,1),goog.vec.Mat4.getElement(n,1,1),goog.vec.Mat4.getElement(n,0,3),goog.vec.Mat4.getElement(n,1,3))}A=a.globalAlpha;1!=w&&(a.globalAlpha=A*w);a.drawImage(r,p,s,x,B);1!=w&&(a.globalAlpha=A);1==t&&0===v||a.setTransform(1,0,0,1,0,0)}++c;break;case ol.render.canvas.Instruction.DRAW_TEXT:l=p[1];m=p[2];u=p[3];v=p[4];t=p[5]*b;r=p[6];for(q=p[7];l<m;l+=2){p=h[l];s=h[l+1];if(1!=t||0!==v)ol.vec.Mat4.makeTransform2D(n,
|
|
p,s,t,t,v,-p,-s),a.setTransform(goog.vec.Mat4.getElement(n,0,0),goog.vec.Mat4.getElement(n,1,0),goog.vec.Mat4.getElement(n,0,1),goog.vec.Mat4.getElement(n,1,1),goog.vec.Mat4.getElement(n,0,3),goog.vec.Mat4.getElement(n,1,3));q&&a.strokeText(u,p,s);r&&a.fillText(u,p,s);1==t&&0===v||a.setTransform(1,0,0,1,0,0)}++c;break;case ol.render.canvas.Instruction.END_GEOMETRY:if(goog.isDef(g)&&(m=p[1],m=g(m,p[2])))return m;++c;break;case ol.render.canvas.Instruction.FILL:a.fill();++c;break;case ol.render.canvas.Instruction.MOVE_TO_LINE_TO:l=
|
|
p[1];m=p[2];a.moveTo(h[l],h[l+1]);for(l+=2;l<m;l+=2)a.lineTo(h[l],h[l+1]);++c;break;case ol.render.canvas.Instruction.SET_FILL_STYLE:a.fillStyle=p[1];++c;break;case ol.render.canvas.Instruction.SET_STROKE_STYLE:a.strokeStyle=p[1];a.lineWidth=p[2]*b;a.lineCap=p[3];a.lineJoin=p[4];a.miterLimit=p[5];ol.BrowserFeature.HAS_CANVAS_LINE_DASH&&a.setLineDash(p[6]);++c;break;case ol.render.canvas.Instruction.SET_TEXT_STYLE:a.font=p[1];a.textAlign=p[2];a.textBaseline=p[3];++c;break;case ol.render.canvas.Instruction.STROKE:a.stroke();
|
|
++c;break;default:++c}}};ol.render.canvas.Replay.prototype.replay=function(a,b,c,d,e){return this.replay_(a,b,c,d,e,this.instructions,void 0)};ol.render.canvas.Replay.prototype.replayHitDetection=function(a,b,c,d,e){return this.replay_(a,1,b,c,d,this.hitDetectionInstructions,e)};
|
|
ol.render.canvas.Replay.prototype.reverseHitDetectionInstructions_=function(){var a=this.hitDetectionInstructions;a.reverse();var b,c=a.length,d,e=-1;for(b=0;b<c;++b)d=a[b],d=d[0],d==ol.render.canvas.Instruction.END_GEOMETRY?e=b:d==ol.render.canvas.Instruction.BEGIN_GEOMETRY&&(ol.array.reverseSubArray(this.hitDetectionInstructions,e,b),e=-1)};
|
|
ol.render.canvas.Replay.prototype.endGeometry=function(a,b){this.beginGeometryInstruction1_[2]=this.instructions.length;this.beginGeometryInstruction1_=null;this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length;this.beginGeometryInstruction2_=null;var c=[ol.render.canvas.Instruction.END_GEOMETRY,a,b];this.instructions.push(c);this.hitDetectionInstructions.push(c)};ol.render.canvas.Replay.prototype.finish=goog.nullFunction;ol.render.canvas.Replay.prototype.getExtent=function(){return this.extent_};
|
|
ol.render.canvas.ImageReplay=function(a,b){ol.render.canvas.Replay.call(this,a,b);this.image_=this.hitDetectionImage_=null;this.width_=this.snapToPixel_=this.scale_=this.rotation_=this.rotateWithView_=this.opacity_=this.height_=this.anchorY_=this.anchorX_=void 0};goog.inherits(ol.render.canvas.ImageReplay,ol.render.canvas.Replay);ol.render.canvas.ImageReplay.prototype.drawCoordinates_=function(a,b,c,d){return this.appendFlatCoordinates(a,b,c,d,!1)};
|
|
ol.render.canvas.ImageReplay.prototype.drawPointGeometry=function(a,b){if(!goog.isNull(this.image_)){ol.extent.extend(this.extent_,a.getExtent());this.beginGeometry(a);var c=a.getFlatCoordinates(),d=a.getStride(),e=this.coordinates.length,c=this.drawCoordinates_(c,0,c.length,d);this.instructions.push([ol.render.canvas.Instruction.DRAW_IMAGE,e,c,this.image_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]);this.hitDetectionInstructions.push([ol.render.canvas.Instruction.DRAW_IMAGE,
|
|
e,c,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]);this.endGeometry(a,b)}};
|
|
ol.render.canvas.ImageReplay.prototype.drawMultiPointGeometry=function(a,b){if(!goog.isNull(this.image_)){ol.extent.extend(this.extent_,a.getExtent());this.beginGeometry(a);var c=a.getFlatCoordinates(),d=a.getStride(),e=this.coordinates.length,c=this.drawCoordinates_(c,0,c.length,d);this.instructions.push([ol.render.canvas.Instruction.DRAW_IMAGE,e,c,this.image_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]);this.hitDetectionInstructions.push([ol.render.canvas.Instruction.DRAW_IMAGE,
|
|
e,c,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]);this.endGeometry(a,b)}};ol.render.canvas.ImageReplay.prototype.finish=function(){this.reverseHitDetectionInstructions_();this.anchorY_=this.anchorX_=void 0;this.image_=this.hitDetectionImage_=null;this.width_=this.snapToPixel_=this.rotation_=this.rotateWithView_=this.opacity_=this.scale_=this.height_=void 0};
|
|
ol.render.canvas.ImageReplay.prototype.setImageStyle=function(a){var b=a.getAnchor(),c=a.getSize(),d=a.getHitDetectionImage(1),e=a.getImage(1);this.anchorX_=b[0];this.anchorY_=b[1];this.hitDetectionImage_=d;this.image_=e;this.height_=c[1];this.opacity_=a.getOpacity();this.rotateWithView_=a.getRotateWithView();this.rotation_=a.getRotation();this.scale_=a.getScale();this.snapToPixel_=a.getSnapToPixel();this.width_=c[0]};
|
|
ol.render.canvas.LineStringReplay=function(a,b){ol.render.canvas.Replay.call(this,a,b);this.state_={currentStrokeStyle:void 0,currentLineCap:void 0,currentLineDash:null,currentLineJoin:void 0,currentLineWidth:void 0,currentMiterLimit:void 0,lastStroke:0,strokeStyle:void 0,lineCap:void 0,lineDash:null,lineJoin:void 0,lineWidth:void 0,miterLimit:void 0}};goog.inherits(ol.render.canvas.LineStringReplay,ol.render.canvas.Replay);
|
|
ol.render.canvas.LineStringReplay.prototype.drawFlatCoordinates_=function(a,b,c,d){var e=this.coordinates.length;a=this.appendFlatCoordinates(a,b,c,d,!1);e=[ol.render.canvas.Instruction.MOVE_TO_LINE_TO,e,a];this.instructions.push(e);this.hitDetectionInstructions.push(e);return c};
|
|
ol.render.canvas.LineStringReplay.prototype.setStrokeStyle_=function(){var a=this.state_,b=a.strokeStyle,c=a.lineCap,d=a.lineDash,e=a.lineJoin,f=a.lineWidth,g=a.miterLimit;a.currentStrokeStyle==b&&a.currentLineCap==c&&goog.array.equals(a.currentLineDash,d)&&a.currentLineJoin==e&&a.currentLineWidth==f&&a.currentMiterLimit==g||(a.lastStroke!=this.coordinates.length&&(this.instructions.push([ol.render.canvas.Instruction.STROKE]),a.lastStroke=this.coordinates.length),this.instructions.push([ol.render.canvas.Instruction.SET_STROKE_STYLE,
|
|
b,f,c,e,g,d],[ol.render.canvas.Instruction.BEGIN_PATH]),a.currentStrokeStyle=b,a.currentLineCap=c,a.currentLineDash=d,a.currentLineJoin=e,a.currentLineWidth=f,a.currentMiterLimit=g)};
|
|
ol.render.canvas.LineStringReplay.prototype.drawLineStringGeometry=function(a,b){var c=this.state_,d=c.lineWidth;goog.isDef(c.strokeStyle)&&goog.isDef(d)&&(ol.extent.extend(this.extent_,a.getExtent()),this.setStrokeStyle_(),this.beginGeometry(a),this.hitDetectionInstructions.push([ol.render.canvas.Instruction.SET_STROKE_STYLE,c.strokeStyle,c.lineWidth,c.lineCap,c.lineJoin,c.miterLimit,c.lineDash],[ol.render.canvas.Instruction.BEGIN_PATH]),c=a.getFlatCoordinates(),d=a.getStride(),this.drawFlatCoordinates_(c,
|
|
0,c.length,d),this.hitDetectionInstructions.push([ol.render.canvas.Instruction.STROKE]),this.endGeometry(a,b))};
|
|
ol.render.canvas.LineStringReplay.prototype.drawMultiLineStringGeometry=function(a,b){var c=this.state_,d=c.lineWidth;if(goog.isDef(c.strokeStyle)&&goog.isDef(d)){ol.extent.extend(this.extent_,a.getExtent());this.setStrokeStyle_();this.beginGeometry(a);this.hitDetectionInstructions.push([ol.render.canvas.Instruction.SET_STROKE_STYLE,c.strokeStyle,c.lineWidth,c.lineCap,c.lineJoin,c.miterLimit,c.lineDash],[ol.render.canvas.Instruction.BEGIN_PATH]);var c=a.getEnds(),d=a.getFlatCoordinates(),e=a.getStride(),
|
|
f=0,g,h;g=0;for(h=c.length;g<h;++g)f=this.drawFlatCoordinates_(d,f,c[g],e);this.hitDetectionInstructions.push([ol.render.canvas.Instruction.STROKE]);this.endGeometry(a,b)}};ol.render.canvas.LineStringReplay.prototype.finish=function(){this.state_.lastStroke!=this.coordinates.length&&this.instructions.push([ol.render.canvas.Instruction.STROKE]);this.reverseHitDetectionInstructions_();this.state_=null};
|
|
ol.render.canvas.LineStringReplay.prototype.setFillStrokeStyle=function(a,b){var c=b.getColor();this.state_.strokeStyle=ol.color.asString(goog.isNull(c)?ol.render.canvas.defaultStrokeStyle:c);c=b.getLineCap();this.state_.lineCap=goog.isDef(c)?c:ol.render.canvas.defaultLineCap;c=b.getLineDash();this.state_.lineDash=goog.isNull(c)?ol.render.canvas.defaultLineDash:c;c=b.getLineJoin();this.state_.lineJoin=goog.isDef(c)?c:ol.render.canvas.defaultLineJoin;c=b.getWidth();this.state_.lineWidth=goog.isDef(c)?
|
|
c:ol.render.canvas.defaultLineWidth;c=b.getMiterLimit();this.state_.miterLimit=goog.isDef(c)?c:ol.render.canvas.defaultMiterLimit};ol.render.canvas.PolygonReplay=function(a,b){ol.render.canvas.Replay.call(this,a,b);this.state_={currentFillStyle:void 0,currentStrokeStyle:void 0,currentLineCap:void 0,currentLineDash:null,currentLineJoin:void 0,currentLineWidth:void 0,currentMiterLimit:void 0,fillStyle:void 0,strokeStyle:void 0,lineCap:void 0,lineDash:null,lineJoin:void 0,lineWidth:void 0,miterLimit:void 0}};
|
|
goog.inherits(ol.render.canvas.PolygonReplay,ol.render.canvas.Replay);
|
|
ol.render.canvas.PolygonReplay.prototype.drawFlatCoordinatess_=function(a,b,c,d){var e=this.state_,f=[ol.render.canvas.Instruction.BEGIN_PATH];this.instructions.push(f);this.hitDetectionInstructions.push(f);var g,f=0;for(g=c.length;f<g;++f){var h=c[f],k=this.coordinates.length;b=this.appendFlatCoordinates(a,b,h,d,!0);b=[ol.render.canvas.Instruction.MOVE_TO_LINE_TO,k,b];k=[ol.render.canvas.Instruction.CLOSE_PATH];this.instructions.push(b,k);this.hitDetectionInstructions.push(b,k);b=h}a=[ol.render.canvas.Instruction.FILL];
|
|
this.hitDetectionInstructions.push(a);goog.isDef(e.fillStyle)&&this.instructions.push(a);goog.isDef(e.strokeStyle)&&(e=[ol.render.canvas.Instruction.STROKE],this.instructions.push(e),this.hitDetectionInstructions.push(e));return b};
|
|
ol.render.canvas.PolygonReplay.prototype.drawCircleGeometry=function(a,b){var c=this.state_,d=c.strokeStyle;if(goog.isDef(c.fillStyle)||goog.isDef(d)){goog.isDef(d);ol.extent.extend(this.extent_,a.getExtent());this.setFillStrokeStyles_();this.beginGeometry(a);this.hitDetectionInstructions.push([ol.render.canvas.Instruction.SET_FILL_STYLE,ol.color.asString(ol.render.canvas.defaultFillStyle)]);goog.isDef(c.strokeStyle)&&this.hitDetectionInstructions.push([ol.render.canvas.Instruction.SET_STROKE_STYLE,
|
|
c.strokeStyle,c.lineWidth,c.lineCap,c.lineJoin,c.miterLimit,c.lineDash]);var d=a.getFlatCoordinates(),e=a.getStride();this.appendFlatCoordinates(d,0,d.length,e,!1);d=[ol.render.canvas.Instruction.BEGIN_PATH];e=[ol.render.canvas.Instruction.CIRCLE];this.instructions.push(d,e);this.hitDetectionInstructions.push(d,e);this.endGeometry(a,b);d=[ol.render.canvas.Instruction.FILL];this.hitDetectionInstructions.push(d);goog.isDef(c.fillStyle)&&this.instructions.push(d);goog.isDef(c.strokeStyle)&&(c=[ol.render.canvas.Instruction.STROKE],
|
|
this.instructions.push(c),this.hitDetectionInstructions.push(c))}};
|
|
ol.render.canvas.PolygonReplay.prototype.drawPolygonGeometry=function(a,b){var c=this.state_,d=c.strokeStyle;if(goog.isDef(c.fillStyle)||goog.isDef(d)){goog.isDef(d);ol.extent.extend(this.extent_,a.getExtent());this.setFillStrokeStyles_();this.beginGeometry(a);this.hitDetectionInstructions.push([ol.render.canvas.Instruction.SET_FILL_STYLE,ol.color.asString(ol.render.canvas.defaultFillStyle)]);goog.isDef(c.strokeStyle)&&this.hitDetectionInstructions.push([ol.render.canvas.Instruction.SET_STROKE_STYLE,c.strokeStyle,
|
|
c.lineWidth,c.lineCap,c.lineJoin,c.miterLimit,c.lineDash]);var c=a.getEnds(),d=a.getOrientedFlatCoordinates(),e=a.getStride();this.drawFlatCoordinatess_(d,0,c,e);this.endGeometry(a,b)}};
|
|
ol.render.canvas.PolygonReplay.prototype.drawMultiPolygonGeometry=function(a,b){var c=this.state_,d=c.strokeStyle;if(goog.isDef(c.fillStyle)||goog.isDef(d)){goog.isDef(d);ol.extent.extend(this.extent_,a.getExtent());this.setFillStrokeStyles_();this.beginGeometry(a);this.hitDetectionInstructions.push([ol.render.canvas.Instruction.SET_FILL_STYLE,ol.color.asString(ol.render.canvas.defaultFillStyle)]);goog.isDef(c.strokeStyle)&&this.hitDetectionInstructions.push([ol.render.canvas.Instruction.SET_STROKE_STYLE,
|
|
c.strokeStyle,c.lineWidth,c.lineCap,c.lineJoin,c.miterLimit,c.lineDash]);var c=a.getEndss(),d=a.getOrientedFlatCoordinates(),e=a.getStride(),f=0,g,h;g=0;for(h=c.length;g<h;++g)f=this.drawFlatCoordinatess_(d,f,c[g],e);this.endGeometry(a,b)}};ol.render.canvas.PolygonReplay.prototype.finish=function(){this.reverseHitDetectionInstructions_();this.state_=null;var a=this.tolerance;if(0!==a){var b=this.coordinates,c,d;c=0;for(d=b.length;c<d;++c)b[c]=ol.geom.simplify.snap(b[c],a)}};
|
|
ol.render.canvas.PolygonReplay.prototype.setFillStrokeStyle=function(a,b){var c=this.state_;if(goog.isNull(a))c.fillStyle=void 0;else{var d=a.getColor();c.fillStyle=ol.color.asString(goog.isNull(d)?ol.render.canvas.defaultFillStyle:d)}goog.isNull(b)?(c.strokeStyle=void 0,c.lineCap=void 0,c.lineDash=null,c.lineJoin=void 0,c.lineWidth=void 0,c.miterLimit=void 0):(d=b.getColor(),c.strokeStyle=ol.color.asString(goog.isNull(d)?ol.render.canvas.defaultStrokeStyle:d),d=b.getLineCap(),c.lineCap=goog.isDef(d)?
|
|
d:ol.render.canvas.defaultLineCap,d=b.getLineDash(),c.lineDash=goog.isNull(d)?ol.render.canvas.defaultLineDash:d.slice(),d=b.getLineJoin(),c.lineJoin=goog.isDef(d)?d:ol.render.canvas.defaultLineJoin,d=b.getWidth(),c.lineWidth=goog.isDef(d)?d:ol.render.canvas.defaultLineWidth,d=b.getMiterLimit(),c.miterLimit=goog.isDef(d)?d:ol.render.canvas.defaultMiterLimit)};
|
|
ol.render.canvas.PolygonReplay.prototype.setFillStrokeStyles_=function(){var a=this.state_,b=a.fillStyle,c=a.strokeStyle,d=a.lineCap,e=a.lineDash,f=a.lineJoin,g=a.lineWidth,h=a.miterLimit;goog.isDef(b)&&a.currentFillStyle!=b&&(this.instructions.push([ol.render.canvas.Instruction.SET_FILL_STYLE,b]),a.currentFillStyle=a.fillStyle);!goog.isDef(c)||a.currentStrokeStyle==c&&a.currentLineCap==d&&a.currentLineDash==e&&a.currentLineJoin==f&&a.currentLineWidth==g&&a.currentMiterLimit==h||(this.instructions.push([ol.render.canvas.Instruction.SET_STROKE_STYLE,
|
|
c,g,d,f,h,e]),a.currentStrokeStyle=c,a.currentLineCap=d,a.currentLineDash=e,a.currentLineJoin=f,a.currentLineWidth=g,a.currentMiterLimit=h)};ol.render.canvas.TextReplay=function(a,b){ol.render.canvas.Replay.call(this,a,b);this.replayTextState_=this.replayStrokeState_=this.replayFillState_=null;this.text_="";this.textScale_=this.textRotation_=0;this.textState_=this.textStrokeState_=this.textFillState_=null};goog.inherits(ol.render.canvas.TextReplay,ol.render.canvas.Replay);
|
|
ol.render.canvas.TextReplay.prototype.drawText=function(a,b,c,d,e,f){if(!(""===this.text_||goog.isNull(this.textState_)||goog.isNull(this.textFillState_)&&goog.isNull(this.textStrokeState_))){ol.extent.extendFlatCoordinates(this.extent_,a,b,c,d);goog.isNull(this.textFillState_)||this.setReplayFillState_(this.textFillState_);goog.isNull(this.textStrokeState_)||this.setReplayStrokeState_(this.textStrokeState_);this.setReplayTextState_(this.textState_);this.beginGeometry(e);var g=this.coordinates.length;
|
|
a=this.appendFlatCoordinates(a,b,c,d,!1);b=!goog.isNull(this.textFillState_);c=!goog.isNull(this.textStrokeState_);g=[ol.render.canvas.Instruction.DRAW_TEXT,g,a,this.text_,this.textRotation_,this.textScale_,b,c];this.instructions.push(g);this.hitDetectionInstructions.push(g);this.endGeometry(e,f)}};
|
|
ol.render.canvas.TextReplay.prototype.setReplayFillState_=function(a){var b=this.replayFillState_;if(goog.isNull(b)||b.fillStyle!=a.fillStyle){var c=[ol.render.canvas.Instruction.SET_FILL_STYLE,a.fillStyle];this.instructions.push(c);this.hitDetectionInstructions.push(c);goog.isNull(b)?this.replayFillState_={fillStyle:a.fillStyle}:b.fillStyle=a.fillStyle}};
|
|
ol.render.canvas.TextReplay.prototype.setReplayStrokeState_=function(a){var b=this.replayStrokeState_;if(goog.isNull(b)||b.lineCap!=a.lineCap||b.lineDash!=a.lineDash||b.lineJoin!=a.lineJoin||b.lineWidth!=a.lineWidth||b.miterLimit!=a.miterLimit||b.strokeStyle!=a.strokeStyle){var c=[ol.render.canvas.Instruction.SET_STROKE_STYLE,a.strokeStyle,a.lineWidth,a.lineCap,a.lineJoin,a.miterLimit,a.lineDash];this.instructions.push(c);this.hitDetectionInstructions.push(c);goog.isNull(b)?this.replayStrokeState_=
|
|
{lineCap:a.lineCap,lineDash:a.lineDash,lineJoin:a.lineJoin,lineWidth:a.lineWidth,miterLimit:a.miterLimit,strokeStyle:a.strokeStyle}:(b.lineCap=a.lineCap,b.lineDash=a.lineDash,b.lineJoin=a.lineJoin,b.lineWidth=a.lineWidth,b.miterLimit=a.miterLimit,b.strokeStyle=a.strokeStyle)}};
|
|
ol.render.canvas.TextReplay.prototype.setReplayTextState_=function(a){var b=this.replayTextState_;if(goog.isNull(b)||b.font!=a.font||b.textAlign!=a.textAlign||b.textBaseline!=a.textBaseline){var c=[ol.render.canvas.Instruction.SET_TEXT_STYLE,a.font,a.textAlign,a.textBaseline];this.instructions.push(c);this.hitDetectionInstructions.push(c);goog.isNull(b)?this.replayTextState_={font:a.font,textAlign:a.textAlign,textBaseline:a.textBaseline}:(b.font=a.font,b.textAlign=a.textAlign,b.textBaseline=a.textBaseline)}};
|
|
ol.render.canvas.TextReplay.prototype.setTextStyle=function(a){if(goog.isNull(a))this.text_="";else{var b=a.getFill();goog.isNull(b)?this.textFillState_=null:(b=b.getColor(),b=ol.color.asString(goog.isNull(b)?ol.render.canvas.defaultFillStyle:b),goog.isNull(this.textFillState_)?this.textFillState_={fillStyle:b}:this.textFillState_.fillStyle=b);var c=a.getStroke();if(goog.isNull(c))this.textStrokeState_=null;else{var b=c.getColor(),d=c.getLineCap(),e=c.getLineDash(),f=c.getLineJoin(),g=c.getWidth(),
|
|
c=c.getMiterLimit(),d=goog.isDef(d)?d:ol.render.canvas.defaultLineCap,e=goog.isDefAndNotNull(e)?e.slice():ol.render.canvas.defaultLineDash,f=goog.isDef(f)?f:ol.render.canvas.defaultLineJoin,g=goog.isDef(g)?g:ol.render.canvas.defaultLineWidth,c=goog.isDef(c)?c:ol.render.canvas.defaultMiterLimit,b=ol.color.asString(goog.isNull(b)?ol.render.canvas.defaultStrokeStyle:b);if(goog.isNull(this.textStrokeState_))this.textStrokeState_={lineCap:d,lineDash:e,lineJoin:f,lineWidth:g,miterLimit:c,strokeStyle:b};
|
|
else{var h=this.textStrokeState_;h.lineCap=d;h.lineDash=e;h.lineJoin=f;h.lineWidth=g;h.miterLimit=c;h.strokeStyle=b}}f=a.getFont();b=a.getRotation();d=a.getScale();e=a.getText();g=a.getTextAlign();c=a.getTextBaseline();a=goog.isDef(f)?f:ol.render.canvas.defaultFont;g=goog.isDef(g)?g:ol.render.canvas.defaultTextAlign;c=goog.isDef(c)?c:ol.render.canvas.defaultTextBaseline;goog.isNull(this.textState_)?this.textState_={font:a,textAlign:g,textBaseline:c}:(f=this.textState_,f.font=a,f.textAlign=g,f.textBaseline=
|
|
c);this.text_=goog.isDef(e)?e:"";this.textRotation_=goog.isDef(b)?b:0;this.textScale_=goog.isDef(d)?d:1}};ol.render.canvas.ReplayGroup=function(a,b){this.tolerance_=a;this.maxExtent_=b;this.replaysByZIndex_={};var c=goog.dom.createElement(goog.dom.TagName.CANVAS);c.width=1;c.height=1;this.hitDetectionContext_=c.getContext("2d");this.hitDetectionTransform_=goog.vec.Mat4.createNumber()};
|
|
ol.render.canvas.ReplayGroup.prototype.replay=function(a,b,c,d,e,f){var g=goog.array.map(goog.object.getKeys(this.replaysByZIndex_),Number);goog.array.sort(g);return this.replay_(g,a,b,c,d,e,f)};ol.render.canvas.ReplayGroup.prototype.replayHitDetection_=function(a,b,c,d,e,f,g){var h,k,l,m,n;h=0;for(k=a.length;h<k;++h)for(m in l=this.replaysByZIndex_[a[h].toString()],l)if(n=l[m],ol.extent.intersects(c,n.getExtent())&&(n=n.replayHitDetection(b,d,e,f,g)))return n};
|
|
ol.render.canvas.ReplayGroup.prototype.replay_=function(a,b,c,d,e,f,g){var h=this.maxExtent_,k=h[0],l=h[1],m=h[2],h=h[3],k=ol.geom.flat.transform2D([k,l,k,h,m,h,m,l],2,e);b.save();b.beginPath();b.moveTo(k[0],k[1]);b.lineTo(k[2],k[3]);b.lineTo(k[4],k[5]);b.lineTo(k[6],k[7]);b.closePath();b.clip();for(var n,p,k=0,l=a.length;k<l;++k)for(n=this.replaysByZIndex_[a[k].toString()],m=0,h=ol.render.REPLAY_ORDER.length;m<h;++m)if(p=n[ol.render.REPLAY_ORDER[m]],goog.isDef(p)&&ol.extent.intersects(c,p.getExtent())&&
|
|
(p=p.replay(b,d,e,f,g)))return p;b.restore()};
|
|
ol.render.canvas.ReplayGroup.prototype.forEachGeometryAtPixel=function(a,b,c,d,e,f){var g=this.hitDetectionTransform_;ol.vec.Mat4.makeTransform2D(g,0.5,0.5,1/b,-1/b,-c,-d[0],-d[1]);b=goog.array.map(goog.object.getKeys(this.replaysByZIndex_),Number);goog.array.sort(b,function(a,b){return b-a});var h=this.hitDetectionContext_;h.clearRect(0,0,1,1);return this.replayHitDetection_(b,h,a,g,c,e,function(a,b){if(0<h.getImageData(0,0,1,1).data[3]){var c=f(a,b);if(c)return c;h.clearRect(0,0,1,1)}})};
|
|
ol.render.canvas.ReplayGroup.prototype.finish=function(){for(var a in this.replaysByZIndex_){var b=this.replaysByZIndex_[a],c;for(c in b)b[c].finish()}};ol.render.canvas.ReplayGroup.prototype.getReplay=function(a,b){var c=goog.isDef(a)?a.toString():"0",d=this.replaysByZIndex_[c];goog.isDef(d)||(d={},this.replaysByZIndex_[c]=d);c=d[b];goog.isDef(c)||(c=new ol.render.canvas.BATCH_CONSTRUCTORS_[b](this.tolerance_,this.maxExtent_),d[b]=c);return c};ol.render.canvas.ReplayGroup.prototype.isEmpty=function(){return goog.object.isEmpty(this.replaysByZIndex_)};
|
|
ol.render.canvas.BATCH_CONSTRUCTORS_={Image:ol.render.canvas.ImageReplay,LineString:ol.render.canvas.LineStringReplay,Polygon:ol.render.canvas.PolygonReplay,Text:ol.render.canvas.TextReplay};ol.geom.Circle=function(a,b,c){ol.geom.SimpleGeometry.call(this);b=goog.isDef(b)?b:0;this.setCenterAndRadius(a,b,c)};goog.inherits(ol.geom.Circle,ol.geom.SimpleGeometry);ol.geom.Circle.prototype.clone=function(){var a=new ol.geom.Circle(null);a.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return a};
|
|
ol.geom.Circle.prototype.closestPointXY=function(a,b,c,d){var e=this.flatCoordinates;a-=e[0];var f=b-e[1];b=a*a+f*f;if(b<d){0===b?d=0:(d=this.getRadius()/Math.sqrt(b),c[0]=e[0]+d*a,c[1]=e[1]+d*f,d=2);for(;d<this.stride;++d)c[d]=e[d];c.length=this.stride;return b}return d};ol.geom.Circle.prototype.containsXY=function(a,b){var c=this.flatCoordinates,d=a-c[0],c=b-c[1];return d*d+c*c<=this.getRadiusSquared_()};ol.geom.Circle.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)};
|
|
ol.geom.Circle.prototype.getExtent=function(a){if(this.extentRevision!=this.getRevision()){var b=this.flatCoordinates,c=b[this.stride]-b[0];this.extent=ol.extent.createOrUpdate(b[0]-c,b[1]-c,b[0]+c,b[1]+c,this.extent);this.extentRevision=this.getRevision()}return ol.extent.returnOrUpdate(this.extent,a)};ol.geom.Circle.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())};
|
|
ol.geom.Circle.prototype.getRadiusSquared_=function(){var a=this.flatCoordinates[this.stride]-this.flatCoordinates[0],b=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return a*a+b*b};ol.geom.Circle.prototype.getSimplifiedGeometry=function(a){return this};ol.geom.Circle.prototype.getType=function(){return ol.geom.GeometryType.CIRCLE};
|
|
ol.geom.Circle.prototype.setCenter=function(a){var b=this.stride,c=this.flatCoordinates[b]-this.flatCoordinates[0],d=a.slice();d[b]=d[0]+c;for(c=1;c<b;++c)d[b+c]=a[c];this.setFlatCoordinates(this.layout,d)};
|
|
ol.geom.Circle.prototype.setCenterAndRadius=function(a,b,c){if(goog.isNull(a))this.setFlatCoordinates(ol.geom.GeometryLayout.XY,null);else{this.setLayout(c,a,0);goog.isNull(this.flatCoordinates)&&(this.flatCoordinates=[]);c=this.flatCoordinates;a=ol.geom.flat.deflateCoordinate(c,0,a,this.stride);c[a++]=c[0]+b;var d;b=1;for(d=this.stride;b<d;++b)c[a++]=c[b];c.length=a;this.dispatchChangeEvent()}};ol.geom.Circle.prototype.setFlatCoordinates=function(a,b){this.setFlatCoordinatesInternal(a,b);this.dispatchChangeEvent()};
|
|
ol.geom.Circle.prototype.setRadius=function(a){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+a;this.dispatchChangeEvent()};ol.geom.GeometryCollection=function(a){ol.geom.Geometry.call(this);this.geometries_=goog.isDef(a)?a:null;this.listenGeometriesChange_()};goog.inherits(ol.geom.GeometryCollection,ol.geom.Geometry);ol.geom.GeometryCollection.cloneGeometries_=function(a){var b=[],c,d;c=0;for(d=a.length;c<d;++c)b.push(a[c].clone());return b};
|
|
ol.geom.GeometryCollection.prototype.unlistenGeometriesChange_=function(){var a,b;if(!goog.isNull(this.geometries_))for(a=0,b=this.geometries_.length;a<b;++a)goog.events.unlisten(this.geometries_[a],goog.events.EventType.CHANGE,this.dispatchChangeEvent,!1,this)};
|
|
ol.geom.GeometryCollection.prototype.listenGeometriesChange_=function(){var a,b;if(!goog.isNull(this.geometries_))for(a=0,b=this.geometries_.length;a<b;++a)goog.events.listen(this.geometries_[a],goog.events.EventType.CHANGE,this.dispatchChangeEvent,!1,this)};ol.geom.GeometryCollection.prototype.clone=function(){var a=new ol.geom.GeometryCollection(null);a.setGeometries(this.geometries_);return a};
|
|
ol.geom.GeometryCollection.prototype.closestPointXY=function(a,b,c,d){if(d<ol.extent.closestSquaredDistanceXY(this.getExtent(),a,b))return d;var e=this.geometries_,f,g;f=0;for(g=e.length;f<g;++f)d=e[f].closestPointXY(a,b,c,d);return d};ol.geom.GeometryCollection.prototype.containsXY=function(a,b){var c=this.geometries_,d,e;d=0;for(e=c.length;d<e;++d)if(c[d].containsXY(a,b))return!0;return!1};
|
|
ol.geom.GeometryCollection.prototype.getExtent=function(a){if(this.extentRevision!=this.getRevision()){var b=ol.extent.createOrUpdateEmpty(this.extent),c=this.geometries_,d,e;d=0;for(e=c.length;d<e;++d)ol.extent.extend(b,c[d].getExtent());this.extent=b;this.extentRevision=this.getRevision()}return ol.extent.returnOrUpdate(this.extent,a)};ol.geom.GeometryCollection.prototype.getGeometries=function(){return ol.geom.GeometryCollection.cloneGeometries_(this.geometries_)};
|
|
ol.geom.GeometryCollection.prototype.getGeometriesArray=function(){return this.geometries_};
|
|
ol.geom.GeometryCollection.prototype.getSimplifiedGeometry=function(a){this.simplifiedGeometryRevision!=this.getRevision()&&(goog.object.clear(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision());if(0>a||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&a<this.simplifiedGeometryMaxMinSquaredTolerance)return this;var b=a.toString();if(this.simplifiedGeometryCache.hasOwnProperty(b))return this.simplifiedGeometryCache[b];var c=
|
|
[],d=this.geometries_,e=!1,f,g;f=0;for(g=d.length;f<g;++f){var h=d[f],k=h.getSimplifiedGeometry(a);c.push(k);k!==h&&(e=!0)}if(e)return a=new ol.geom.GeometryCollection(null),a.setGeometriesArray(c),this.simplifiedGeometryCache[b]=a;this.simplifiedGeometryMaxMinSquaredTolerance=a;return this};ol.geom.GeometryCollection.prototype.getType=function(){return ol.geom.GeometryType.GEOMETRY_COLLECTION};ol.geom.GeometryCollection.prototype.isEmpty=function(){return goog.array.isEmpty(this.geometries_)};
|
|
ol.geom.GeometryCollection.prototype.setGeometries=function(a){this.setGeometriesArray(ol.geom.GeometryCollection.cloneGeometries_(a))};ol.geom.GeometryCollection.prototype.setGeometriesArray=function(a){this.unlistenGeometriesChange_();this.geometries_=a;this.listenGeometriesChange_();this.dispatchChangeEvent()};ol.geom.GeometryCollection.prototype.transform=function(a){var b=this.geometries_,c,d;c=0;for(d=b.length;c<d;++c)b[c].transform(a);this.dispatchChangeEvent()};
|
|
ol.geom.GeometryCollection.prototype.disposeInternal=function(){this.unlistenGeometriesChange_();ol.geom.GeometryCollection.superClass_.disposeInternal.call(this)};ol.geom.LineString=function(a,b){ol.geom.SimpleGeometry.call(this);this.flatMidpoint_=null;this.maxDeltaRevision_=this.maxDelta_=this.flatMidpointRevision_=-1;this.setCoordinates(a,b)};goog.inherits(ol.geom.LineString,ol.geom.SimpleGeometry);ol.geom.LineString.prototype.clone=function(){var a=new ol.geom.LineString(null);a.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return a};
|
|
ol.geom.LineString.prototype.closestPointXY=function(a,b,c,d){if(d<ol.extent.closestSquaredDistanceXY(this.getExtent(),a,b))return d;this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ol.geom.closest.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision());return ol.geom.closest.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,a,b,c,d)};
|
|
ol.geom.LineString.prototype.getCoordinateAtM=function(a,b){if(this.layout!=ol.geom.GeometryLayout.XYM&&this.layout!=ol.geom.GeometryLayout.XYZM)return null;var c=goog.isDef(b)?b:!1;return ol.geom.flat.lineStringCoordinateAtM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,a,c)};ol.geom.LineString.prototype.getCoordinates=function(){return ol.geom.flat.inflateCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};
|
|
ol.geom.LineString.prototype.getLength=function(){return ol.geom.flat.lineStringLength(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};ol.geom.LineString.prototype.getFlatMidpoint=function(){this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=ol.geom.flat.lineStringInterpolate(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision());return this.flatMidpoint_};
|
|
ol.geom.LineString.prototype.getSimplifiedGeometryInternal=function(a){var b=[];b.length=ol.geom.simplify.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,a,b,0);a=new ol.geom.LineString(null);a.setFlatCoordinates(ol.geom.GeometryLayout.XY,b);return a};ol.geom.LineString.prototype.getType=function(){return ol.geom.GeometryType.LINE_STRING};
|
|
ol.geom.LineString.prototype.setCoordinates=function(a,b){goog.isNull(a)?this.setFlatCoordinates(ol.geom.GeometryLayout.XY,null):(this.setLayout(b,a,1),goog.isNull(this.flatCoordinates)&&(this.flatCoordinates=[]),this.flatCoordinates.length=ol.geom.flat.deflateCoordinates(this.flatCoordinates,0,a,this.stride),this.dispatchChangeEvent())};ol.geom.LineString.prototype.setFlatCoordinates=function(a,b){this.setFlatCoordinatesInternal(a,b);this.dispatchChangeEvent()};ol.geom.MultiLineString=function(a,b){ol.geom.SimpleGeometry.call(this);this.ends_=[];this.maxDeltaRevision_=this.maxDelta_=-1;this.setCoordinates(a,b)};goog.inherits(ol.geom.MultiLineString,ol.geom.SimpleGeometry);ol.geom.MultiLineString.prototype.clone=function(){var a=new ol.geom.MultiLineString(null);a.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),this.ends_.slice());return a};
|
|
ol.geom.MultiLineString.prototype.closestPointXY=function(a,b,c,d){if(d<ol.extent.closestSquaredDistanceXY(this.getExtent(),a,b))return d;this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ol.geom.closest.getsMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision());return ol.geom.closest.getsClosestPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,a,b,c,d)};
|
|
ol.geom.MultiLineString.prototype.getCoordinateAtM=function(a,b,c){if(this.layout!=ol.geom.GeometryLayout.XYM&&this.layout!=ol.geom.GeometryLayout.XYZM||0===this.flatCoordinates.length)return null;b=goog.isDef(b)?b:!1;c=goog.isDef(c)?c:!1;return ol.geom.flat.lineStringsCoordinateAtM(this.flatCoordinates,0,this.ends_,this.stride,a,b,c)};ol.geom.MultiLineString.prototype.getCoordinates=function(){return ol.geom.flat.inflateCoordinatess(this.flatCoordinates,0,this.ends_,this.stride)};
|
|
ol.geom.MultiLineString.prototype.getEnds=function(){return this.ends_};ol.geom.MultiLineString.prototype.getLineStrings=function(){var a=this.getCoordinates(),b=[],c,d;c=0;for(d=a.length;c<d;++c)b.push(new ol.geom.LineString(a[c]));return b};ol.geom.MultiLineString.prototype.getFlatMidpoints=function(){var a=[],b=this.flatCoordinates,c=0,d=this.ends_,e=this.stride,f,g;f=0;for(g=d.length;f<g;++f){var h=d[f],c=ol.geom.flat.lineStringInterpolate(b,c,h,e,0.5);goog.array.extend(a,c);c=h}return a};
|
|
ol.geom.MultiLineString.prototype.getSimplifiedGeometryInternal=function(a){var b=[],c=[];b.length=ol.geom.simplify.douglasPeuckers(this.flatCoordinates,0,this.ends_,this.stride,a,b,0,c);a=new ol.geom.MultiLineString(null);a.setFlatCoordinates(ol.geom.GeometryLayout.XY,b,c);return a};ol.geom.MultiLineString.prototype.getType=function(){return ol.geom.GeometryType.MULTI_LINE_STRING};
|
|
ol.geom.MultiLineString.prototype.setCoordinates=function(a,b){if(goog.isNull(a))this.setFlatCoordinates(ol.geom.GeometryLayout.XY,null,this.ends_);else{this.setLayout(b,a,2);goog.isNull(this.flatCoordinates)&&(this.flatCoordinates=[]);var c=ol.geom.flat.deflateCoordinatess(this.flatCoordinates,0,a,this.stride,this.ends_);this.flatCoordinates.length=0===c.length?0:c[c.length-1];this.dispatchChangeEvent()}};
|
|
ol.geom.MultiLineString.prototype.setFlatCoordinates=function(a,b,c){this.setFlatCoordinatesInternal(a,b);this.ends_=c;this.dispatchChangeEvent()};ol.geom.MultiLineString.prototype.setLineStrings=function(a){var b=ol.geom.GeometryLayout.XY,c=[],d=[],e,f;e=0;for(f=a.length;e<f;++e){var g=a[e];0===e&&(b=g.getLayout());goog.array.extend(c,g.getFlatCoordinates());d.push(c.length)}this.setFlatCoordinates(b,c,d)};ol.geom.MultiPoint=function(a,b){ol.geom.SimpleGeometry.call(this);this.setCoordinates(a,b)};goog.inherits(ol.geom.MultiPoint,ol.geom.SimpleGeometry);ol.geom.MultiPoint.prototype.clone=function(){var a=new ol.geom.MultiPoint(null);a.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return a};
|
|
ol.geom.MultiPoint.prototype.closestPointXY=function(a,b,c,d){if(d<ol.extent.closestSquaredDistanceXY(this.getExtent(),a,b))return d;var e=this.flatCoordinates,f=this.stride,g,h,k;g=0;for(h=e.length;g<h;g+=f)if(k=ol.geom.flat.squaredDistance(a,b,e[g],e[g+1]),k<d){d=k;for(k=0;k<f;++k)c[k]=e[g+k];c.length=f}return d};ol.geom.MultiPoint.prototype.getCoordinates=function(){return ol.geom.flat.inflateCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};
|
|
ol.geom.MultiPoint.prototype.getPoints=function(){var a=this.getCoordinates(),b=[],c,d;c=0;for(d=a.length;c<d;++c)b.push(new ol.geom.Point(a[c]));return b};ol.geom.MultiPoint.prototype.getType=function(){return ol.geom.GeometryType.MULTI_POINT};
|
|
ol.geom.MultiPoint.prototype.setCoordinates=function(a,b){goog.isNull(a)?this.setFlatCoordinates(ol.geom.GeometryLayout.XY,null):(this.setLayout(b,a,1),goog.isNull(this.flatCoordinates)&&(this.flatCoordinates=[]),this.flatCoordinates.length=ol.geom.flat.deflateCoordinates(this.flatCoordinates,0,a,this.stride),this.dispatchChangeEvent())};ol.geom.MultiPoint.prototype.setFlatCoordinates=function(a,b){this.setFlatCoordinatesInternal(a,b);this.dispatchChangeEvent()};ol.geom.MultiPolygon=function(a,b){ol.geom.SimpleGeometry.call(this);this.endss_=[];this.flatInteriorPointsRevision_=-1;this.flatInteriorPoints_=null;this.orientedRevision_=this.maxDeltaRevision_=this.maxDelta_=-1;this.orientedFlatCoordinates_=null;this.setCoordinates(a,b)};goog.inherits(ol.geom.MultiPolygon,ol.geom.SimpleGeometry);
|
|
ol.geom.MultiPolygon.prototype.clone=function(){var a=new ol.geom.MultiPolygon(null);a.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),this.endss_.slice());return a};
|
|
ol.geom.MultiPolygon.prototype.closestPointXY=function(a,b,c,d){if(d<ol.extent.closestSquaredDistanceXY(this.getExtent(),a,b))return d;this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ol.geom.closest.getssMaxSquaredDelta(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision());return ol.geom.closest.getssClosestPoint(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,a,b,c,d)};
|
|
ol.geom.MultiPolygon.prototype.containsXY=function(a,b){return ol.geom.flat.linearRingssContainsXY(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,a,b)};ol.geom.MultiPolygon.prototype.getArea=function(){return ol.geom.flat.linearRingssArea(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)};ol.geom.MultiPolygon.prototype.getCoordinates=function(){return ol.geom.flat.inflateCoordinatesss(this.flatCoordinates,0,this.endss_,this.stride)};
|
|
ol.geom.MultiPolygon.prototype.getEndss=function(){return this.endss_};ol.geom.MultiPolygon.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var a=ol.geom.flat.linearRingssGetFlatCenters(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=ol.geom.flat.linearRingssGetInteriorPoints(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,a);this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_};
|
|
ol.geom.MultiPolygon.prototype.getInteriorPoints=function(){var a=new ol.geom.MultiPoint(null);a.setFlatCoordinates(ol.geom.GeometryLayout.XY,this.getFlatInteriorPoints().slice());return a};
|
|
ol.geom.MultiPolygon.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var a=this.flatCoordinates;ol.geom.flat.linearRingssAreOriented(a,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=a:(this.orientedFlatCoordinates_=a.slice(),this.orientedFlatCoordinates_.length=ol.geom.flat.orientLinearRingss(this.orientedFlatCoordinates_,0,this.endss_,this.stride));this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_};
|
|
ol.geom.MultiPolygon.prototype.getSimplifiedGeometryInternal=function(a){var b=[],c=[];b.length=ol.geom.simplify.quantizess(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(a),b,0,c);a=new ol.geom.MultiPolygon(null);a.setFlatCoordinates(ol.geom.GeometryLayout.XY,b,c);return a};
|
|
ol.geom.MultiPolygon.prototype.getPolygons=function(){var a=this.layout,b=this.flatCoordinates,c=this.endss_,d=[],e=0,f,g;f=0;for(g=c.length;f<g;++f){var h=c[f],k=h[h.length-1],l=new ol.geom.Polygon(null);l.setFlatCoordinates(a,b.slice(e,k),h.slice());d.push(l);e=k}return d};ol.geom.MultiPolygon.prototype.getType=function(){return ol.geom.GeometryType.MULTI_POLYGON};
|
|
ol.geom.MultiPolygon.prototype.setCoordinates=function(a,b){if(goog.isNull(a))this.setFlatCoordinates(ol.geom.GeometryLayout.XY,null,this.endss_);else{this.setLayout(b,a,3);goog.isNull(this.flatCoordinates)&&(this.flatCoordinates=[]);var c=ol.geom.flat.deflateCoordinatesss(this.flatCoordinates,0,a,this.stride,this.endss_),c=c[c.length-1];this.flatCoordinates.length=0===c.length?0:c[c.length-1];this.dispatchChangeEvent()}};
|
|
ol.geom.MultiPolygon.prototype.setFlatCoordinates=function(a,b,c){this.setFlatCoordinatesInternal(a,b);this.endss_=c;this.dispatchChangeEvent()};ol.geom.MultiPolygon.prototype.setPolygons=function(a){var b=ol.geom.GeometryLayout.XY,c=[],d=[],e,f,g;e=0;for(f=a.length;e<f;++e){var h=a[e];0===e&&(b=h.getLayout());var k=c.length;g=h.getEnds();var l,m;l=0;for(m=g.length;l<m;++l)g[l]+=k;goog.array.extend(c,h.getFlatCoordinates());d.push(g)}this.setFlatCoordinates(b,c,d)};ol.renderer.vector={};ol.renderer.vector.renderCircleGeometry_=function(a,b,c,d){var e=c.getFill(),f=c.getStroke();if(!goog.isNull(e)||!goog.isNull(f)){var g=a.getReplay(c.getZIndex(),ol.render.ReplayType.POLYGON);g.setFillStrokeStyle(e,f);g.drawCircleGeometry(b,d)}e=c.getText();goog.isNull(e)||(a=a.getReplay(c.getZIndex(),ol.render.ReplayType.TEXT),a.setTextStyle(e),a.drawText(b.getCenter(),0,2,2,b,d))};
|
|
ol.renderer.vector.renderFeature=function(a,b,c,d,e,f,g){var h=!1,k,l;k=c.getImage();goog.isNull(k)?ol.renderer.vector.renderFeature_(a,b,c,d,e):(l=k.getImageState(),l==ol.style.ImageState.LOADED||l==ol.style.ImageState.ERROR?(k.unlistenImageChange(f,g),l==ol.style.ImageState.LOADED&&ol.renderer.vector.renderFeature_(a,b,c,d,e)):(l==ol.style.ImageState.IDLE&&k.load(),k.getImageState(),k.listenImageChange(f,g),h=!0));return h};
|
|
ol.renderer.vector.renderFeature_=function(a,b,c,d,e){b=b.getGeometry();goog.isNull(b)||(d=b.getSimplifiedGeometry(d),(0,ol.renderer.vector.GEOMETRY_RENDERERS_[d.getType()])(a,d,c,e))};ol.renderer.vector.renderGeometryCollectionGeometry_=function(a,b,c,d){b=b.getGeometriesArray();var e,f;e=0;for(f=b.length;e<f;++e)(0,ol.renderer.vector.GEOMETRY_RENDERERS_[b[e].getType()])(a,b[e],c,d)};
|
|
ol.renderer.vector.renderLineStringGeometry_=function(a,b,c,d){var e=c.getStroke();if(!goog.isNull(e)){var f=a.getReplay(c.getZIndex(),ol.render.ReplayType.LINE_STRING);f.setFillStrokeStyle(null,e);f.drawLineStringGeometry(b,d)}e=c.getText();goog.isNull(e)||(a=a.getReplay(c.getZIndex(),ol.render.ReplayType.TEXT),a.setTextStyle(e),a.drawText(b.getFlatMidpoint(),0,2,2,b,d))};
|
|
ol.renderer.vector.renderMultiLineStringGeometry_=function(a,b,c,d){var e=c.getStroke();if(!goog.isNull(e)){var f=a.getReplay(c.getZIndex(),ol.render.ReplayType.LINE_STRING);f.setFillStrokeStyle(null,e);f.drawMultiLineStringGeometry(b,d)}e=c.getText();goog.isNull(e)||(a=a.getReplay(c.getZIndex(),ol.render.ReplayType.TEXT),a.setTextStyle(e),c=b.getFlatMidpoints(),a.drawText(c,0,c.length,2,b,d))};
|
|
ol.renderer.vector.renderMultiPolygonGeometry_=function(a,b,c,d){var e=c.getFill(),f=c.getStroke();if(!goog.isNull(f)||!goog.isNull(e)){var g=a.getReplay(c.getZIndex(),ol.render.ReplayType.POLYGON);g.setFillStrokeStyle(e,f);g.drawMultiPolygonGeometry(b,d)}e=c.getText();goog.isNull(e)||(a=a.getReplay(c.getZIndex(),ol.render.ReplayType.TEXT),a.setTextStyle(e),c=b.getFlatInteriorPoints(),a.drawText(c,0,c.length,2,b,d))};
|
|
ol.renderer.vector.renderPointGeometry_=function(a,b,c,d){var e=c.getImage();if(!goog.isNull(e)){var f=a.getReplay(c.getZIndex(),ol.render.ReplayType.IMAGE);f.setImageStyle(e);f.drawPointGeometry(b,d)}e=c.getText();goog.isNull(e)||(a=a.getReplay(c.getZIndex(),ol.render.ReplayType.TEXT),a.setTextStyle(e),a.drawText(b.getCoordinates(),0,2,2,b,d))};
|
|
ol.renderer.vector.renderMultiPointGeometry_=function(a,b,c,d){var e=c.getImage();if(!goog.isNull(e)){var f=a.getReplay(c.getZIndex(),ol.render.ReplayType.IMAGE);f.setImageStyle(e);f.drawMultiPointGeometry(b,d)}e=c.getText();goog.isNull(e)||(a=a.getReplay(c.getZIndex(),ol.render.ReplayType.TEXT),a.setTextStyle(e),c=b.getFlatCoordinates(),a.drawText(c,0,c.length,b.getStride(),b,d))};
|
|
ol.renderer.vector.renderPolygonGeometry_=function(a,b,c,d){var e=c.getFill(),f=c.getStroke();if(!goog.isNull(e)||!goog.isNull(f)){var g=a.getReplay(c.getZIndex(),ol.render.ReplayType.POLYGON);g.setFillStrokeStyle(e,f);g.drawPolygonGeometry(b,d)}e=c.getText();goog.isNull(e)||(a=a.getReplay(c.getZIndex(),ol.render.ReplayType.TEXT),a.setTextStyle(e),a.drawText(b.getFlatInteriorPoint(),0,2,2,b,d))};
|
|
ol.renderer.vector.GEOMETRY_RENDERERS_={Point:ol.renderer.vector.renderPointGeometry_,LineString:ol.renderer.vector.renderLineStringGeometry_,Polygon:ol.renderer.vector.renderPolygonGeometry_,MultiPoint:ol.renderer.vector.renderMultiPointGeometry_,MultiLineString:ol.renderer.vector.renderMultiLineStringGeometry_,MultiPolygon:ol.renderer.vector.renderMultiPolygonGeometry_,GeometryCollection:ol.renderer.vector.renderGeometryCollectionGeometry_,Circle:ol.renderer.vector.renderCircleGeometry_};ol.structs.RBushNode=function(a,b,c,d){this.extent=a;this.height=b;this.children=c;this.value=d};ol.structs.RBushNode.compareMinX=function(a,b){return a.extent[0]-b.extent[0]};ol.structs.RBushNode.compareMinY=function(a,b){return a.extent[1]-b.extent[1]};ol.structs.RBushNode.prototype.assertValid=function(a){if(0!==this.height){var b,c;b=0;for(c=this.children.length;b<c;++b)this.children[b].assertValid(a)}};
|
|
ol.structs.RBushNode.prototype.getChildrenExtent=function(a,b,c){var d=this.children;for(c=ol.extent.createOrUpdateEmpty(c);a<b;++a)ol.extent.extend(c,d[a].extent);return c};ol.structs.RBushNode.prototype.remove=function(a,b,c){var d=this.children,e=d.length,f,g;if(1==this.height)for(g=0;g<e;++g){if(f=d[g],f.value===b)return goog.array.removeAt(d,g),!0}else for(g=0;g<e;++g)if(f=d[g],ol.extent.containsExtent(f.extent,a)){c.push(f);if(f.remove(a,b,c))return!0;c.pop()}return!1};
|
|
ol.structs.RBushNode.prototype.updateExtent=function(){var a=ol.extent.createOrUpdateEmpty(this.extent),b=this.children,c,d;c=0;for(d=b.length;c<d;++c)ol.extent.extend(a,b[c].extent)};ol.structs.RBushNode.prototype.isLeaf=function(){return goog.isNull(this.children)};
|
|
ol.structs.RBush=function(a){this.maxEntries_=Math.max(4,goog.isDef(a)?a:9);this.minEntries_=Math.max(2,Math.ceil(0.4*this.maxEntries_));this.root_=new ol.structs.RBushNode(ol.extent.createEmpty(),1,[],null);this.valueExtent_={};goog.DEBUG&&(this.readers_=0)};
|
|
ol.structs.RBush.prototype.allDistMargin_=function(a,b){var c=a.children,d=this.minEntries_,e=c.length,f;goog.array.sort(c,b);var g=a.getChildrenExtent(0,d),h=a.getChildrenExtent(e-d,e),k=ol.extent.getMargin(g)+ol.extent.getMargin(h);for(f=d;f<e-d;++f)ol.extent.extend(g,c[f].extent),k+=ol.extent.getMargin(g);for(f=e-d-1;f>=d;--f)ol.extent.extend(h,c[f].extent),k+=ol.extent.getMargin(h);return k};ol.structs.RBush.prototype.assertValid=function(){this.root_.assertValid(this.maxEntries_)};
|
|
ol.structs.RBush.prototype.chooseSplitAxis_=function(a){var b=this.allDistMargin_(a,ol.structs.RBushNode.compareMinX),c=this.allDistMargin_(a,ol.structs.RBushNode.compareMinY);b<c&&goog.array.sort(a.children,ol.structs.RBushNode.compareMinX)};
|
|
ol.structs.RBush.prototype.chooseSplitIndex_=function(a){var b=this.minEntries_,c=a.children.length,d=Infinity,e=Infinity,f=ol.extent.createEmpty(),g=ol.extent.createEmpty(),h=0,k;for(k=b;k<=c-b;++k){var f=a.getChildrenExtent(0,k,f),g=a.getChildrenExtent(k,c,g),l=ol.extent.getIntersectionArea(f,g),m=ol.extent.getArea(f)+ol.extent.getArea(g);l<d?(d=l,e=Math.min(m,e),h=k):l==d&&m<e&&(e=m,h=k)}return h};
|
|
ol.structs.RBush.prototype.chooseSubtree_=function(a,b,c,d){for(;!b.isLeaf()&&d.length-1!=c;){var e=Infinity,f=Infinity;b=b.children;var g=null,h,k;h=0;for(k=b.length;h<k;++h){var l=b[h],m=ol.extent.getArea(l.extent),n=ol.extent.getEnlargedArea(l.extent,a)-m;n<f?(f=n,e=Math.min(m,e),g=l):n==f&&m<e&&(e=m,g=l)}b=g;d.push(b)}return b};ol.structs.RBush.prototype.clear=function(){var a=this.root_;a.extent=ol.extent.createOrUpdateEmpty(this.root_.extent);a.height=1;a.children.length=0;a.value=null;goog.object.clear(this.valueExtent_)};
|
|
ol.structs.RBush.prototype.condense_=function(a){var b;for(b=a.length-1;0<=b;--b){var c=a[b];0===c.children.length?0<b?goog.array.remove(a[b-1].children,c):this.clear():c.updateExtent()}};ol.structs.RBush.prototype.forEach=function(a,b){if(goog.DEBUG){++this.readers_;try{return this.forEach_(this.root_,a,b)}finally{--this.readers_}}else return this.forEach_(this.root_,a,b)};
|
|
ol.structs.RBush.prototype.forEach_=function(a,b,c){for(var d=[a],e,f,g;0<d.length;)if(a=d.pop(),e=a.children,1==a.height)for(a=0,f=e.length;a<f;++a){if(g=b.call(c,e[a].value))return g}else d.push.apply(d,e)};ol.structs.RBush.prototype.forEachInExtent=function(a,b,c){if(goog.DEBUG){++this.readers_;try{return this.forEachInExtent_(a,b,c)}finally{--this.readers_}}else return this.forEachInExtent_(a,b,c)};
|
|
ol.structs.RBush.prototype.forEachInExtent_=function(a,b,c){for(var d=[this.root_],e;0<d.length;)if(e=d.pop(),ol.extent.intersects(a,e.extent))if(e.isLeaf()){if(e=b.call(c,e.value))return e}else if(ol.extent.containsExtent(a,e.extent)){if(e=this.forEach_(e,b,c))return e}else d.push.apply(d,e.children)};ol.structs.RBush.prototype.forEachNode=function(a,b){for(var c=[this.root_];0<c.length;){var d=c.pop(),e=a.call(b,d);if(e)return e;d.isLeaf()||c.push.apply(c,d.children)}};
|
|
ol.structs.RBush.prototype.getAll=function(){var a=[];this.forEach(function(b){a.push(b)});return a};ol.structs.RBush.prototype.getInExtent=function(a){var b=[];this.forEachInExtent(a,function(a){b.push(a)});return b};ol.structs.RBush.prototype.getExtent=function(a){return ol.extent.returnOrUpdate(this.root_.extent,a)};ol.structs.RBush.prototype.getKey_=function(a){return goog.getUid(a).toString()};
|
|
ol.structs.RBush.prototype.insert=function(a,b){if(goog.DEBUG&&this.readers_)throw Error("cannot insert value while reading");var c=this.getKey_(b);this.insert_(a,b,this.root_.height-1);this.valueExtent_[c]=ol.extent.clone(a)};
|
|
ol.structs.RBush.prototype.insert_=function(a,b,c){var d=[this.root_];c=this.chooseSubtree_(a,this.root_,c,d);c.children.push(new ol.structs.RBushNode(a,0,null,b));ol.extent.extend(c.extent,a);for(b=d.length-1;0<=b;--b)if(d[b].children.length>this.maxEntries_)this.split_(d,b);else break;for(;0<=b;--b)ol.extent.extend(d[b].extent,a);return c};ol.structs.RBush.prototype.isEmpty=function(){return 0===this.root_.children.length};
|
|
ol.structs.RBush.prototype.remove=function(a){if(goog.DEBUG&&this.readers_)throw Error("cannot remove value while reading");var b=this.getKey_(a),c=this.valueExtent_[b];delete this.valueExtent_[b];return this.remove_(c,a)};ol.structs.RBush.prototype.remove_=function(a,b){var c=this.root_,d=[c];(c=c.remove(a,b,d))&&this.condense_(d);return c};
|
|
ol.structs.RBush.prototype.split_=function(a,b){var c=a[b];this.chooseSplitAxis_(c);var d=this.chooseSplitIndex_(c),d=c.children.splice(d),d=new ol.structs.RBushNode(ol.extent.createEmpty(),c.height,d,null);c.updateExtent();d.updateExtent();b?a[b-1].children.push(d):this.splitRoot_(c,d)};ol.structs.RBush.prototype.splitRoot_=function(a,b){var c=a.height+1,d=ol.extent.extend(a.extent.slice(),b.extent);this.root_=new ol.structs.RBushNode(d,c,[a,b],null)};
|
|
ol.structs.RBush.prototype.update=function(a,b){if(goog.DEBUG&&this.readers_)throw Error("cannot update value while reading");var c=this.getKey_(b),d=this.valueExtent_[c];ol.extent.equals(d,a)||(this.remove_(d,b),this.insert_(a,b,this.root_.height-1),this.valueExtent_[c]=ol.extent.clone(a,d))};ol.source.VectorEventType={ADDFEATURE:"addfeature",REMOVEFEATURE:"removefeature"};ol.source.Vector=function(a){a=goog.isDef(a)?a:{};ol.source.Source.call(this,{attributions:a.attributions,extent:a.extent,logo:a.logo,projection:a.projection,state:a.state});this.rBush_=new ol.structs.RBush;this.nullGeometryFeatures_={};this.featureChangeKeys_={};goog.isDef(a.features)&&this.addFeaturesInternal(a.features)};goog.inherits(ol.source.Vector,ol.source.Source);
|
|
ol.source.Vector.prototype.addFeature=function(a){this.addFeatureInternal(a);this.dispatchChangeEvent()};
|
|
ol.source.Vector.prototype.addFeatureInternal=function(a){var b=goog.getUid(a).toString();this.featureChangeKeys_[b]=goog.events.listen(a,goog.events.EventType.CHANGE,this.handleFeatureChange_,!1,this);b=a.getGeometry();goog.isNull(b)?this.nullGeometryFeatures_[goog.getUid(a).toString()]=a:(b=b.getExtent(),this.rBush_.insert(b,a));this.dispatchEvent(new ol.source.VectorEvent(ol.source.VectorEventType.ADDFEATURE,a))};ol.source.Vector.prototype.addFeatures=function(a){this.addFeaturesInternal(a);this.dispatchChangeEvent()};
|
|
ol.source.Vector.prototype.addFeaturesInternal=function(a){var b,c;b=0;for(c=a.length;b<c;++b)this.addFeatureInternal(a[b])};ol.source.Vector.prototype.clear=function(){this.rBush_.forEach(this.removeFeatureInternal,this);this.rBush_.clear();goog.object.forEach(this.nullGeometryFeatures_,this.removeFeatureInternal,this);goog.object.clear(this.nullGeometryFeatures_);this.dispatchChangeEvent()};ol.source.Vector.prototype.forEachFeature=function(a,b){return this.rBush_.forEach(a,b)};
|
|
ol.source.Vector.prototype.forEachFeatureAtCoordinate=function(a,b,c){return this.forEachFeatureInExtent([a[0],a[1],a[0],a[1]],function(d){if(d.getGeometry().containsCoordinate(a))return b.call(c,d)})};ol.source.Vector.prototype.forEachFeatureInExtent=function(a,b,c){return this.rBush_.forEachInExtent(a,b,c)};
|
|
ol.source.Vector.prototype.getFeatures=function(){var a=this.rBush_.getAll();goog.object.isEmpty(this.nullGeometryFeatures_)||goog.array.extend(a,goog.object.getValues(this.nullGeometryFeatures_));return a};ol.source.Vector.prototype.getFeaturesAtCoordinate=function(a){var b=[];this.forEachFeatureAtCoordinate(a,function(a){b.push(a)});return b};ol.source.Vector.prototype.getFeaturesInExtent=function(a){return this.rBush_.getInExtent(a)};
|
|
ol.source.Vector.prototype.getClosestFeatureToCoordinate=function(a){var b=a[0],c=a[1],d=null,e=[NaN,NaN],f=Infinity,g=[-Infinity,-Infinity,Infinity,Infinity];this.rBush_.forEachInExtent(g,function(a){var k=a.getGeometry(),l=f;f=k.closestPointXY(b,c,e,f);f<l&&(d=a,a=Math.sqrt(f),g[0]=b-a,g[1]=c-a,g[2]=b+a,g[3]=c+a)});return d};ol.source.Vector.prototype.getExtent=function(){return this.rBush_.getExtent()};
|
|
ol.source.Vector.prototype.handleFeatureChange_=function(a){a=a.target;var b=goog.getUid(a).toString(),c=a.getGeometry();goog.isNull(c)?b in this.nullGeometryFeatures_||(this.rBush_.remove(a),this.nullGeometryFeatures_[b]=a):(c=c.getExtent(),b in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[b],this.rBush_.insert(c,a)):this.rBush_.update(c,a));this.dispatchChangeEvent()};ol.source.Vector.prototype.isEmpty=function(){return this.rBush_.isEmpty()&&goog.object.isEmpty(this.nullGeometryFeatures_)};
|
|
ol.source.Vector.prototype.removeFeature=function(a){var b=goog.getUid(a).toString();b in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[b]:this.rBush_.remove(a);this.removeFeatureInternal(a);this.dispatchChangeEvent()};ol.source.Vector.prototype.removeFeatureInternal=function(a){var b=goog.getUid(a).toString();goog.events.unlistenByKey(this.featureChangeKeys_[b]);delete this.featureChangeKeys_[b];this.dispatchEvent(new ol.source.VectorEvent(ol.source.VectorEventType.REMOVEFEATURE,a))};
|
|
ol.source.VectorEvent=function(a,b){goog.events.Event.call(this,a);this.feature=b};goog.inherits(ol.source.VectorEvent,goog.events.Event);ol.renderer.canvas.VectorLayer=function(a,b){ol.renderer.canvas.Layer.call(this,a,b);this.dirty_=!1;this.renderedRevision_=-1;this.renderedResolution_=NaN;this.renderedExtent_=ol.extent.createEmpty();this.replayGroup_=null;this.context_=goog.dom.createElement(goog.dom.TagName.CANVAS).getContext("2d")};goog.inherits(ol.renderer.canvas.VectorLayer,ol.renderer.canvas.Layer);
|
|
ol.renderer.canvas.VectorLayer.prototype.composeFrame=function(a,b,c){var d=this.getTransform(a);this.dispatchPreComposeEvent(c,a,d);var e=this.replayGroup_;if(!goog.isNull(e)&&!e.isEmpty()){var f;this.getLayer().hasListener(ol.render.EventType.RENDER)?(this.context_.canvas.width=c.canvas.width,this.context_.canvas.height=c.canvas.height,f=this.context_):f=c;var g=this.getRenderGeometryFunction_();f.globalAlpha=b.opacity;e.replay(f,a.extent,a.pixelRatio,d,a.view2DState.rotation,g);f!=c&&(this.dispatchRenderEvent(f,
|
|
a,d),c.drawImage(f.canvas,0,0))}this.dispatchPostComposeEvent(c,a,d)};ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtPixel=function(a,b,c,d){if(!goog.isNull(this.replayGroup_)){var e=b.extent,f=b.view2DState.resolution;b=b.view2DState.rotation;var g=this.getLayer(),h=this.getRenderGeometryFunction_();return this.replayGroup_.forEachGeometryAtPixel(e,f,b,a,h,function(a,b){return c.call(d,b,g)})}};
|
|
ol.renderer.canvas.VectorLayer.prototype.getRenderGeometryFunction_=function(){var a=this.getLayer().getRenderGeometryFunctions();if(!goog.isDef(a))return goog.functions.TRUE;var b=a.getArray();switch(b.length){case 0:return goog.functions.TRUE;case 1:return b[0];default:return function(a){var d,e;d=0;for(e=b.length;d<e;++d)if(!b[d](a))return!1;return!0}}};ol.renderer.canvas.VectorLayer.prototype.handleImageChange_=function(a){this.renderIfReadyAndVisible()};
|
|
ol.renderer.canvas.VectorLayer.prototype.prepareFrame=function(a,b){var c=this.getLayer(),d=c.getSource();this.updateAttributions(a.attributions,d.getAttributions());this.updateLogos(a,d);if(this.dirty_||!a.viewHints[ol.ViewHint.ANIMATING]&&!a.viewHints[ol.ViewHint.INTERACTING]){var e=a.extent,f=a.view2DState.resolution,g=a.pixelRatio,h=c.getRevision();if(this.dirty_||this.renderedResolution_!=f||this.renderedRevision_!=h||!ol.extent.containsExtent(this.renderedExtent_,e)){var k=this.renderedExtent_,
|
|
l=ol.extent.getWidth(e)/4,m=ol.extent.getHeight(e)/4;k[0]=e[0]-l;k[1]=e[1]-m;k[2]=e[2]+l;k[3]=e[3]+m;goog.dispose(this.replayGroup_);this.replayGroup_=null;this.dirty_=!1;var n=c.getStyleFunction();goog.isDef(n)||(n=ol.feature.defaultStyleFunction);var p=new ol.render.canvas.ReplayGroup(f/(2*g),k);d.forEachFeatureInExtent(k,function(a){a=this.renderFeature(a,f,g,n,p);this.dirty_=this.dirty_||a},this);p.finish();this.renderedResolution_=f;this.renderedRevision_=h;this.replayGroup_=p}}};
|
|
ol.renderer.canvas.VectorLayer.prototype.renderFeature=function(a,b,c,d,e){d=d(a,b);if(!goog.isDefAndNotNull(d))return!1;b=b*b/(4*c*c);var f,g=!1;c=0;for(f=d.length;c<f;++c)g=ol.renderer.vector.renderFeature(e,a,d[c],b,a,this.handleImageChange_,this)||g;return g};ol.renderer.canvas.Map=function(a,b){ol.renderer.Map.call(this,a,b);this.canvas_=goog.dom.createElement(goog.dom.TagName.CANVAS);this.canvas_.style.width="100%";this.canvas_.style.height="100%";this.canvas_.className=ol.css.CLASS_UNSELECTABLE;goog.dom.insertChildAt(a,this.canvas_,0);this.renderedVisible_=!0;this.context_=this.canvas_.getContext("2d");this.transform_=goog.vec.Mat4.createNumber()};goog.inherits(ol.renderer.canvas.Map,ol.renderer.Map);
|
|
ol.renderer.canvas.Map.prototype.createLayerRenderer=function(a){return ol.ENABLE_IMAGE&&a instanceof ol.layer.Image?new ol.renderer.canvas.ImageLayer(this,a):ol.ENABLE_TILE&&a instanceof ol.layer.Tile?new ol.renderer.canvas.TileLayer(this,a):ol.ENABLE_VECTOR&&a instanceof ol.layer.Vector?new ol.renderer.canvas.VectorLayer(this,a):null};
|
|
ol.renderer.canvas.Map.prototype.dispatchComposeEvent_=function(a,b){var c=this.getMap(),d=this.context_;if(c.hasListener(a)){var e=b.view2DState,f=b.pixelRatio;ol.vec.Mat4.makeTransform2D(this.transform_,this.canvas_.width/2,this.canvas_.height/2,f/e.resolution,-f/e.resolution,-e.rotation,-e.center[0],-e.center[1]);e=new ol.render.canvas.Immediate(d,f,b.extent,this.transform_,e.rotation);d=new ol.render.Event(a,c,e,b,d,null);c.dispatchEvent(d);e.flush()}};
|
|
ol.renderer.canvas.Map.prototype.getCanvasLayerRenderer=function(a){return this.getLayerRenderer(a)};
|
|
ol.renderer.canvas.Map.prototype.renderFrame=function(a){if(goog.isNull(a))this.renderedVisible_&&(goog.style.setElementShown(this.canvas_,!1),this.renderedVisible_=!1);else{var b=this.context_,c=a.size[0]*a.pixelRatio,d=a.size[1]*a.pixelRatio;this.canvas_.width!=c||this.canvas_.height!=d?(this.canvas_.width=c,this.canvas_.height=d):b.clearRect(0,0,this.canvas_.width,this.canvas_.height);this.calculateMatrices2D(a);this.dispatchComposeEvent_(ol.render.EventType.PRECOMPOSE,a);var c=a.layerStates,d=
|
|
a.layersArray,e=a.view2DState.resolution,f,g,h,k;f=0;for(g=d.length;f<g;++f)h=d[f],k=this.getLayerRenderer(h),h=c[goog.getUid(h)],!h.visible||(h.sourceState!=ol.source.State.READY||e>=h.maxResolution||e<h.minResolution)||(k.prepareFrame(a,h),k.composeFrame(a,h,b));this.dispatchComposeEvent_(ol.render.EventType.POSTCOMPOSE,a);this.renderedVisible_||(goog.style.setElementShown(this.canvas_,!0),this.renderedVisible_=!0);this.scheduleRemoveUnusedLayerRenderers(a);this.scheduleExpireIconCache(a)}};ol.dom={};ol.dom.BrowserFeature={USE_MS_MATRIX_TRANSFORM:ol.LEGACY_IE_SUPPORT&&ol.IS_LEGACY_IE,USE_MS_ALPHA_FILTER:ol.LEGACY_IE_SUPPORT&&ol.IS_LEGACY_IE};
|
|
ol.dom.canUseCssTransform=function(){var a;return function(){if(!goog.isDef(a))if(goog.global.getComputedStyle){var b=goog.dom.createElement(goog.dom.TagName.P),c,d={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};goog.dom.appendChild(document.body,b);for(var e in d)e in b.style&&(b.style[e]="translate(1px,1px)",c=goog.global.getComputedStyle(b).getPropertyValue(d[e]));goog.dom.removeNode(b);a=c&&"none"!==
|
|
c}else a=!1;return a}}();
|
|
ol.dom.canUseCssTransform3D=function(){var a;return function(){if(!goog.isDef(a))if(goog.global.getComputedStyle){var b=goog.dom.createElement(goog.dom.TagName.P),c,d={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};goog.dom.appendChild(document.body,b);for(var e in d)e in b.style&&(b.style[e]="translate3d(1px,1px,1px)",c=goog.global.getComputedStyle(b).getPropertyValue(d[e]));goog.dom.removeNode(b);a=c&&
|
|
"none"!==c}else a=!1;return a}}();ol.dom.setTransform=function(a,b){var c=a.style;c.WebkitTransform=b;c.MozTransform=b;c.OTransform=b;c.msTransform=b;c.transform=b;goog.userAgent.IE&&!ol.IS_LEGACY_IE&&(a.style.transformOrigin="0 0")};
|
|
ol.dom.setOpacity=function(a,b){if(ol.dom.BrowserFeature.USE_MS_ALPHA_FILTER){var c=a.currentStyle.filter,d,e;"8.0"==goog.userAgent.VERSION?(d=/progid:DXImageTransform\.Microsoft\.Alpha\(.*?\)/i,e="progid:DXImageTransform.Microsoft.Alpha(Opacity\x3d"+100*b+")"):(d=/alpha\(.*?\)/i,e="alpha(opacity\x3d"+100*b+")");d=c.replace(d,e);d===c&&(d+=" "+e);a.style.filter=d;"auto"===a.currentStyle.zIndex&&(a.style.zIndex=0)}else goog.style.setOpacity(a,b)};
|
|
ol.dom.setIEMatrix_=function(a,b){var c=a.currentStyle.filter,d=c.replace(/progid:DXImageTransform.Microsoft.Matrix\(.*?\)/i,b);d===c&&(d=" "+b);a.style.filter=d;"auto"===a.currentStyle.zIndex&&(a.style.zIndex=0)};
|
|
ol.dom.transformElement2D=function(a,b,c,d){if(ol.dom.canUseCssTransform3D()){if(goog.isDef(c)){var e=Array(16);for(d=0;16>d;++d)e[d]=b[d].toFixed(c);c=e.join(",")}else c=b.join(",");ol.dom.setTransform(a,"matrix3d("+c+")")}else if(ol.dom.canUseCssTransform()){b=[goog.vec.Mat4.getElement(b,0,0),goog.vec.Mat4.getElement(b,1,0),goog.vec.Mat4.getElement(b,0,1),goog.vec.Mat4.getElement(b,1,1),goog.vec.Mat4.getElement(b,0,3),goog.vec.Mat4.getElement(b,1,3)];if(goog.isDef(c)){e=Array(6);for(d=0;6>d;++d)e[d]=
|
|
b[d].toFixed(c);c=e.join(",")}else c=b.join(",");ol.dom.setTransform(a,"matrix("+c+")")}else if(ol.dom.BrowserFeature.USE_MS_MATRIX_TRANSFORM){var e=goog.vec.Mat4.getElement(b,0,0),f=goog.vec.Mat4.getElement(b,0,1),g=goog.vec.Mat4.getElement(b,1,0),h=goog.vec.Mat4.getElement(b,1,1),k=goog.vec.Mat4.getElement(b,0,3);b=goog.vec.Mat4.getElement(b,1,3);var l;l='progid:DXImageTransform.Microsoft.Matrix(sizingMethod\x3d"auto expand",M11\x3d'+e.toFixed(c||20);l+=",M12\x3d"+f.toFixed(c||20);l+=",M21\x3d"+
|
|
g.toFixed(c||20);l+=",M22\x3d"+h.toFixed(c||20);l+=")";ol.dom.setIEMatrix_(a,l);b/=h;d.style.left=Math.round(k/e)+"px";d.style.top=Math.round(b)+"px"}else a.style.left=Math.round(goog.vec.Mat4.getElement(b,0,3))+"px",a.style.top=Math.round(goog.vec.Mat4.getElement(b,1,3))+"px"};ol.renderer.dom={};ol.renderer.dom.Layer=function(a,b,c){ol.renderer.Layer.call(this,a,b);this.target=c};goog.inherits(ol.renderer.dom.Layer,ol.renderer.Layer);ol.renderer.dom.Layer.prototype.getTarget=function(){return this.target};ol.renderer.dom.ImageLayer=function(a,b){var c=goog.dom.createElement(goog.dom.TagName.DIV);c.style.position="absolute";ol.renderer.dom.Layer.call(this,a,b,c);this.image_=null;this.transform_=goog.vec.Mat4.createNumberIdentity()};goog.inherits(ol.renderer.dom.ImageLayer,ol.renderer.dom.Layer);
|
|
ol.renderer.dom.ImageLayer.prototype.forEachFeatureAtPixel=function(a,b,c,d){var e=this.getLayer();return e.getSource().forEachFeatureAtPixel(b.extent,b.view2DState.resolution,b.view2DState.rotation,a,function(a){return c.call(d,a,e)})};
|
|
ol.renderer.dom.ImageLayer.prototype.prepareFrame=function(a,b){var c=a.view2DState,d=c.center,e=c.resolution,f=c.rotation,g=this.image_,h=this.getLayer().getSource(),k=a.viewHints;k[ol.ViewHint.ANIMATING]||k[ol.ViewHint.INTERACTING]||(c=h.getImage(a.extent,e,a.pixelRatio,c.projection),goog.isNull(c)||(k=c.getState(),k==ol.ImageState.IDLE?(goog.events.listenOnce(c,goog.events.EventType.CHANGE,this.handleImageChange,!1,this),c.load()):k==ol.ImageState.LOADED&&(g=c)));if(!goog.isNull(g)){var k=g.getExtent(),
|
|
l=g.getResolution(),c=goog.vec.Mat4.createNumber();ol.vec.Mat4.makeTransform2D(c,a.size[0]/2,a.size[1]/2,l/e,l/e,f,(k[0]-d[0])/l,(d[1]-k[3])/l);g!=this.image_&&(d=g.getImageElement(this),d.style.maxWidth="none",d.style.position="absolute",goog.dom.removeChildren(this.target),goog.dom.appendChild(this.target,d),this.image_=g);this.setTransform_(c);this.updateAttributions(a.attributions,g.getAttributions());this.updateLogos(a,h)}};
|
|
ol.renderer.dom.ImageLayer.prototype.setTransform_=function(a){ol.vec.Mat4.equals2D(a,this.transform_)||(ol.dom.transformElement2D(this.target,a,6),goog.vec.Mat4.setFromArray(this.transform_,a))};ol.renderer.dom.TileLayer=function(a,b){var c=goog.dom.createElement(goog.dom.TagName.DIV);c.style.position="absolute";ol.dom.BrowserFeature.USE_MS_MATRIX_TRANSFORM&&(c.style.width="100%",c.style.height="100%");ol.renderer.dom.Layer.call(this,a,b,c);this.renderedVisible_=!0;this.renderedOpacity_=1;this.renderedRevision_=0;this.tileLayerZs_={}};goog.inherits(ol.renderer.dom.TileLayer,ol.renderer.dom.Layer);
|
|
ol.renderer.dom.TileLayer.prototype.prepareFrame=function(a,b){if(b.visible){var c=a.pixelRatio,d=a.view2DState,e=d.projection,f=this.getLayer(),g=f.getSource(),h=g.getTileGridForProjection(e),k=g.getGutter(),l=h.getZForResolution(d.resolution),m=h.getResolution(l),n=d.center,p;m==d.resolution?(n=this.snapCenterToPixel(n,m,a.size),p=ol.extent.getForView2DAndSize(n,m,d.rotation,a.size)):p=a.extent;var m=h.getTileRangeForExtentAndResolution(p,m),r={};r[l]={};var q=this.createGetTileIfLoadedFunction(function(a){return!goog.isNull(a)&&
|
|
a.getState()==ol.TileState.LOADED},g,c,e),u=goog.bind(g.findLoadedTiles,g,r,q),s=f.getUseInterimTilesOnError();goog.isDef(s)||(s=!0);var v=ol.extent.createEmpty(),q=new ol.TileRange(0,0,0,0),t,B,w,z;for(w=m.minX;w<=m.maxX;++w)for(z=m.minY;z<=m.maxY;++z)t=g.getTile(l,w,z,c,e),B=t.getState(),B==ol.TileState.LOADED?r[l][t.tileCoord.toString()]=t:B==ol.TileState.EMPTY||B==ol.TileState.ERROR&&!s||(B=h.forEachTileCoordParentTileRange(t.tileCoord,u,null,q,v),B||(t=h.getTileCoordChildTileRange(t.tileCoord,
|
|
q,v),goog.isNull(t)||u(l+1,t)));var x;if(this.renderedRevision_!=g.getRevision()){for(x in this.tileLayerZs_)s=this.tileLayerZs_[+x],goog.dom.removeNode(s.target);this.tileLayerZs_={};this.renderedRevision_=g.getRevision()}v=goog.array.map(goog.object.getKeys(r),Number);goog.array.sort(v);var u={},A;w=0;for(z=v.length;w<z;++w){x=v[w];x in this.tileLayerZs_?s=this.tileLayerZs_[x]:(s=h.getTileCoordForCoordAndZ(n,x),s=new ol.renderer.dom.TileLayerZ_(h,s),u[x]=!0,this.tileLayerZs_[x]=s);x=r[x];for(A in x)s.addTile(x[A],
|
|
k);s.finalizeAddTiles()}k=goog.array.map(goog.object.getKeys(this.tileLayerZs_),Number);goog.array.sort(k);w=goog.vec.Mat4.createNumber();A=0;for(v=k.length;A<v;++A)if(x=k[A],s=this.tileLayerZs_[x],x in r)if(t=s.getResolution(),z=s.getOrigin(),ol.vec.Mat4.makeTransform2D(w,a.size[0]/2,a.size[1]/2,t/d.resolution,t/d.resolution,d.rotation,(z[0]-n[0])/t,(n[1]-z[1])/t),s.setTransform(w),x in u){for(x-=1;0<=x;--x)if(x in this.tileLayerZs_){goog.dom.insertSiblingAfter(s.target,this.tileLayerZs_[x].target);
|
|
break}0>x&&goog.dom.insertChildAt(this.target,s.target,0)}else a.viewHints[ol.ViewHint.ANIMATING]||a.viewHints[ol.ViewHint.INTERACTING]||s.removeTilesOutsideExtent(p,q);else goog.dom.removeNode(s.target),delete this.tileLayerZs_[x];b.opacity!=this.renderedOpacity_&&(ol.dom.setOpacity(this.target,b.opacity),this.renderedOpacity_=b.opacity);b.visible&&!this.renderedVisible_&&(goog.style.setElementShown(this.target,!0),this.renderedVisible_=!0);this.updateUsedTiles(a.usedTiles,g,l,m);this.manageTilePyramid(a,
|
|
g,h,c,e,p,l,f.getPreload());this.scheduleExpireCache(a,g);this.updateLogos(a,g)}else this.renderedVisible_&&(goog.style.setElementShown(this.target,!1),this.renderedVisible_=!1)};
|
|
ol.renderer.dom.TileLayerZ_=function(a,b){this.target=goog.dom.createElement(goog.dom.TagName.DIV);this.target.style.position="absolute";this.target.style.width="100%";this.target.style.height="100%";ol.LEGACY_IE_SUPPORT&&ol.IS_LEGACY_IE&&(this.translateTarget_=goog.dom.createElement(goog.dom.TagName.DIV),this.translateTarget_.style.position="absolute",this.translateTarget_.style.width="100%",this.translateTarget_.style.height="100%",goog.dom.appendChild(this.target,this.translateTarget_));this.tileGrid_=
|
|
a;this.tileCoordOrigin_=b;this.origin_=ol.extent.getTopLeft(a.getTileCoordExtent(b));this.resolution_=a.getResolution(b.z);this.tiles_={};this.documentFragment_=null;this.transform_=goog.vec.Mat4.createNumberIdentity()};
|
|
ol.renderer.dom.TileLayerZ_.prototype.addTile=function(a,b){var c=a.tileCoord,d=c.toString();if(!(d in this.tiles_)){var e=this.tileGrid_.getTileSize(c.z),f=a.getImage(this),g=f.style;g.maxWidth="none";var h,k;0<b?(h=goog.dom.createElement(goog.dom.TagName.DIV),k=h.style,k.overflow="hidden",k.width=e+"px",k.height=e+"px",g.position="absolute",g.left=-b+"px",g.top=-b+"px",g.width=e+2*b+"px",g.height=e+2*b+"px",goog.dom.appendChild(h,f)):(g.width=e+"px",g.height=e+"px",h=f,k=g);k.position="absolute";
|
|
k.left=(c.x-this.tileCoordOrigin_.x)*e+"px";k.top=(this.tileCoordOrigin_.y-c.y)*e+"px";goog.isNull(this.documentFragment_)&&(this.documentFragment_=document.createDocumentFragment());goog.dom.appendChild(this.documentFragment_,h);this.tiles_[d]=a}};
|
|
ol.renderer.dom.TileLayerZ_.prototype.finalizeAddTiles=function(){goog.isNull(this.documentFragment_)||(ol.LEGACY_IE_SUPPORT&&ol.IS_LEGACY_IE?goog.dom.appendChild(this.translateTarget_,this.documentFragment_):goog.dom.appendChild(this.target,this.documentFragment_),this.documentFragment_=null)};ol.renderer.dom.TileLayerZ_.prototype.getOrigin=function(){return this.origin_};ol.renderer.dom.TileLayerZ_.prototype.getResolution=function(){return this.resolution_};
|
|
ol.renderer.dom.TileLayerZ_.prototype.removeTilesOutsideExtent=function(a,b){var c=this.tileGrid_.getTileRangeForExtentAndZ(a,this.tileCoordOrigin_.z,b),d=[],e,f;for(f in this.tiles_)e=this.tiles_[f],c.contains(e.tileCoord)||d.push(e);var g,c=0;for(g=d.length;c<g;++c)e=d[c],f=e.tileCoord.toString(),goog.dom.removeNode(e.getImage(this)),delete this.tiles_[f]};
|
|
ol.renderer.dom.TileLayerZ_.prototype.setTransform=function(a){ol.vec.Mat4.equals2D(a,this.transform_)||(ol.LEGACY_IE_SUPPORT&&ol.IS_LEGACY_IE?ol.dom.transformElement2D(this.target,a,6,this.translateTarget_):ol.dom.transformElement2D(this.target,a,6),goog.vec.Mat4.setFromArray(this.transform_,a))};ol.renderer.dom.Map=function(a,b){ol.renderer.Map.call(this,a,b);this.layersPane_=goog.dom.createElement(goog.dom.TagName.DIV);this.layersPane_.className=ol.css.CLASS_UNSELECTABLE;var c=this.layersPane_.style;c.position="absolute";c.width="100%";c.height="100%";ol.LEGACY_IE_SUPPORT&&ol.IS_LEGACY_IE&&(this.layersPane_.ondragstart=goog.functions.FALSE,this.layersPane_.onselectstart=goog.functions.FALSE);goog.dom.insertChildAt(a,this.layersPane_,0);this.renderedVisible_=!0};
|
|
goog.inherits(ol.renderer.dom.Map,ol.renderer.Map);ol.renderer.dom.Map.prototype.createLayerRenderer=function(a){if(ol.ENABLE_IMAGE&&a instanceof ol.layer.Image)a=new ol.renderer.dom.ImageLayer(this,a);else if(ol.ENABLE_TILE&&a instanceof ol.layer.Tile)a=new ol.renderer.dom.TileLayer(this,a);else return null;return a};
|
|
ol.renderer.dom.Map.prototype.renderFrame=function(a){if(goog.isNull(a))this.renderedVisible_&&(goog.style.setElementShown(this.layersPane_,!1),this.renderedVisible_=!1);else{var b;b=ol.LEGACY_IE_SUPPORT&&ol.IS_LEGACY_IE?function(a){goog.dom.appendChild(this.layersPane_,a)}:function(a,b){goog.dom.insertChildAt(this.layersPane_,a,b)};var c=a.layerStates,d=a.layersArray,e,f,g,h;e=0;for(f=d.length;e<f;++e)g=d[e],h=this.getLayerRenderer(g),b.call(this,h.getTarget(),e),g=a.layerStates[goog.getUid(g)],
|
|
g.sourceState==ol.source.State.READY&&h.prepareFrame(a,g);for(var k in this.getLayerRenderers())k in c||(h=this.getLayerRendererByKey(k),goog.dom.removeNode(h.getTarget()));this.renderedVisible_||(goog.style.setElementShown(this.layersPane_,!0),this.renderedVisible_=!0);this.calculateMatrices2D(a);this.scheduleRemoveUnusedLayerRenderers(a);this.scheduleExpireIconCache(a)}};goog.webgl={};goog.webgl.DEPTH_BUFFER_BIT=256;goog.webgl.STENCIL_BUFFER_BIT=1024;goog.webgl.COLOR_BUFFER_BIT=16384;goog.webgl.POINTS=0;goog.webgl.LINES=1;goog.webgl.LINE_LOOP=2;goog.webgl.LINE_STRIP=3;goog.webgl.TRIANGLES=4;goog.webgl.TRIANGLE_STRIP=5;goog.webgl.TRIANGLE_FAN=6;goog.webgl.ZERO=0;goog.webgl.ONE=1;goog.webgl.SRC_COLOR=768;goog.webgl.ONE_MINUS_SRC_COLOR=769;goog.webgl.SRC_ALPHA=770;goog.webgl.ONE_MINUS_SRC_ALPHA=771;goog.webgl.DST_ALPHA=772;goog.webgl.ONE_MINUS_DST_ALPHA=773;
|
|
goog.webgl.DST_COLOR=774;goog.webgl.ONE_MINUS_DST_COLOR=775;goog.webgl.SRC_ALPHA_SATURATE=776;goog.webgl.FUNC_ADD=32774;goog.webgl.BLEND_EQUATION=32777;goog.webgl.BLEND_EQUATION_RGB=32777;goog.webgl.BLEND_EQUATION_ALPHA=34877;goog.webgl.FUNC_SUBTRACT=32778;goog.webgl.FUNC_REVERSE_SUBTRACT=32779;goog.webgl.BLEND_DST_RGB=32968;goog.webgl.BLEND_SRC_RGB=32969;goog.webgl.BLEND_DST_ALPHA=32970;goog.webgl.BLEND_SRC_ALPHA=32971;goog.webgl.CONSTANT_COLOR=32769;goog.webgl.ONE_MINUS_CONSTANT_COLOR=32770;
|
|
goog.webgl.CONSTANT_ALPHA=32771;goog.webgl.ONE_MINUS_CONSTANT_ALPHA=32772;goog.webgl.BLEND_COLOR=32773;goog.webgl.ARRAY_BUFFER=34962;goog.webgl.ELEMENT_ARRAY_BUFFER=34963;goog.webgl.ARRAY_BUFFER_BINDING=34964;goog.webgl.ELEMENT_ARRAY_BUFFER_BINDING=34965;goog.webgl.STREAM_DRAW=35040;goog.webgl.STATIC_DRAW=35044;goog.webgl.DYNAMIC_DRAW=35048;goog.webgl.BUFFER_SIZE=34660;goog.webgl.BUFFER_USAGE=34661;goog.webgl.CURRENT_VERTEX_ATTRIB=34342;goog.webgl.FRONT=1028;goog.webgl.BACK=1029;
|
|
goog.webgl.FRONT_AND_BACK=1032;goog.webgl.CULL_FACE=2884;goog.webgl.BLEND=3042;goog.webgl.DITHER=3024;goog.webgl.STENCIL_TEST=2960;goog.webgl.DEPTH_TEST=2929;goog.webgl.SCISSOR_TEST=3089;goog.webgl.POLYGON_OFFSET_FILL=32823;goog.webgl.SAMPLE_ALPHA_TO_COVERAGE=32926;goog.webgl.SAMPLE_COVERAGE=32928;goog.webgl.NO_ERROR=0;goog.webgl.INVALID_ENUM=1280;goog.webgl.INVALID_VALUE=1281;goog.webgl.INVALID_OPERATION=1282;goog.webgl.OUT_OF_MEMORY=1285;goog.webgl.CW=2304;goog.webgl.CCW=2305;
|
|
goog.webgl.LINE_WIDTH=2849;goog.webgl.ALIASED_POINT_SIZE_RANGE=33901;goog.webgl.ALIASED_LINE_WIDTH_RANGE=33902;goog.webgl.CULL_FACE_MODE=2885;goog.webgl.FRONT_FACE=2886;goog.webgl.DEPTH_RANGE=2928;goog.webgl.DEPTH_WRITEMASK=2930;goog.webgl.DEPTH_CLEAR_VALUE=2931;goog.webgl.DEPTH_FUNC=2932;goog.webgl.STENCIL_CLEAR_VALUE=2961;goog.webgl.STENCIL_FUNC=2962;goog.webgl.STENCIL_FAIL=2964;goog.webgl.STENCIL_PASS_DEPTH_FAIL=2965;goog.webgl.STENCIL_PASS_DEPTH_PASS=2966;goog.webgl.STENCIL_REF=2967;
|
|
goog.webgl.STENCIL_VALUE_MASK=2963;goog.webgl.STENCIL_WRITEMASK=2968;goog.webgl.STENCIL_BACK_FUNC=34816;goog.webgl.STENCIL_BACK_FAIL=34817;goog.webgl.STENCIL_BACK_PASS_DEPTH_FAIL=34818;goog.webgl.STENCIL_BACK_PASS_DEPTH_PASS=34819;goog.webgl.STENCIL_BACK_REF=36003;goog.webgl.STENCIL_BACK_VALUE_MASK=36004;goog.webgl.STENCIL_BACK_WRITEMASK=36005;goog.webgl.VIEWPORT=2978;goog.webgl.SCISSOR_BOX=3088;goog.webgl.COLOR_CLEAR_VALUE=3106;goog.webgl.COLOR_WRITEMASK=3107;goog.webgl.UNPACK_ALIGNMENT=3317;
|
|
goog.webgl.PACK_ALIGNMENT=3333;goog.webgl.MAX_TEXTURE_SIZE=3379;goog.webgl.MAX_VIEWPORT_DIMS=3386;goog.webgl.SUBPIXEL_BITS=3408;goog.webgl.RED_BITS=3410;goog.webgl.GREEN_BITS=3411;goog.webgl.BLUE_BITS=3412;goog.webgl.ALPHA_BITS=3413;goog.webgl.DEPTH_BITS=3414;goog.webgl.STENCIL_BITS=3415;goog.webgl.POLYGON_OFFSET_UNITS=10752;goog.webgl.POLYGON_OFFSET_FACTOR=32824;goog.webgl.TEXTURE_BINDING_2D=32873;goog.webgl.SAMPLE_BUFFERS=32936;goog.webgl.SAMPLES=32937;goog.webgl.SAMPLE_COVERAGE_VALUE=32938;
|
|
goog.webgl.SAMPLE_COVERAGE_INVERT=32939;goog.webgl.COMPRESSED_TEXTURE_FORMATS=34467;goog.webgl.DONT_CARE=4352;goog.webgl.FASTEST=4353;goog.webgl.NICEST=4354;goog.webgl.GENERATE_MIPMAP_HINT=33170;goog.webgl.BYTE=5120;goog.webgl.UNSIGNED_BYTE=5121;goog.webgl.SHORT=5122;goog.webgl.UNSIGNED_SHORT=5123;goog.webgl.INT=5124;goog.webgl.UNSIGNED_INT=5125;goog.webgl.FLOAT=5126;goog.webgl.DEPTH_COMPONENT=6402;goog.webgl.ALPHA=6406;goog.webgl.RGB=6407;goog.webgl.RGBA=6408;goog.webgl.LUMINANCE=6409;
|
|
goog.webgl.LUMINANCE_ALPHA=6410;goog.webgl.UNSIGNED_SHORT_4_4_4_4=32819;goog.webgl.UNSIGNED_SHORT_5_5_5_1=32820;goog.webgl.UNSIGNED_SHORT_5_6_5=33635;goog.webgl.FRAGMENT_SHADER=35632;goog.webgl.VERTEX_SHADER=35633;goog.webgl.MAX_VERTEX_ATTRIBS=34921;goog.webgl.MAX_VERTEX_UNIFORM_VECTORS=36347;goog.webgl.MAX_VARYING_VECTORS=36348;goog.webgl.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661;goog.webgl.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660;goog.webgl.MAX_TEXTURE_IMAGE_UNITS=34930;
|
|
goog.webgl.MAX_FRAGMENT_UNIFORM_VECTORS=36349;goog.webgl.SHADER_TYPE=35663;goog.webgl.DELETE_STATUS=35712;goog.webgl.LINK_STATUS=35714;goog.webgl.VALIDATE_STATUS=35715;goog.webgl.ATTACHED_SHADERS=35717;goog.webgl.ACTIVE_UNIFORMS=35718;goog.webgl.ACTIVE_ATTRIBUTES=35721;goog.webgl.SHADING_LANGUAGE_VERSION=35724;goog.webgl.CURRENT_PROGRAM=35725;goog.webgl.NEVER=512;goog.webgl.LESS=513;goog.webgl.EQUAL=514;goog.webgl.LEQUAL=515;goog.webgl.GREATER=516;goog.webgl.NOTEQUAL=517;goog.webgl.GEQUAL=518;
|
|
goog.webgl.ALWAYS=519;goog.webgl.KEEP=7680;goog.webgl.REPLACE=7681;goog.webgl.INCR=7682;goog.webgl.DECR=7683;goog.webgl.INVERT=5386;goog.webgl.INCR_WRAP=34055;goog.webgl.DECR_WRAP=34056;goog.webgl.VENDOR=7936;goog.webgl.RENDERER=7937;goog.webgl.VERSION=7938;goog.webgl.NEAREST=9728;goog.webgl.LINEAR=9729;goog.webgl.NEAREST_MIPMAP_NEAREST=9984;goog.webgl.LINEAR_MIPMAP_NEAREST=9985;goog.webgl.NEAREST_MIPMAP_LINEAR=9986;goog.webgl.LINEAR_MIPMAP_LINEAR=9987;goog.webgl.TEXTURE_MAG_FILTER=10240;
|
|
goog.webgl.TEXTURE_MIN_FILTER=10241;goog.webgl.TEXTURE_WRAP_S=10242;goog.webgl.TEXTURE_WRAP_T=10243;goog.webgl.TEXTURE_2D=3553;goog.webgl.TEXTURE=5890;goog.webgl.TEXTURE_CUBE_MAP=34067;goog.webgl.TEXTURE_BINDING_CUBE_MAP=34068;goog.webgl.TEXTURE_CUBE_MAP_POSITIVE_X=34069;goog.webgl.TEXTURE_CUBE_MAP_NEGATIVE_X=34070;goog.webgl.TEXTURE_CUBE_MAP_POSITIVE_Y=34071;goog.webgl.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072;goog.webgl.TEXTURE_CUBE_MAP_POSITIVE_Z=34073;goog.webgl.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074;
|
|
goog.webgl.MAX_CUBE_MAP_TEXTURE_SIZE=34076;goog.webgl.TEXTURE0=33984;goog.webgl.TEXTURE1=33985;goog.webgl.TEXTURE2=33986;goog.webgl.TEXTURE3=33987;goog.webgl.TEXTURE4=33988;goog.webgl.TEXTURE5=33989;goog.webgl.TEXTURE6=33990;goog.webgl.TEXTURE7=33991;goog.webgl.TEXTURE8=33992;goog.webgl.TEXTURE9=33993;goog.webgl.TEXTURE10=33994;goog.webgl.TEXTURE11=33995;goog.webgl.TEXTURE12=33996;goog.webgl.TEXTURE13=33997;goog.webgl.TEXTURE14=33998;goog.webgl.TEXTURE15=33999;goog.webgl.TEXTURE16=34E3;
|
|
goog.webgl.TEXTURE17=34001;goog.webgl.TEXTURE18=34002;goog.webgl.TEXTURE19=34003;goog.webgl.TEXTURE20=34004;goog.webgl.TEXTURE21=34005;goog.webgl.TEXTURE22=34006;goog.webgl.TEXTURE23=34007;goog.webgl.TEXTURE24=34008;goog.webgl.TEXTURE25=34009;goog.webgl.TEXTURE26=34010;goog.webgl.TEXTURE27=34011;goog.webgl.TEXTURE28=34012;goog.webgl.TEXTURE29=34013;goog.webgl.TEXTURE30=34014;goog.webgl.TEXTURE31=34015;goog.webgl.ACTIVE_TEXTURE=34016;goog.webgl.REPEAT=10497;goog.webgl.CLAMP_TO_EDGE=33071;
|
|
goog.webgl.MIRRORED_REPEAT=33648;goog.webgl.FLOAT_VEC2=35664;goog.webgl.FLOAT_VEC3=35665;goog.webgl.FLOAT_VEC4=35666;goog.webgl.INT_VEC2=35667;goog.webgl.INT_VEC3=35668;goog.webgl.INT_VEC4=35669;goog.webgl.BOOL=35670;goog.webgl.BOOL_VEC2=35671;goog.webgl.BOOL_VEC3=35672;goog.webgl.BOOL_VEC4=35673;goog.webgl.FLOAT_MAT2=35674;goog.webgl.FLOAT_MAT3=35675;goog.webgl.FLOAT_MAT4=35676;goog.webgl.SAMPLER_2D=35678;goog.webgl.SAMPLER_CUBE=35680;goog.webgl.VERTEX_ATTRIB_ARRAY_ENABLED=34338;
|
|
goog.webgl.VERTEX_ATTRIB_ARRAY_SIZE=34339;goog.webgl.VERTEX_ATTRIB_ARRAY_STRIDE=34340;goog.webgl.VERTEX_ATTRIB_ARRAY_TYPE=34341;goog.webgl.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922;goog.webgl.VERTEX_ATTRIB_ARRAY_POINTER=34373;goog.webgl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975;goog.webgl.COMPILE_STATUS=35713;goog.webgl.LOW_FLOAT=36336;goog.webgl.MEDIUM_FLOAT=36337;goog.webgl.HIGH_FLOAT=36338;goog.webgl.LOW_INT=36339;goog.webgl.MEDIUM_INT=36340;goog.webgl.HIGH_INT=36341;goog.webgl.FRAMEBUFFER=36160;
|
|
goog.webgl.RENDERBUFFER=36161;goog.webgl.RGBA4=32854;goog.webgl.RGB5_A1=32855;goog.webgl.RGB565=36194;goog.webgl.DEPTH_COMPONENT16=33189;goog.webgl.STENCIL_INDEX=6401;goog.webgl.STENCIL_INDEX8=36168;goog.webgl.DEPTH_STENCIL=34041;goog.webgl.RENDERBUFFER_WIDTH=36162;goog.webgl.RENDERBUFFER_HEIGHT=36163;goog.webgl.RENDERBUFFER_INTERNAL_FORMAT=36164;goog.webgl.RENDERBUFFER_RED_SIZE=36176;goog.webgl.RENDERBUFFER_GREEN_SIZE=36177;goog.webgl.RENDERBUFFER_BLUE_SIZE=36178;
|
|
goog.webgl.RENDERBUFFER_ALPHA_SIZE=36179;goog.webgl.RENDERBUFFER_DEPTH_SIZE=36180;goog.webgl.RENDERBUFFER_STENCIL_SIZE=36181;goog.webgl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048;goog.webgl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049;goog.webgl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050;goog.webgl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051;goog.webgl.COLOR_ATTACHMENT0=36064;goog.webgl.DEPTH_ATTACHMENT=36096;goog.webgl.STENCIL_ATTACHMENT=36128;goog.webgl.DEPTH_STENCIL_ATTACHMENT=33306;
|
|
goog.webgl.NONE=0;goog.webgl.FRAMEBUFFER_COMPLETE=36053;goog.webgl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054;goog.webgl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055;goog.webgl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057;goog.webgl.FRAMEBUFFER_UNSUPPORTED=36061;goog.webgl.FRAMEBUFFER_BINDING=36006;goog.webgl.RENDERBUFFER_BINDING=36007;goog.webgl.MAX_RENDERBUFFER_SIZE=34024;goog.webgl.INVALID_FRAMEBUFFER_OPERATION=1286;goog.webgl.UNPACK_FLIP_Y_WEBGL=37440;goog.webgl.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441;
|
|
goog.webgl.CONTEXT_LOST_WEBGL=37442;goog.webgl.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443;goog.webgl.BROWSER_DEFAULT_WEBGL=37444;goog.webgl.HALF_FLOAT_OES=36193;goog.webgl.FRAGMENT_SHADER_DERIVATIVE_HINT_OES=35723;goog.webgl.VERTEX_ARRAY_BINDING_OES=34229;goog.webgl.UNMASKED_VENDOR_WEBGL=37445;goog.webgl.UNMASKED_RENDERER_WEBGL=37446;goog.webgl.COMPRESSED_RGB_S3TC_DXT1_EXT=33776;goog.webgl.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777;goog.webgl.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778;
|
|
goog.webgl.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779;goog.webgl.TEXTURE_MAX_ANISOTROPY_EXT=34046;goog.webgl.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047;ol.render.webgl={};ol.render.webgl.Immediate=function(a,b){};ol.render.webgl.Immediate.prototype.drawAsync=function(a,b){};ol.render.webgl.Immediate.prototype.drawCircleGeometry=function(a,b){};ol.render.webgl.Immediate.prototype.drawFeature=function(a,b){};ol.render.webgl.Immediate.prototype.drawGeometryCollectionGeometry=function(a,b){};ol.render.webgl.Immediate.prototype.drawPointGeometry=function(a,b){};ol.render.webgl.Immediate.prototype.drawLineStringGeometry=function(a,b){};
|
|
ol.render.webgl.Immediate.prototype.drawMultiLineStringGeometry=function(a,b){};ol.render.webgl.Immediate.prototype.drawMultiPointGeometry=function(a,b){};ol.render.webgl.Immediate.prototype.drawMultiPolygonGeometry=function(a,b){};ol.render.webgl.Immediate.prototype.drawPolygonGeometry=function(a,b){};ol.render.webgl.Immediate.prototype.drawText=function(a,b,c,d,e,f){};ol.render.webgl.Immediate.prototype.setFillStrokeStyle=function(a,b){};ol.render.webgl.Immediate.prototype.setImageStyle=function(a){};
|
|
ol.render.webgl.Immediate.prototype.setTextStyle=function(a){};ol.color.Matrix=function(){this.colorMatrix_=goog.vec.Mat4.createNumber();this.brightness_=void 0;this.brightnessMatrix_=goog.vec.Mat4.createNumber();this.contrast_=void 0;this.contrastMatrix_=goog.vec.Mat4.createNumber();this.hue_=void 0;this.hueMatrix_=goog.vec.Mat4.createNumber();this.saturation_=void 0;this.saturationMatrix_=goog.vec.Mat4.createNumber()};ol.color.Matrix.makeBrightness=function(a,b){goog.vec.Mat4.makeTranslate(a,b,b,b);return a};
|
|
ol.color.Matrix.makeContrast=function(a,b){goog.vec.Mat4.makeScale(a,b,b,b);var c=-0.5*b+0.5;goog.vec.Mat4.setColumnValues(a,3,c,c,c,1);return a};ol.color.Matrix.makeHue=function(a,b){var c=Math.cos(b),d=Math.sin(b);goog.vec.Mat4.setFromValues(a,0.213+0.787*c-0.213*d,0.213-0.213*c+0.143*d,0.213-0.213*c-0.787*d,0,0.715-0.715*c-0.715*d,0.715+0.285*c+0.14*d,0.715-0.715*c+0.715*d,0,0.072-0.072*c+0.928*d,0.072-0.072*c-0.283*d,0.072+0.928*c+0.072*d,0,0,0,0,1);return a};
|
|
ol.color.Matrix.makeSaturation=function(a,b){goog.vec.Mat4.setFromValues(a,0.213+0.787*b,0.213-0.213*b,0.213-0.213*b,0,0.715-0.715*b,0.715+0.285*b,0.715-0.715*b,0,0.072-0.072*b,0.072-0.072*b,0.072+0.928*b,0,0,0,0,1);return a};
|
|
ol.color.Matrix.prototype.getMatrix=function(a,b,c,d){var e=!1;goog.isDef(a)&&a!==this.brightness_&&(ol.color.Matrix.makeBrightness(this.brightnessMatrix_,a),this.brightness_=a,e=!0);goog.isDef(b)&&b!==this.contrast_&&(ol.color.Matrix.makeContrast(this.contrastMatrix_,b),this.contrast_=b,e=!0);goog.isDef(c)&&c!==this.hue_&&(ol.color.Matrix.makeHue(this.hueMatrix_,c),this.hue_=c,e=!0);goog.isDef(d)&&d!==this.saturation_&&(ol.color.Matrix.makeSaturation(this.saturationMatrix_,d),this.saturation_=d,
|
|
e=!0);e&&(e=this.colorMatrix_,goog.vec.Mat4.makeIdentity(e),goog.isDef(b)&&goog.vec.Mat4.multMat(e,this.contrastMatrix_,e),goog.isDef(a)&&goog.vec.Mat4.multMat(e,this.brightnessMatrix_,e),goog.isDef(d)&&goog.vec.Mat4.multMat(e,this.saturationMatrix_,e),goog.isDef(c)&&goog.vec.Mat4.multMat(e,this.hueMatrix_,e));return this.colorMatrix_};ol.webgl.shader={};ol.webgl.Shader=function(a){this.source_=a};ol.webgl.Shader.prototype.getSource=function(){return this.source_};ol.webgl.Shader.prototype.isAnimated=goog.functions.FALSE;ol.webgl.shader.Fragment=function(a){ol.webgl.Shader.call(this,a)};goog.inherits(ol.webgl.shader.Fragment,ol.webgl.Shader);ol.webgl.shader.Fragment.prototype.getType=function(){return goog.webgl.FRAGMENT_SHADER};ol.webgl.shader.Vertex=function(a){ol.webgl.Shader.call(this,a)};
|
|
goog.inherits(ol.webgl.shader.Vertex,ol.webgl.Shader);ol.webgl.shader.Vertex.prototype.getType=function(){return goog.webgl.VERTEX_SHADER};ol.renderer.webgl={};ol.renderer.webgl.map={};ol.renderer.webgl.map.shader={};ol.renderer.webgl.map.shader.Color={};ol.renderer.webgl.map.shader.ColorFragment=function(){ol.webgl.shader.Fragment.call(this,ol.renderer.webgl.map.shader.ColorFragment.SOURCE)};goog.inherits(ol.renderer.webgl.map.shader.ColorFragment,ol.webgl.shader.Fragment);goog.addSingletonGetter(ol.renderer.webgl.map.shader.ColorFragment);ol.renderer.webgl.map.shader.ColorFragment.DEBUG_SOURCE="precision mediump float;\nvarying vec2 v_texCoord;\n\n\n// @see https://svn.webkit.org/repository/webkit/trunk/Source/WebCore/platform/graphics/filters/skia/SkiaImageFilterBuilder.cpp\nuniform mat4 u_colorMatrix;\nuniform float u_opacity;\nuniform sampler2D u_texture;\n\nvoid main(void) {\n vec4 texColor \x3d texture2D(u_texture, v_texCoord);\n gl_FragColor.rgb \x3d (u_colorMatrix * vec4(texColor.rgb, 1.)).rgb;\n gl_FragColor.a \x3d texColor.a * u_opacity;\n}\n";
|
|
ol.renderer.webgl.map.shader.ColorFragment.OPTIMIZED_SOURCE="precision mediump float;varying vec2 a;uniform mat4 f;uniform float g;uniform sampler2D h;void main(void){vec4 texColor\x3dtexture2D(h,a);gl_FragColor.rgb\x3d(f*vec4(texColor.rgb,1.)).rgb;gl_FragColor.a\x3dtexColor.a*g;}";ol.renderer.webgl.map.shader.ColorFragment.SOURCE=goog.DEBUG?ol.renderer.webgl.map.shader.ColorFragment.DEBUG_SOURCE:ol.renderer.webgl.map.shader.ColorFragment.OPTIMIZED_SOURCE;
|
|
ol.renderer.webgl.map.shader.ColorVertex=function(){ol.webgl.shader.Vertex.call(this,ol.renderer.webgl.map.shader.ColorVertex.SOURCE)};goog.inherits(ol.renderer.webgl.map.shader.ColorVertex,ol.webgl.shader.Vertex);goog.addSingletonGetter(ol.renderer.webgl.map.shader.ColorVertex);ol.renderer.webgl.map.shader.ColorVertex.DEBUG_SOURCE="varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\n\nuniform mat4 u_texCoordMatrix;\nuniform mat4 u_projectionMatrix;\n\nvoid main(void) {\n gl_Position \x3d u_projectionMatrix * vec4(a_position, 0., 1.);\n v_texCoord \x3d (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;\n}\n\n\n";
|
|
ol.renderer.webgl.map.shader.ColorVertex.OPTIMIZED_SOURCE="varying vec2 a;attribute vec2 b;attribute vec2 c;uniform mat4 d;uniform mat4 e;void main(void){gl_Position\x3de*vec4(b,0.,1.);a\x3d(d*vec4(c,0.,1.)).st;}";ol.renderer.webgl.map.shader.ColorVertex.SOURCE=goog.DEBUG?ol.renderer.webgl.map.shader.ColorVertex.DEBUG_SOURCE:ol.renderer.webgl.map.shader.ColorVertex.OPTIMIZED_SOURCE;
|
|
ol.renderer.webgl.map.shader.Color.Locations=function(a,b){this.u_colorMatrix=a.getUniformLocation(b,goog.DEBUG?"u_colorMatrix":"f");this.u_opacity=a.getUniformLocation(b,goog.DEBUG?"u_opacity":"g");this.u_projectionMatrix=a.getUniformLocation(b,goog.DEBUG?"u_projectionMatrix":"e");this.u_texCoordMatrix=a.getUniformLocation(b,goog.DEBUG?"u_texCoordMatrix":"d");this.u_texture=a.getUniformLocation(b,goog.DEBUG?"u_texture":"h");this.a_position=a.getAttribLocation(b,goog.DEBUG?"a_position":"b");this.a_texCoord=
|
|
a.getAttribLocation(b,goog.DEBUG?"a_texCoord":"c")};ol.renderer.webgl.map.shader.Default={};ol.renderer.webgl.map.shader.DefaultFragment=function(){ol.webgl.shader.Fragment.call(this,ol.renderer.webgl.map.shader.DefaultFragment.SOURCE)};goog.inherits(ol.renderer.webgl.map.shader.DefaultFragment,ol.webgl.shader.Fragment);goog.addSingletonGetter(ol.renderer.webgl.map.shader.DefaultFragment);ol.renderer.webgl.map.shader.DefaultFragment.DEBUG_SOURCE="precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform float u_opacity;\nuniform sampler2D u_texture;\n\nvoid main(void) {\n vec4 texColor \x3d texture2D(u_texture, v_texCoord);\n gl_FragColor.rgb \x3d texColor.rgb;\n gl_FragColor.a \x3d texColor.a * u_opacity;\n}\n";
|
|
ol.renderer.webgl.map.shader.DefaultFragment.OPTIMIZED_SOURCE="precision mediump float;varying vec2 a;uniform float f;uniform sampler2D g;void main(void){vec4 texColor\x3dtexture2D(g,a);gl_FragColor.rgb\x3dtexColor.rgb;gl_FragColor.a\x3dtexColor.a*f;}";ol.renderer.webgl.map.shader.DefaultFragment.SOURCE=goog.DEBUG?ol.renderer.webgl.map.shader.DefaultFragment.DEBUG_SOURCE:ol.renderer.webgl.map.shader.DefaultFragment.OPTIMIZED_SOURCE;
|
|
ol.renderer.webgl.map.shader.DefaultVertex=function(){ol.webgl.shader.Vertex.call(this,ol.renderer.webgl.map.shader.DefaultVertex.SOURCE)};goog.inherits(ol.renderer.webgl.map.shader.DefaultVertex,ol.webgl.shader.Vertex);goog.addSingletonGetter(ol.renderer.webgl.map.shader.DefaultVertex);ol.renderer.webgl.map.shader.DefaultVertex.DEBUG_SOURCE="varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\n\nuniform mat4 u_texCoordMatrix;\nuniform mat4 u_projectionMatrix;\n\nvoid main(void) {\n gl_Position \x3d u_projectionMatrix * vec4(a_position, 0., 1.);\n v_texCoord \x3d (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;\n}\n\n\n";
|
|
ol.renderer.webgl.map.shader.DefaultVertex.OPTIMIZED_SOURCE="varying vec2 a;attribute vec2 b;attribute vec2 c;uniform mat4 d;uniform mat4 e;void main(void){gl_Position\x3de*vec4(b,0.,1.);a\x3d(d*vec4(c,0.,1.)).st;}";ol.renderer.webgl.map.shader.DefaultVertex.SOURCE=goog.DEBUG?ol.renderer.webgl.map.shader.DefaultVertex.DEBUG_SOURCE:ol.renderer.webgl.map.shader.DefaultVertex.OPTIMIZED_SOURCE;
|
|
ol.renderer.webgl.map.shader.Default.Locations=function(a,b){this.u_opacity=a.getUniformLocation(b,goog.DEBUG?"u_opacity":"f");this.u_projectionMatrix=a.getUniformLocation(b,goog.DEBUG?"u_projectionMatrix":"e");this.u_texCoordMatrix=a.getUniformLocation(b,goog.DEBUG?"u_texCoordMatrix":"d");this.u_texture=a.getUniformLocation(b,goog.DEBUG?"u_texture":"g");this.a_position=a.getAttribLocation(b,goog.DEBUG?"a_position":"b");this.a_texCoord=a.getAttribLocation(b,goog.DEBUG?"a_texCoord":"c")};ol.structs.IntegerSet=function(a){this.arr_=goog.isDef(a)?a:[];goog.DEBUG&&this.assertValid()};ol.structs.IntegerSet.prototype.addRange=function(a,b){if(a!=b){var c=this.arr_,d=c.length,e;for(e=0;e<d;e+=2)if(a<=c[e]){c.splice(e,0,a,b);this.compactRanges_();return}c.push(a,b);this.compactRanges_()}};ol.structs.IntegerSet.prototype.assertValid=function(){var a=this.arr_.length,b;for(b=1;b<a;++b);};ol.structs.IntegerSet.prototype.clear=function(){this.arr_.length=0};
|
|
ol.structs.IntegerSet.prototype.compactRanges_=function(){var a=this.arr_,b=a.length,c=0,d;for(d=0;d<b;d+=2)a[d]!=a[d+1]&&(0<c&&a[c-2]<=a[d]&&a[d]<=a[c-1]?a[c-1]=Math.max(a[c-1],a[d+1]):(a[c++]=a[d],a[c++]=a[d+1]));a.length=c};ol.structs.IntegerSet.prototype.findRange=function(a){var b=this.arr_,c=b.length,d=-1,e,f,g;for(f=0;f<c;f+=2){g=b[f+1]-b[f];if(g==a)return b[f];g>a&&(-1==d||g<e)&&(d=b[f],e=g)}return d};
|
|
ol.structs.IntegerSet.prototype.forEachRange=function(a,b){var c=this.arr_,d=c.length,e;for(e=0;e<d;e+=2)a.call(b,c[e],c[e+1])};ol.structs.IntegerSet.prototype.forEachRangeInverted=function(a,b,c,d){var e=this.arr_,f=e.length;if(0===f)c.call(d,a,b);else{a<e[0]&&c.call(d,a,e[0]);for(a=1;a<f-1;a+=2)c.call(d,e[a],e[a+1]);e[f-1]<b&&c.call(d,e[f-1],b)}};ol.structs.IntegerSet.prototype.getArray=function(){return this.arr_};
|
|
ol.structs.IntegerSet.prototype.getFirst=function(){return 0===this.arr_.length?-1:this.arr_[0]};ol.structs.IntegerSet.prototype.getLast=function(){var a=this.arr_.length;return 0===a?-1:this.arr_[a-1]};ol.structs.IntegerSet.prototype.getSize=function(){var a=this.arr_,b=a.length,c=0,d;for(d=0;d<b;d+=2)c+=a[d+1]-a[d];return c};
|
|
ol.structs.IntegerSet.prototype.intersectsRange=function(a,b){if(a!=b)for(var c=this.arr_,d=c.length,e=0,e=0;e<d;e+=2)if(c[e]<=a&&a<c[e+1]||c[e]<b&&b-1<c[e+1]||a<c[e]&&c[e+1]<=b)return!0;return!1};ol.structs.IntegerSet.prototype.isEmpty=function(){return 0===this.arr_.length};ol.structs.IntegerSet.prototype.pack=function(){return this.arr_};
|
|
ol.structs.IntegerSet.prototype.removeRange=function(a,b){var c=this.arr_,d=c.length,e;for(e=0;e<d;e+=2)if(!(b<c[e]||c[e+1]<a)){if(c[e]>b)break;if(a<c[e])if(b==c[e])break;else if(b<c[e+1]){c[e]=Math.max(c[e],b);break}else c.splice(e,2),e-=2,d-=2;else if(a==c[e])if(b<c[e+1]){c[e]=b;break}else if(b==c[e+1]){c.splice(e,2);break}else c.splice(e,2),e-=2,d-=2;else if(b<c[e+1]){c.splice(e,2,c[e],a,b,c[e+1]);break}else if(b==c[e+1]){c[e+1]=a;break}else c[e+1]=a}this.compactRanges_()};
|
|
goog.DEBUG&&(ol.structs.IntegerSet.prototype.toString=function(){var a=this.arr_,b=a.length,c=Array(b/2),d=0,e;for(e=0;e<b;e+=2)c[d++]=a[e]+"-"+a[e+1];return c.join(", ")});ol.structs.BufferUsage={STATIC_DRAW:goog.webgl.STATIC_DRAW,STREAM_DRAW:goog.webgl.STREAM_DRAW,DYNAMIC_DRAW:goog.webgl.DYNAMIC_DRAW};ol.BUFFER_REPLACE_UNUSED_ENTRIES_WITH_NANS=goog.DEBUG;
|
|
ol.structs.Buffer=function(a,b,c){this.arr_=goog.isDef(a)?a:[];this.dirtySets_=[];this.freeSet_=new ol.structs.IntegerSet;var d=goog.isDef(b)?b:this.arr_.length;d<this.arr_.length&&this.freeSet_.addRange(d,this.arr_.length);if(ol.BUFFER_REPLACE_UNUSED_ENTRIES_WITH_NANS)for(a=this.arr_,b=a.length;d<b;++d)a[d]=NaN;this.split32DirtySet_=this.split32_=null;this.usage_=goog.isDef(c)?c:ol.structs.BufferUsage.STATIC_DRAW};
|
|
ol.structs.Buffer.prototype.allocate=function(a){var b=this.freeSet_.findRange(a);this.freeSet_.removeRange(b,b+a);return b};ol.structs.Buffer.prototype.add=function(a){var b=a.length,c=this.allocate(b),d;for(d=0;d<b;++d)this.arr_[c+d]=a[d];this.markDirty(b,c);return c};ol.structs.Buffer.prototype.addDirtySet=function(a){this.dirtySets_.push(a)};ol.structs.Buffer.prototype.forEachRange=function(a,b){0!==this.arr_.length&&this.freeSet_.forEachRangeInverted(0,this.arr_.length,a,b)};
|
|
ol.structs.Buffer.prototype.getArray=function(){return this.arr_};ol.structs.Buffer.prototype.getCount=function(){return this.arr_.length-this.freeSet_.getSize()};ol.structs.Buffer.prototype.getFreeSet=function(){return this.freeSet_};
|
|
ol.structs.Buffer.prototype.getSplit32=function(){var a=this.arr_,b=a.length;goog.isNull(this.split32DirtySet_)&&(this.split32DirtySet_=new ol.structs.IntegerSet([0,b]),this.addDirtySet(this.split32DirtySet_));goog.isNull(this.split32_)&&(this.split32_=new Float32Array(2*b));var c=this.split32_;this.split32DirtySet_.forEachRange(function(b,e){var f,g,h,k;g=b;for(h=2*b;g<e;++g,h+=2)k=a[g],0>k?(f=65536*Math.floor(-k/65536),c[h]=-f,c[h+1]=k+f):(f=65536*Math.floor(k/65536),c[h]=f,c[h+1]=k-f)});this.split32DirtySet_.clear();
|
|
return this.split32_};ol.structs.Buffer.prototype.getUsage=function(){return this.usage_};ol.structs.Buffer.prototype.markDirty=function(a,b){var c,d;c=0;for(d=this.dirtySets_.length;c<d;++c)this.dirtySets_[c].addRange(b,b+a)};ol.structs.Buffer.prototype.remove=function(a,b){var c,d;this.freeSet_.addRange(b,b+a);c=0;for(d=this.dirtySets_.length;c<d;++c)this.dirtySets_[c].removeRange(b,b+a);if(ol.BUFFER_REPLACE_UNUSED_ENTRIES_WITH_NANS)for(d=this.arr_,c=0;c<a;++c)d[b+c]=NaN};
|
|
ol.structs.Buffer.prototype.removeDirtySet=function(a){goog.array.remove(this.dirtySets_,a)};ol.structs.Buffer.prototype.set=function(a,b){var c=this.arr_,d=a.length,e;for(e=0;e<d;++e)c[b+e]=a[e];this.markDirty(d,b)};ol.renderer.webgl.Layer=function(a,b){ol.renderer.Layer.call(this,a,b);this.arrayBuffer_=new ol.structs.Buffer([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]);this.framebuffer=this.texture=null;this.framebufferDimension=void 0;this.texCoordMatrix=goog.vec.Mat4.createNumber();this.projectionMatrix=goog.vec.Mat4.createNumberIdentity();this.colorMatrix_=new ol.color.Matrix;this.defaultLocations_=this.colorLocations_=null};goog.inherits(ol.renderer.webgl.Layer,ol.renderer.Layer);
|
|
ol.renderer.webgl.Layer.prototype.bindFramebuffer=function(a,b){var c=this.getWebGLMapRenderer().getGL();if(goog.isDef(this.framebufferDimension)&&this.framebufferDimension==b)c.bindFramebuffer(goog.webgl.FRAMEBUFFER,this.framebuffer);else{a.postRenderFunctions.push(goog.partial(function(a,b,c){a.isContextLost()||(a.deleteFramebuffer(b),a.deleteTexture(c))},c,this.framebuffer,this.texture));var d=c.createTexture();c.bindTexture(goog.webgl.TEXTURE_2D,d);c.texImage2D(goog.webgl.TEXTURE_2D,0,goog.webgl.RGBA,
|
|
b,b,0,goog.webgl.RGBA,goog.webgl.UNSIGNED_BYTE,null);c.texParameteri(goog.webgl.TEXTURE_2D,goog.webgl.TEXTURE_MAG_FILTER,goog.webgl.LINEAR);c.texParameteri(goog.webgl.TEXTURE_2D,goog.webgl.TEXTURE_MIN_FILTER,goog.webgl.LINEAR);var e=c.createFramebuffer();c.bindFramebuffer(goog.webgl.FRAMEBUFFER,e);c.framebufferTexture2D(goog.webgl.FRAMEBUFFER,goog.webgl.COLOR_ATTACHMENT0,goog.webgl.TEXTURE_2D,d,0);this.texture=d;this.framebuffer=e;this.framebufferDimension=b}};
|
|
ol.renderer.webgl.Layer.prototype.composeFrame=function(a,b,c){this.dispatchComposeEvent_(ol.render.EventType.PRECOMPOSE,c,a);c.bindBuffer(goog.webgl.ARRAY_BUFFER,this.arrayBuffer_);var d=c.getGL(),e=b.brightness||1!=b.contrast||b.hue||1!=b.saturation,f,g;e?(f=ol.renderer.webgl.map.shader.ColorFragment.getInstance(),g=ol.renderer.webgl.map.shader.ColorVertex.getInstance()):(f=ol.renderer.webgl.map.shader.DefaultFragment.getInstance(),g=ol.renderer.webgl.map.shader.DefaultVertex.getInstance());f=c.getProgram(f,
|
|
g);e?goog.isNull(this.colorLocations_)?this.colorLocations_=g=new ol.renderer.webgl.map.shader.Color.Locations(d,f):g=this.colorLocations_:goog.isNull(this.defaultLocations_)?this.defaultLocations_=g=new ol.renderer.webgl.map.shader.Default.Locations(d,f):g=this.defaultLocations_;c.useProgram(f)&&(d.enableVertexAttribArray(g.a_position),d.vertexAttribPointer(g.a_position,2,goog.webgl.FLOAT,!1,16,0),d.enableVertexAttribArray(g.a_texCoord),d.vertexAttribPointer(g.a_texCoord,2,goog.webgl.FLOAT,!1,16,
|
|
8),d.uniform1i(g.u_texture,0));d.uniformMatrix4fv(g.u_texCoordMatrix,!1,this.getTexCoordMatrix());d.uniformMatrix4fv(g.u_projectionMatrix,!1,this.getProjectionMatrix());e&&d.uniformMatrix4fv(g.u_colorMatrix,!1,this.colorMatrix_.getMatrix(b.brightness,b.contrast,b.hue,b.saturation));d.uniform1f(g.u_opacity,b.opacity);d.bindTexture(goog.webgl.TEXTURE_2D,this.getTexture());d.drawArrays(goog.webgl.TRIANGLE_STRIP,0,4);this.dispatchComposeEvent_(ol.render.EventType.POSTCOMPOSE,c,a)};
|
|
ol.renderer.webgl.Layer.prototype.dispatchComposeEvent_=function(a,b,c){var d=this.getLayer();if(d.hasListener(a)){var e=new ol.render.webgl.Immediate(b,c.pixelRatio);a=new ol.render.Event(a,d,e,c,null,b);d.dispatchEvent(a)}};ol.renderer.webgl.Layer.prototype.getWebGLMapRenderer=function(){return this.getMapRenderer()};ol.renderer.webgl.Layer.prototype.getTexCoordMatrix=function(){return this.texCoordMatrix};ol.renderer.webgl.Layer.prototype.getTexture=function(){return this.texture};
|
|
ol.renderer.webgl.Layer.prototype.getProjectionMatrix=function(){return this.projectionMatrix};ol.renderer.webgl.Layer.prototype.handleWebGLContextLost=function(){this.framebuffer=this.texture=null;this.framebufferDimension=void 0};ol.renderer.webgl.ImageLayer=function(a,b){ol.renderer.webgl.Layer.call(this,a,b);this.image_=null};goog.inherits(ol.renderer.webgl.ImageLayer,ol.renderer.webgl.Layer);
|
|
ol.renderer.webgl.ImageLayer.prototype.createTexture_=function(a){a=a.getImageElement();var b=this.getWebGLMapRenderer().getGL(),c=b.createTexture();b.bindTexture(goog.webgl.TEXTURE_2D,c);b.texImage2D(goog.webgl.TEXTURE_2D,0,goog.webgl.RGBA,goog.webgl.RGBA,goog.webgl.UNSIGNED_BYTE,a);b.texParameteri(goog.webgl.TEXTURE_2D,goog.webgl.TEXTURE_WRAP_S,goog.webgl.CLAMP_TO_EDGE);b.texParameteri(goog.webgl.TEXTURE_2D,goog.webgl.TEXTURE_WRAP_T,goog.webgl.CLAMP_TO_EDGE);b.texParameteri(goog.webgl.TEXTURE_2D,
|
|
goog.webgl.TEXTURE_MIN_FILTER,goog.webgl.LINEAR);b.texParameteri(goog.webgl.TEXTURE_2D,goog.webgl.TEXTURE_MAG_FILTER,goog.webgl.LINEAR);return c};ol.renderer.webgl.ImageLayer.prototype.forEachFeatureAtPixel=function(a,b,c,d){var e=this.getLayer();return e.getSource().forEachFeatureAtPixel(b.extent,b.view2DState.resolution,b.view2DState.rotation,a,function(a){return c.call(d,a,e)})};
|
|
ol.renderer.webgl.ImageLayer.prototype.prepareFrame=function(a,b){var c=this.getWebGLMapRenderer().getGL(),d=a.view2DState,e=d.center,f=d.resolution,g=d.rotation,h=this.image_,k=this.texture,l=this.getLayer().getSource(),m=a.viewHints;m[ol.ViewHint.ANIMATING]||m[ol.ViewHint.INTERACTING]||(d=l.getImage(a.extent,f,a.pixelRatio,d.projection),goog.isNull(d)||(m=d.getState(),m==ol.ImageState.IDLE?(goog.events.listenOnce(d,goog.events.EventType.CHANGE,this.handleImageChange,!1,this),d.load()):m==ol.ImageState.LOADED&&
|
|
(h=d,k=this.createTexture_(d),goog.isNull(this.texture)||a.postRenderFunctions.push(goog.partial(function(a,b){a.isContextLost()||a.deleteTexture(b)},c,this.texture)))));goog.isNull(h)||(c=this.getWebGLMapRenderer().getContext().getCanvas(),this.updateProjectionMatrix_(c.width,c.height,e,f,g,h.getExtent()),e=this.texCoordMatrix,goog.vec.Mat4.makeIdentity(e),goog.vec.Mat4.scale(e,1,-1,1),goog.vec.Mat4.translate(e,0,-1,0),this.image_=h,this.texture=k,this.updateAttributions(a.attributions,h.getAttributions()),
|
|
this.updateLogos(a,l))};ol.renderer.webgl.ImageLayer.prototype.updateProjectionMatrix_=function(a,b,c,d,e,f){a*=d;b*=d;d=this.projectionMatrix;goog.vec.Mat4.makeIdentity(d);goog.vec.Mat4.scale(d,2/a,2/b,1);goog.vec.Mat4.rotateZ(d,-e);goog.vec.Mat4.translate(d,f[0]-c[0],f[1]-c[1],0);goog.vec.Mat4.scale(d,(f[2]-f[0])/2,(f[3]-f[1])/2,1);goog.vec.Mat4.translate(d,1,1,0)};ol.renderer.webgl.tilelayer={};ol.renderer.webgl.tilelayer.shader={};ol.renderer.webgl.tilelayer.shader.Fragment=function(){ol.webgl.shader.Fragment.call(this,ol.renderer.webgl.tilelayer.shader.Fragment.SOURCE)};goog.inherits(ol.renderer.webgl.tilelayer.shader.Fragment,ol.webgl.shader.Fragment);goog.addSingletonGetter(ol.renderer.webgl.tilelayer.shader.Fragment);ol.renderer.webgl.tilelayer.shader.Fragment.DEBUG_SOURCE="precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform sampler2D u_texture;\n\nvoid main(void) {\n gl_FragColor \x3d texture2D(u_texture, v_texCoord);\n}\n";
|
|
ol.renderer.webgl.tilelayer.shader.Fragment.OPTIMIZED_SOURCE="precision mediump float;varying vec2 a;uniform sampler2D e;void main(void){gl_FragColor\x3dtexture2D(e,a);}";ol.renderer.webgl.tilelayer.shader.Fragment.SOURCE=goog.DEBUG?ol.renderer.webgl.tilelayer.shader.Fragment.DEBUG_SOURCE:ol.renderer.webgl.tilelayer.shader.Fragment.OPTIMIZED_SOURCE;ol.renderer.webgl.tilelayer.shader.Vertex=function(){ol.webgl.shader.Vertex.call(this,ol.renderer.webgl.tilelayer.shader.Vertex.SOURCE)};
|
|
goog.inherits(ol.renderer.webgl.tilelayer.shader.Vertex,ol.webgl.shader.Vertex);goog.addSingletonGetter(ol.renderer.webgl.tilelayer.shader.Vertex);ol.renderer.webgl.tilelayer.shader.Vertex.DEBUG_SOURCE="varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nuniform vec4 u_tileOffset;\n\nvoid main(void) {\n gl_Position \x3d vec4(a_position * u_tileOffset.xy + u_tileOffset.zw, 0., 1.);\n v_texCoord \x3d a_texCoord;\n}\n\n\n";
|
|
ol.renderer.webgl.tilelayer.shader.Vertex.OPTIMIZED_SOURCE="varying vec2 a;attribute vec2 b;attribute vec2 c;uniform vec4 d;void main(void){gl_Position\x3dvec4(b*d.xy+d.zw,0.,1.);a\x3dc;}";ol.renderer.webgl.tilelayer.shader.Vertex.SOURCE=goog.DEBUG?ol.renderer.webgl.tilelayer.shader.Vertex.DEBUG_SOURCE:ol.renderer.webgl.tilelayer.shader.Vertex.OPTIMIZED_SOURCE;
|
|
ol.renderer.webgl.tilelayer.shader.Locations=function(a,b){this.u_texture=a.getUniformLocation(b,goog.DEBUG?"u_texture":"e");this.u_tileOffset=a.getUniformLocation(b,goog.DEBUG?"u_tileOffset":"d");this.a_position=a.getAttribLocation(b,goog.DEBUG?"a_position":"b");this.a_texCoord=a.getAttribLocation(b,goog.DEBUG?"a_texCoord":"c")};ol.renderer.webgl.TileLayer=function(a,b){ol.renderer.webgl.Layer.call(this,a,b);this.fragmentShader_=ol.renderer.webgl.tilelayer.shader.Fragment.getInstance();this.vertexShader_=ol.renderer.webgl.tilelayer.shader.Vertex.getInstance();this.locations_=null;this.renderArrayBuffer_=new ol.structs.Buffer([0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0]);this.renderedFramebufferExtent_=this.renderedTileRange_=null;this.renderedRevision_=-1};goog.inherits(ol.renderer.webgl.TileLayer,ol.renderer.webgl.Layer);
|
|
ol.renderer.webgl.TileLayer.prototype.disposeInternal=function(){this.getWebGLMapRenderer().getContext().deleteBuffer(this.renderArrayBuffer_);ol.renderer.webgl.TileLayer.superClass_.disposeInternal.call(this)};ol.renderer.webgl.TileLayer.prototype.handleWebGLContextLost=function(){ol.renderer.webgl.TileLayer.superClass_.handleWebGLContextLost.call(this);this.locations_=null};
|
|
ol.renderer.webgl.TileLayer.prototype.prepareFrame=function(a,b){var c=this.getWebGLMapRenderer(),d=c.getContext(),e=c.getGL(),f=a.view2DState,g=f.projection,h=this.getLayer(),k=h.getSource(),l=k.getTileGridForProjection(g),m=l.getZForResolution(f.resolution),n=l.getResolution(m),p=k.getTilePixelSize(m,a.pixelRatio,g),r=p/l.getTileSize(m),q=n/r,u=k.getGutter(),s=f.center,v;n==f.resolution?(s=this.snapCenterToPixel(s,n,a.size),v=ol.extent.getForView2DAndSize(s,n,f.rotation,a.size)):v=a.extent;n=l.getTileRangeForExtentAndResolution(v,
|
|
n);if(!goog.isNull(this.renderedTileRange_)&&this.renderedTileRange_.equals(n)&&this.renderedRevision_==k.getRevision())q=this.renderedFramebufferExtent_;else{var t=n.getSize(),t=Math.max(t[0]*p,t[1]*p),B=ol.math.roundUpToPowerOfTwo(t),t=q*B,w=l.getOrigin(m),z=w[0]+n.minX*p*q,q=w[1]+n.minY*p*q,q=[z,q,z+t,q+t];this.bindFramebuffer(a,B);e.viewport(0,0,B,B);e.clearColor(0,0,0,0);e.clear(goog.webgl.COLOR_BUFFER_BIT);e.disable(goog.webgl.BLEND);B=d.getProgram(this.fragmentShader_,this.vertexShader_);d.useProgram(B);
|
|
goog.isNull(this.locations_)&&(this.locations_=new ol.renderer.webgl.tilelayer.shader.Locations(e,B));d.bindBuffer(goog.webgl.ARRAY_BUFFER,this.renderArrayBuffer_);e.enableVertexAttribArray(this.locations_.a_position);e.vertexAttribPointer(this.locations_.a_position,2,goog.webgl.FLOAT,!1,16,0);e.enableVertexAttribArray(this.locations_.a_texCoord);e.vertexAttribPointer(this.locations_.a_texCoord,2,goog.webgl.FLOAT,!1,16,8);e.uniform1i(this.locations_.u_texture,0);d={};d[m]={};var B=this.createGetTileIfLoadedFunction(function(a){return!goog.isNull(a)&&
|
|
a.getState()==ol.TileState.LOADED&&c.isTileTextureLoaded(a)},k,r,g),x=goog.bind(k.findLoadedTiles,k,d,B),A=h.getUseInterimTilesOnError();goog.isDef(A)||(A=!0);var B=!0,z=ol.extent.createEmpty(),C=new ol.TileRange(0,0,0,0),G,H,E;for(H=n.minX;H<=n.maxX;++H)for(E=n.minY;E<=n.maxY;++E){w=k.getTile(m,H,E,r,g);G=w.getState();if(G==ol.TileState.LOADED){if(c.isTileTextureLoaded(w)){d[m][w.tileCoord.toString()]=w;continue}}else if(G==ol.TileState.EMPTY||G==ol.TileState.ERROR&&!A)continue;B=!1;G=l.forEachTileCoordParentTileRange(w.tileCoord,
|
|
x,null,C,z);G||(w=l.getTileCoordChildTileRange(w.tileCoord,C,z),goog.isNull(w)||x(m+1,w))}x=goog.array.map(goog.object.getKeys(d),Number);goog.array.sort(x);var A=goog.vec.Vec4.createFloat32(),y,D,F,J,C=0;for(H=x.length;C<H;++C)for(D in F=d[x[C]],F)w=F[D],y=l.getTileCoordExtent(w.tileCoord,z),E=2*(y[2]-y[0])/t,G=2*(y[3]-y[1])/t,J=2*(y[0]-q[0])/t-1,y=2*(y[1]-q[1])/t-1,goog.vec.Vec4.setFromValues(A,E,G,J,y),e.uniform4fv(this.locations_.u_tileOffset,A),c.bindTileTexture(w,p,u*r,goog.webgl.LINEAR,goog.webgl.LINEAR),
|
|
e.drawArrays(goog.webgl.TRIANGLE_STRIP,0,4);B?(this.renderedTileRange_=n,this.renderedFramebufferExtent_=q,this.renderedRevision_=k.getRevision()):(this.renderedFramebufferExtent_=this.renderedTileRange_=null,this.renderedRevision_=-1,a.animate=!0)}this.updateUsedTiles(a.usedTiles,k,m,n);var I=c.getTileTextureQueue();this.manageTilePyramid(a,k,l,r,g,v,m,h.getPreload(),function(a){a.getState()!=ol.TileState.LOADED||(c.isTileTextureLoaded(a)||I.isKeyQueued(a.getKey()))||I.enqueue([a,l.getTileCoordCenter(a.tileCoord),
|
|
l.getResolution(a.tileCoord.z),p,u*r])},this);this.scheduleExpireCache(a,k);this.updateLogos(a,k);e=this.texCoordMatrix;goog.vec.Mat4.makeIdentity(e);goog.vec.Mat4.translate(e,(s[0]-q[0])/(q[2]-q[0]),(s[1]-q[1])/(q[3]-q[1]),0);0!==f.rotation&&goog.vec.Mat4.rotateZ(e,f.rotation);goog.vec.Mat4.scale(e,a.size[0]*f.resolution/(q[2]-q[0]),a.size[1]*f.resolution/(q[3]-q[1]),1);goog.vec.Mat4.translate(e,-0.5,-0.5,0)};ol.structs.LRUCache=function(){this.count_=0;this.entries_={};this.newest_=this.oldest_=null};ol.structs.LRUCache.prototype.assertValid=function(){if(0!==this.count_){var a,b;a=0;for(b=this.oldest_;!goog.isNull(b);b=b.newer)++a;a=0;for(b=this.newest_;!goog.isNull(b);b=b.older)++a}};ol.structs.LRUCache.prototype.clear=function(){this.count_=0;this.entries_={};this.newest_=this.oldest_=null};ol.structs.LRUCache.prototype.containsKey=function(a){return this.entries_.hasOwnProperty(a)};
|
|
ol.structs.LRUCache.prototype.forEach=function(a,b){for(var c=this.oldest_;!goog.isNull(c);)a.call(b,c.value_,c.key_,this),c=c.newer};ol.structs.LRUCache.prototype.get=function(a){a=this.entries_[a];if(a===this.newest_)return a.value_;a===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(a.newer.older=a.older,a.older.newer=a.newer);a.newer=null;a.older=this.newest_;this.newest_=this.newest_.newer=a;return a.value_};ol.structs.LRUCache.prototype.getCount=function(){return this.count_};
|
|
ol.structs.LRUCache.prototype.getKeys=function(){var a=Array(this.count_),b=0,c;for(c=this.newest_;!goog.isNull(c);c=c.older)a[b++]=c.key_;return a};ol.structs.LRUCache.prototype.getValues=function(){var a=Array(this.count_),b=0,c;for(c=this.newest_;!goog.isNull(c);c=c.older)a[b++]=c.value_;return a};ol.structs.LRUCache.prototype.peekLast=function(){return this.oldest_.value_};ol.structs.LRUCache.prototype.peekLastKey=function(){return this.oldest_.key_};
|
|
ol.structs.LRUCache.prototype.pop=function(){var a=this.oldest_;delete this.entries_[a.key_];goog.isNull(a.newer)||(a.newer.older=null);this.oldest_=a.newer;goog.isNull(this.oldest_)&&(this.newest_=null);--this.count_;return a.value_};ol.structs.LRUCache.prototype.set=function(a,b){var c={key_:a,newer:null,older:this.newest_,value_:b};goog.isNull(this.newest_)?this.oldest_=c:this.newest_.newer=c;this.newest_=c;this.entries_[a]=c;++this.count_};ol.webgl.Context=function(a,b){this.canvas_=a;this.gl_=b;this.bufferCache_={};this.shaderCache_={};this.programCache_={};this.currentProgram_=null;goog.events.listen(this.canvas_,ol.webgl.WebGLContextEventType.LOST,this.handleWebGLContextLost,!1,this);goog.events.listen(this.canvas_,ol.webgl.WebGLContextEventType.RESTORED,this.handleWebGLContextRestored,!1,this)};
|
|
ol.webgl.Context.prototype.bindBuffer=function(a,b){var c=this.getGL(),d=b.getArray(),e=goog.getUid(b);if(e in this.bufferCache_)e=this.bufferCache_[e],c.bindBuffer(a,e.buffer),e.dirtySet.forEachRange(function(b,e){var f=d.slice(b,e);c.bufferSubData(a,b,a==goog.webgl.ARRAY_BUFFER?new Float32Array(f):new Uint16Array(f))}),e.dirtySet.clear();else{var f=c.createBuffer();c.bindBuffer(a,f);c.bufferData(a,a==goog.webgl.ARRAY_BUFFER?new Float32Array(d):new Uint16Array(d),b.getUsage());var g=new ol.structs.IntegerSet;
|
|
b.addDirtySet(g);this.bufferCache_[e]={buf:b,buffer:f,dirtySet:g}}};ol.webgl.Context.prototype.deleteBuffer=function(a){var b=this.getGL();a=goog.getUid(a);var c=this.bufferCache_[a];c.buf.removeDirtySet(c.dirtySet);b.isContextLost()||b.deleteBuffer(c.buffer);delete this.bufferCache_[a]};
|
|
ol.webgl.Context.prototype.disposeInternal=function(){goog.object.forEach(this.bufferCache_,function(a){a.buf.removeDirtySet(a.dirtySet)});var a=this.getGL();a.isContextLost()||(goog.object.forEach(this.bufferCache_,function(b){a.deleteBuffer(b.buffer)}),goog.object.forEach(this.programCache_,function(b){a.deleteProgram(b)}),goog.object.forEach(this.shaderCache_,function(b){a.deleteShader(b)}))};ol.webgl.Context.prototype.getCanvas=function(){return this.canvas_};
|
|
ol.webgl.Context.prototype.getGL=function(){return this.gl_};ol.webgl.Context.prototype.getShader=function(a){var b=goog.getUid(a);if(b in this.shaderCache_)return this.shaderCache_[b];var c=this.getGL(),d=c.createShader(a.getType());c.shaderSource(d,a.getSource());c.compileShader(d);goog.DEBUG&&(c.getShaderParameter(d,goog.webgl.COMPILE_STATUS)||c.isContextLost());return this.shaderCache_[b]=d};
|
|
ol.webgl.Context.prototype.getProgram=function(a,b){var c=goog.getUid(a)+"/"+goog.getUid(b);if(c in this.programCache_)return this.programCache_[c];var d=this.getGL(),e=d.createProgram();d.attachShader(e,this.getShader(a));d.attachShader(e,this.getShader(b));d.linkProgram(e);goog.DEBUG&&(d.getProgramParameter(e,goog.webgl.LINK_STATUS)||d.isContextLost());return this.programCache_[c]=e};
|
|
ol.webgl.Context.prototype.handleWebGLContextLost=function(){goog.object.clear(this.bufferCache_);goog.object.clear(this.shaderCache_);goog.object.clear(this.programCache_);this.currentProgram_=null};ol.webgl.Context.prototype.handleWebGLContextRestored=function(){};ol.webgl.Context.prototype.useProgram=function(a){if(a==this.currentProgram_)return!1;this.getGL().useProgram(a);this.currentProgram_=a;return!0};ol.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK=1024;
|
|
ol.renderer.webgl.Map=function(a,b){ol.renderer.Map.call(this,a,b);this.canvas_=goog.dom.createElement(goog.dom.TagName.CANVAS);this.canvas_.style.width="100%";this.canvas_.style.height="100%";this.canvas_.className=ol.css.CLASS_UNSELECTABLE;goog.dom.insertChildAt(a,this.canvas_,0);this.clipTileCanvas_=goog.dom.createElement(goog.dom.TagName.CANVAS);this.clipTileCanvasSize_=0;this.clipTileContext_=this.clipTileCanvas_.getContext("2d");this.renderedVisible_=!0;this.gl_=ol.webgl.getContext(this.canvas_,
|
|
{antialias:!0,depth:!1,failIfMajorPerformanceCaveat:!0,preserveDrawingBuffer:!1,stencil:!0});this.context_=new ol.webgl.Context(this.canvas_,this.gl_);goog.events.listen(this.canvas_,ol.webgl.WebGLContextEventType.LOST,this.handleWebGLContextLost,!1,this);goog.events.listen(this.canvas_,ol.webgl.WebGLContextEventType.RESTORED,this.handleWebGLContextRestored,!1,this);this.textureCache_=new ol.structs.LRUCache;this.focus_=null;this.tileTextureQueue_=new ol.structs.PriorityQueue(goog.bind(function(a){var b=
|
|
a[1];a=a[2];var e=b[0]-this.focus_[0],b=b[1]-this.focus_[1];return 65536*Math.log(a)+Math.sqrt(e*e+b*b)/a},this),function(a){return a[0].getKey()});this.loadNextTileTexture_=goog.bind(function(a,b){if(!this.tileTextureQueue_.isEmpty()){this.tileTextureQueue_.reprioritize();var e=this.tileTextureQueue_.dequeue();this.bindTileTexture(e[0],e[3],e[4],goog.webgl.LINEAR,goog.webgl.LINEAR)}},this);this.textureCacheFrameMarkerCount_=0;this.initializeGL_()};goog.inherits(ol.renderer.webgl.Map,ol.renderer.Map);
|
|
ol.renderer.webgl.Map.prototype.bindTileTexture=function(a,b,c,d,e){var f=this.getGL(),g=a.getKey();if(this.textureCache_.containsKey(g))a=this.textureCache_.get(g),f.bindTexture(goog.webgl.TEXTURE_2D,a.texture),a.magFilter!=d&&(f.texParameteri(goog.webgl.TEXTURE_2D,goog.webgl.TEXTURE_MAG_FILTER,d),a.magFilter=d),a.minFilter!=e&&(f.texParameteri(goog.webgl.TEXTURE_2D,goog.webgl.TEXTURE_MAG_FILTER,e),a.minFilter=e);else{var h=f.createTexture();f.bindTexture(goog.webgl.TEXTURE_2D,h);if(0<c){var k=this.clipTileCanvas_,
|
|
l=this.clipTileContext_;this.clipTileCanvasSize_!=b?(k.width=b,this.clipTileCanvasSize_=k.height=b):l.clearRect(0,0,b,b);l.drawImage(a.getImage(),c,c,b,b,0,0,b,b);f.texImage2D(goog.webgl.TEXTURE_2D,0,goog.webgl.RGBA,goog.webgl.RGBA,goog.webgl.UNSIGNED_BYTE,k)}else f.texImage2D(goog.webgl.TEXTURE_2D,0,goog.webgl.RGBA,goog.webgl.RGBA,goog.webgl.UNSIGNED_BYTE,a.getImage());f.texParameteri(goog.webgl.TEXTURE_2D,goog.webgl.TEXTURE_MAG_FILTER,d);f.texParameteri(goog.webgl.TEXTURE_2D,goog.webgl.TEXTURE_MIN_FILTER,
|
|
e);f.texParameteri(goog.webgl.TEXTURE_2D,goog.webgl.TEXTURE_WRAP_S,goog.webgl.CLAMP_TO_EDGE);f.texParameteri(goog.webgl.TEXTURE_2D,goog.webgl.TEXTURE_WRAP_T,goog.webgl.CLAMP_TO_EDGE);this.textureCache_.set(g,{texture:h,magFilter:d,minFilter:e})}};ol.renderer.webgl.Map.prototype.createLayerRenderer=function(a){return ol.ENABLE_IMAGE&&a instanceof ol.layer.Image?new ol.renderer.webgl.ImageLayer(this,a):ol.ENABLE_TILE&&a instanceof ol.layer.Tile?new ol.renderer.webgl.TileLayer(this,a):null};
|
|
ol.renderer.webgl.Map.prototype.dispatchComposeEvent_=function(a,b){var c=this.getMap();if(c.hasListener(a)){var d=this.getContext(),e=new ol.render.webgl.Immediate(d,b.pixelRatio),d=new ol.render.Event(a,c,e,b,null,d);c.dispatchEvent(d)}};ol.renderer.webgl.Map.prototype.disposeInternal=function(){var a=this.getGL();a.isContextLost()||this.textureCache_.forEach(function(b){goog.isNull(b)||a.deleteTexture(b.texture)});goog.dispose(this.context_);ol.renderer.webgl.Map.superClass_.disposeInternal.call(this)};
|
|
ol.renderer.webgl.Map.prototype.expireCache_=function(a,b){for(var c=this.getGL(),d;this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>ol.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK;){d=this.textureCache_.peekLast();if(goog.isNull(d))if(+this.textureCache_.peekLastKey()==b.index)break;else--this.textureCacheFrameMarkerCount_;else c.deleteTexture(d.texture);this.textureCache_.pop()}};ol.renderer.webgl.Map.prototype.getContext=function(){return this.context_};
|
|
ol.renderer.webgl.Map.prototype.getGL=function(){return this.gl_};ol.renderer.webgl.Map.prototype.getTileTextureQueue=function(){return this.tileTextureQueue_};ol.renderer.webgl.Map.prototype.handleWebGLContextLost=function(a){a.preventDefault();this.textureCache_.clear();this.textureCacheFrameMarkerCount_=0;goog.object.forEach(this.getLayerRenderers(),function(a,c,d){a.handleWebGLContextLost()})};ol.renderer.webgl.Map.prototype.handleWebGLContextRestored=function(){this.initializeGL_();this.getMap().render()};
|
|
ol.renderer.webgl.Map.prototype.initializeGL_=function(){var a=this.gl_;a.activeTexture(goog.webgl.TEXTURE0);a.blendFuncSeparate(goog.webgl.SRC_ALPHA,goog.webgl.ONE_MINUS_SRC_ALPHA,goog.webgl.ONE,goog.webgl.ONE_MINUS_SRC_ALPHA);a.disable(goog.webgl.CULL_FACE);a.disable(goog.webgl.DEPTH_TEST);a.disable(goog.webgl.SCISSOR_TEST);a.disable(goog.webgl.STENCIL_TEST)};ol.renderer.webgl.Map.prototype.isTileTextureLoaded=function(a){return this.textureCache_.containsKey(a.getKey())};
|
|
ol.renderer.webgl.Map.prototype.renderFrame=function(a){var b=this.getContext(),c=this.getGL();if(c.isContextLost())return!1;if(goog.isNull(a))return this.renderedVisible_&&(goog.style.setElementShown(this.canvas_,!1),this.renderedVisible_=!1),!1;this.focus_=a.focus;this.textureCache_.set((-a.index).toString(),null);++this.textureCacheFrameMarkerCount_;var d=[],e=a.layersArray,f=a.view2DState.resolution,g,h,k,l;g=0;for(h=e.length;g<h;++g)k=e[g],l=a.layerStates[goog.getUid(k)],l.visible&&(l.sourceState==
|
|
ol.source.State.READY&&f<l.maxResolution&&f>=l.minResolution)&&d.push(k);g=0;for(h=d.length;g<h;++g)k=d[g],e=this.getLayerRenderer(k),l=a.layerStates[goog.getUid(k)],e.prepareFrame(a,l);g=a.size[0]*a.pixelRatio;h=a.size[1]*a.pixelRatio;if(this.canvas_.width!=g||this.canvas_.height!=h)this.canvas_.width=g,this.canvas_.height=h;c.bindFramebuffer(goog.webgl.FRAMEBUFFER,null);c.clearColor(0,0,0,0);c.clear(goog.webgl.COLOR_BUFFER_BIT);c.enable(goog.webgl.BLEND);c.viewport(0,0,this.canvas_.width,this.canvas_.height);
|
|
this.dispatchComposeEvent_(ol.render.EventType.PRECOMPOSE,a);g=0;for(h=d.length;g<h;++g)k=d[g],l=a.layerStates[goog.getUid(k)],e=this.getLayerRenderer(k),e.composeFrame(a,l,b);this.renderedVisible_||(goog.style.setElementShown(this.canvas_,!0),this.renderedVisible_=!0);this.calculateMatrices2D(a);this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>ol.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK&&a.postRenderFunctions.push(goog.bind(this.expireCache_,this));this.tileTextureQueue_.isEmpty()||(a.postRenderFunctions.push(this.loadNextTileTexture_),
|
|
a.animate=!0);this.dispatchComposeEvent_(ol.render.EventType.POSTCOMPOSE,a);this.scheduleRemoveUnusedLayerRenderers(a);this.scheduleExpireIconCache(a)};ol.OL3_URL="http://ol3js.org/";ol.OL3_LOGO_URL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAAHGAAABxgEXwfpGAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAhNQTFRF////AP//AICAgP//AFVVQECA////K1VVSbbbYL/fJ05idsTYJFtbbcjbJllmZszWWMTOIFhoHlNiZszTa9DdUcHNHlNlV8XRIVdiasrUHlZjIVZjaMnVH1RlIFRkH1RkH1ZlasvYasvXVsPQH1VkacnVa8vWIVZjIFRjVMPQa8rXIVVkXsXRsNveIFVkIFZlIVVj3eDeh6GmbMvXH1ZkIFRka8rWbMvXIFVkIFVjIFVkbMvWH1VjbMvWIFVlbcvWIFVla8vVIFVkbMvWbMvVH1VkbMvWIFVlbcvWIFVkbcvVbMvWjNPbIFVkU8LPwMzNIFVkbczWIFVkbsvWbMvXIFVkRnB8bcvW2+TkW8XRIFVkIlZlJVloJlpoKlxrLl9tMmJwOWd0Omh1RXF8TneCT3iDUHiDU8LPVMLPVcLPVcPQVsPPVsPQV8PQWMTQWsTQW8TQXMXSXsXRX4SNX8bSYMfTYcfTYsfTY8jUZcfSZsnUaIqTacrVasrVa8jTa8rWbI2VbMvWbcvWdJObdcvUdszUd8vVeJaee87Yfc3WgJyjhqGnitDYjaarldPZnrK2oNbborW5o9bbo9fbpLa6q9ndrL3ArtndscDDutzfu8fJwN7gwt7gxc/QyuHhy+HizeHi0NfX0+Pj19zb1+Tj2uXk29/e3uLg3+Lh3+bl4uXj4ufl4+fl5Ofl5ufl5ujm5+jmySDnBAAAAFp0Uk5TAAECAgMEBAYHCA0NDg4UGRogIiMmKSssLzU7PkJJT1JTVFliY2hrdHZ3foSFhYeJjY2QkpugqbG1tre5w8zQ09XY3uXn6+zx8vT09vf4+Pj5+fr6/P39/f3+gz7SsAAAAVVJREFUOMtjYKA7EBDnwCPLrObS1BRiLoJLnte6CQy8FLHLCzs2QUG4FjZ5GbcmBDDjxJBXDWxCBrb8aM4zbkIDzpLYnAcE9VXlJSWlZRU13koIeW57mGx5XjoMZEUqwxWYQaQbSzLSkYGfKFSe0QMsX5WbjgY0YS4MBplemI4BdGBW+DQ11eZiymfqQuXZIjqwyadPNoSZ4L+0FVM6e+oGI6g8a9iKNT3o8kVzNkzRg5lgl7p4wyRUL9Yt2jAxVh6mQCogae6GmflI8p0r13VFWTHBQ0rWPW7ahgWVcPm+9cuLoyy4kCJDzCm6d8PSFoh0zvQNC5OjDJhQopPPJqph1doJBUD5tnkbZiUEqaCnB3bTqLTFG1bPn71kw4b+GFdpLElKIzRxxgYgWNYc5SCENVHKeUaltHdXx0dZ8uBI1hJ2UUDgq82CM2MwKeibqAvSO7MCABq0wXEPiqWEAAAAAElFTkSuQmCC";
|
|
ol.RendererHint={CANVAS:"canvas",DOM:"dom",WEBGL:"webgl"};ol.DEFAULT_RENDERER_HINTS=[ol.RendererHint.WEBGL,ol.RendererHint.CANVAS,ol.RendererHint.DOM];ol.MapProperty={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};
|
|
ol.Map=function(a){ol.Object.call(this);var b=ol.Map.createOptionsInternal(a);this.pixelRatio_=goog.isDef(a.pixelRatio)?a.pixelRatio:ol.BrowserFeature.DEVICE_PIXEL_RATIO;this.ol3Logo_=b.ol3Logo;this.animationDelay_=new goog.async.AnimationDelay(this.renderFrame_,void 0,this);this.registerDisposable(this.animationDelay_);this.coordinateToPixelMatrix_=goog.vec.Mat4.createNumber();this.pixelToCoordinateMatrix_=goog.vec.Mat4.createNumber();this.frameIndex_=0;this.layerGroupPropertyListenerKeys_=this.viewPropertyListenerKey_=
|
|
this.frameState_=null;this.viewport_=goog.dom.createDom(goog.dom.TagName.DIV,"ol-viewport");this.viewport_.style.position="relative";this.viewport_.style.overflow="hidden";this.viewport_.style.width="100%";this.viewport_.style.height="100%";this.viewport_.style.msTouchAction="none";ol.BrowserFeature.HAS_TOUCH&&(this.viewport_.className="ol-touch");this.overlayContainer_=goog.dom.createDom(goog.dom.TagName.DIV,"ol-overlaycontainer");goog.dom.appendChild(this.viewport_,this.overlayContainer_);this.overlayContainerStopEvent_=
|
|
goog.dom.createDom(goog.dom.TagName.DIV,"ol-overlaycontainer-stopevent");goog.events.listen(this.overlayContainerStopEvent_,[goog.events.EventType.CLICK,goog.events.EventType.DBLCLICK,goog.events.EventType.MOUSEDOWN,goog.events.EventType.TOUCHSTART,goog.events.EventType.MSPOINTERDOWN],goog.events.Event.stopPropagation);goog.dom.appendChild(this.viewport_,this.overlayContainerStopEvent_);a=new ol.MapBrowserEventHandler(this);goog.events.listen(a,goog.object.getValues(ol.MapBrowserEvent.EventType),
|
|
this.handleMapBrowserEvent,!1,this);this.registerDisposable(a);this.keyboardEventTarget_=b.keyboardEventTarget;this.keyHandler_=new goog.events.KeyHandler;goog.events.listen(this.keyHandler_,goog.events.KeyHandler.EventType.KEY,this.handleBrowserEvent,!1,this);this.registerDisposable(this.keyHandler_);a=new goog.events.MouseWheelHandler(this.viewport_);goog.events.listen(a,goog.events.MouseWheelHandler.EventType.MOUSEWHEEL,this.handleBrowserEvent,!1,this);this.registerDisposable(a);this.controls_=
|
|
b.controls;this.deviceOptions_=b.deviceOptions;this.interactions_=b.interactions;this.overlays_=b.overlays;this.renderer_=new b.rendererConstructor(this.viewport_,this);this.registerDisposable(this.renderer_);this.viewportSizeMonitor_=new goog.dom.ViewportSizeMonitor;goog.events.listen(this.viewportSizeMonitor_,goog.events.EventType.RESIZE,this.updateSize,!1,this);this.focus_=null;this.preRenderFunctions_=[];this.postRenderFunctions_=[];this.tileQueue_=new ol.TileQueue(goog.bind(this.getTilePriority,
|
|
this),goog.bind(this.handleTileChange_,this));goog.events.listen(this,ol.Object.getChangeEventType(ol.MapProperty.LAYERGROUP),this.handleLayerGroupChanged_,!1,this);goog.events.listen(this,ol.Object.getChangeEventType(ol.MapProperty.VIEW),this.handleViewChanged_,!1,this);goog.events.listen(this,ol.Object.getChangeEventType(ol.MapProperty.SIZE),this.handleSizeChanged_,!1,this);goog.events.listen(this,ol.Object.getChangeEventType(ol.MapProperty.TARGET),this.handleTargetChanged_,!1,this);this.setValues(b.values);
|
|
this.controls_.forEach(function(a){a.setMap(this)},this);goog.events.listen(this.controls_,ol.CollectionEventType.ADD,function(a){a.element.setMap(this)},!1,this);goog.events.listen(this.controls_,ol.CollectionEventType.REMOVE,function(a){a.element.setMap(null)},!1,this);this.interactions_.forEach(function(a){a.setMap(this)},this);goog.events.listen(this.interactions_,ol.CollectionEventType.ADD,function(a){a.element.setMap(this)},!1,this);goog.events.listen(this.interactions_,ol.CollectionEventType.REMOVE,
|
|
function(a){a.element.setMap(null)},!1,this);this.overlays_.forEach(function(a){a.setMap(this)},this);goog.events.listen(this.overlays_,ol.CollectionEventType.ADD,function(a){a.element.setMap(this)},!1,this);goog.events.listen(this.overlays_,ol.CollectionEventType.REMOVE,function(a){a.element.setMap(null)},!1,this)};goog.inherits(ol.Map,ol.Object);ol.Map.prototype.addControl=function(a){this.getControls().push(a)};ol.Map.prototype.addInteraction=function(a){this.getInteractions().push(a)};
|
|
ol.Map.prototype.addLayer=function(a){this.getLayerGroup().getLayers().push(a)};ol.Map.prototype.addOverlay=function(a){this.getOverlays().push(a)};ol.Map.prototype.beforeRender=function(a){this.render();Array.prototype.push.apply(this.preRenderFunctions_,arguments)};ol.Map.prototype.removePreRenderFunction=function(a){return goog.array.remove(this.preRenderFunctions_,a)};ol.Map.prototype.disposeInternal=function(){goog.dom.removeNode(this.viewport_);ol.Map.superClass_.disposeInternal.call(this)};
|
|
ol.Map.prototype.forEachFeatureAtPixel=function(a,b,c,d,e){if(!goog.isNull(this.frameState_))return a=this.getCoordinateFromPixel(a),c=goog.isDef(c)?c:null,d=goog.isDef(d)?d:goog.functions.TRUE,e=goog.isDef(e)?e:null,this.renderer_.forEachFeatureAtPixel(a,this.frameState_,b,c,d,e)};ol.Map.prototype.getEventCoordinate=function(a){return this.getCoordinateFromPixel(this.getEventPixel(a))};
|
|
ol.Map.prototype.getEventPixel=function(a){if(goog.isDef(a.changedTouches)){a=a.changedTouches.item(0);var b=goog.style.getClientPosition(this.viewport_);return[a.clientX-b.x,a.clientY-b.y]}a=goog.style.getRelativePosition(a,this.viewport_);return[a.x,a.y]};ol.Map.prototype.getTarget=function(){return this.get(ol.MapProperty.TARGET)};goog.exportProperty(ol.Map.prototype,"getTarget",ol.Map.prototype.getTarget);
|
|
ol.Map.prototype.getCoordinateFromPixel=function(a){var b=this.frameState_;if(goog.isNull(b))return null;a=a.slice();return ol.vec.Mat4.multVec2(b.pixelToCoordinateMatrix,a,a)};ol.Map.prototype.getControls=function(){return this.controls_};ol.Map.prototype.getOverlays=function(){return this.overlays_};ol.Map.prototype.getInteractions=function(){return this.interactions_};ol.Map.prototype.getLayerGroup=function(){return this.get(ol.MapProperty.LAYERGROUP)};
|
|
goog.exportProperty(ol.Map.prototype,"getLayerGroup",ol.Map.prototype.getLayerGroup);ol.Map.prototype.getLayers=function(){var a=this.getLayerGroup();if(goog.isDef(a))return a.getLayers()};ol.Map.prototype.getPixelFromCoordinate=function(a){var b=this.frameState_;if(goog.isNull(b))return null;a=a.slice(0,2);return ol.vec.Mat4.multVec2(b.coordinateToPixelMatrix,a,a)};ol.Map.prototype.getSize=function(){return this.get(ol.MapProperty.SIZE)};goog.exportProperty(ol.Map.prototype,"getSize",ol.Map.prototype.getSize);
|
|
ol.Map.prototype.getView=function(){return this.get(ol.MapProperty.VIEW)};goog.exportProperty(ol.Map.prototype,"getView",ol.Map.prototype.getView);ol.Map.prototype.getViewport=function(){return this.viewport_};ol.Map.prototype.getOverlayContainer=function(){return this.overlayContainer_};ol.Map.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_};
|
|
ol.Map.prototype.getTilePriority=function(a,b,c,d){var e=this.frameState_;if(goog.isNull(e)||!(b in e.wantedTiles)||!e.wantedTiles[b][a.tileCoord.toString()])return ol.structs.PriorityQueue.DROP;a=c[0]-e.focus[0];c=c[1]-e.focus[1];return 65536*Math.log(d)+Math.sqrt(a*a+c*c)/d};ol.Map.prototype.handleBrowserEvent=function(a,b){var c=new ol.MapBrowserEvent(b||a.type,this,a);this.handleMapBrowserEvent(c)};
|
|
ol.Map.prototype.handleMapBrowserEvent=function(a){if(!goog.isNull(this.frameState_)){this.focus_=a.coordinate;a.frameState=this.frameState_;var b=this.getInteractions().getArray(),c;if(!1!==this.dispatchEvent(a))for(c=b.length-1;0<=c&&b[c].handleMapBrowserEvent(a);c--);}};
|
|
ol.Map.prototype.handlePostRender=function(){var a=this.frameState_,b=this.tileQueue_;if(!b.isEmpty()){var c=16,d=c,e=0;if(!goog.isNull(a)){var e=a.viewHints,f=this.deviceOptions_;e[ol.ViewHint.ANIMATING]&&(c=!1===f.loadTilesWhileAnimating?0:8,d=2);e[ol.ViewHint.INTERACTING]&&(c=!1===f.loadTilesWhileInteracting?0:8,d=2);e=goog.object.getCount(a.wantedTiles)}c*=e;d*=e;b.getTilesLoading()<c&&(b.reprioritize(),b.loadMoreTiles(c,d))}b=this.postRenderFunctions_;c=0;for(d=b.length;c<d;++c)b[c](this,a);
|
|
b.length=0};ol.Map.prototype.handleSizeChanged_=function(){this.render()};ol.Map.prototype.handleTargetChanged_=function(){var a=this.getTarget(),a=goog.isDef(a)?goog.dom.getElement(a):null;this.keyHandler_.detach();goog.isNull(a)?goog.dom.removeNode(this.viewport_):(goog.dom.appendChild(a,this.viewport_),a=goog.isNull(this.keyboardEventTarget_)?a:this.keyboardEventTarget_,this.keyHandler_.attach(a));this.updateSize()};ol.Map.prototype.handleTileChange_=function(){this.render()};
|
|
ol.Map.prototype.handleViewPropertyChanged_=function(){this.render()};ol.Map.prototype.handleViewChanged_=function(){goog.isNull(this.viewPropertyListenerKey_)||(goog.events.unlistenByKey(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null);var a=this.getView();goog.isDefAndNotNull(a)&&(this.viewPropertyListenerKey_=goog.events.listen(a,ol.ObjectEventType.PROPERTYCHANGE,this.handleViewPropertyChanged_,!1,this));this.render()};ol.Map.prototype.handleLayerGroupMemberChanged_=function(a){this.render()};
|
|
ol.Map.prototype.handleLayerGroupPropertyChanged_=function(a){this.render()};
|
|
ol.Map.prototype.handleLayerGroupChanged_=function(){if(!goog.isNull(this.layerGroupPropertyListenerKeys_)){for(var a=this.layerGroupPropertyListenerKeys_.length,b=0;b<a;++b)goog.events.unlistenByKey(this.layerGroupPropertyListenerKeys_[b]);this.layerGroupPropertyListenerKeys_=null}a=this.getLayerGroup();goog.isDefAndNotNull(a)&&(this.layerGroupPropertyListenerKeys_=[goog.events.listen(a,ol.ObjectEventType.PROPERTYCHANGE,this.handleLayerGroupPropertyChanged_,!1,this),goog.events.listen(a,goog.events.EventType.CHANGE,
|
|
this.handleLayerGroupMemberChanged_,!1,this)]);this.render()};ol.Map.prototype.isDef=function(){if(!goog.dom.contains(document,this.viewport_)||!goog.style.isElementShown(this.viewport_))return!1;var a=this.getSize();if(!goog.isDefAndNotNull(a)||0>=a[0]||0>=a[1])return!1;a=this.getView();return goog.isDef(a)&&a.isDef()?!0:!1};ol.Map.prototype.isRendered=function(){return!goog.isNull(this.frameState_)};ol.Map.prototype.renderSync=function(){this.animationDelay_.fire()};
|
|
ol.Map.prototype.render=function(){this.animationDelay_.isActive()||this.animationDelay_.start()};ol.Map.prototype.removeControl=function(a){var b=this.getControls();if(goog.isDef(b.remove(a)))return a};ol.Map.prototype.removeInteraction=function(a){var b,c=this.getInteractions();goog.isDef(c.remove(a))&&(b=a);return b};ol.Map.prototype.removeLayer=function(a){return this.getLayerGroup().getLayers().remove(a)};ol.Map.prototype.removeOverlay=function(a){var b=this.getOverlays();if(goog.isDef(b.remove(a)))return a};
|
|
ol.Map.prototype.renderFrame_=function(a){var b,c,d,e=this.getSize();b=this.getView();var f=goog.isDef(b)?this.getView().getView2D():void 0,g=null;if(goog.isDef(e)&&0<e[0]&&0<e[1]&&goog.isDef(f)&&f.isDef()){g=b.getHints();b=this.getLayerGroup().getLayerStatesArray();var h=b.layers;d=b.layerStates;var k={},l;b=0;for(c=h.length;b<c;++b)l=h[b],k[goog.getUid(l)]=d[b];d=f.getView2DState();g={animate:!1,attributions:{},coordinateToPixelMatrix:this.coordinateToPixelMatrix_,extent:null,focus:goog.isNull(this.focus_)?
|
|
d.center:this.focus_,index:this.frameIndex_++,layersArray:h,layerStates:k,logos:{},pixelRatio:this.pixelRatio_,pixelToCoordinateMatrix:this.pixelToCoordinateMatrix_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:a,usedTiles:{},view2DState:d,viewHints:g,wantedTiles:{}};this.ol3Logo_&&(g.logos[ol.OL3_LOGO_URL]=ol.OL3_URL)}a=this.preRenderFunctions_;b=e=0;for(c=a.length;b<c;++b)f=a[b],f(this,g)&&(a[e++]=f);a.length=e;goog.isNull(g)||(g.extent=ol.extent.getForView2DAndSize(d.center,d.resolution,
|
|
d.rotation,g.size));this.frameState_=g;this.renderer_.renderFrame(g);goog.isNull(g)||(g.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,g.postRenderFunctions),0!=this.preRenderFunctions_.length||(g.animate||g.viewHints[ol.ViewHint.ANIMATING]||g.viewHints[ol.ViewHint.INTERACTING])||this.dispatchEvent(new ol.MapEvent(ol.MapEventType.MOVEEND,this)));this.dispatchEvent(new ol.MapEvent(ol.MapEventType.POSTRENDER,this,g));goog.async.nextTick(this.handlePostRender,this)};
|
|
ol.Map.prototype.setLayerGroup=function(a){this.set(ol.MapProperty.LAYERGROUP,a)};goog.exportProperty(ol.Map.prototype,"setLayerGroup",ol.Map.prototype.setLayerGroup);ol.Map.prototype.setSize=function(a){this.set(ol.MapProperty.SIZE,a)};goog.exportProperty(ol.Map.prototype,"setSize",ol.Map.prototype.setSize);ol.Map.prototype.setTarget=function(a){this.set(ol.MapProperty.TARGET,a)};goog.exportProperty(ol.Map.prototype,"setTarget",ol.Map.prototype.setTarget);
|
|
ol.Map.prototype.setView=function(a){this.set(ol.MapProperty.VIEW,a)};goog.exportProperty(ol.Map.prototype,"setView",ol.Map.prototype.setView);ol.Map.prototype.updateSize=function(){var a=this.getTarget(),a=goog.isDef(a)?goog.dom.getElement(a):null;goog.isNull(a)?this.setSize(void 0):(a=goog.style.getContentBoxSize(a),this.setSize([a.width,a.height]))};
|
|
ol.Map.createOptionsInternal=function(a){var b=null;goog.isDef(a.keyboardEventTarget)&&(b=goog.isString(a.keyboardEventTarget)?document.getElementById(a.keyboardEventTarget):a.keyboardEventTarget);var c={},d=goog.isDef(a.ol3Logo)?a.ol3Logo:!0,e=a.layers instanceof ol.layer.Group?a.layers:new ol.layer.Group({layers:a.layers});c[ol.MapProperty.LAYERGROUP]=e;c[ol.MapProperty.TARGET]=a.target;c[ol.MapProperty.VIEW]=goog.isDef(a.view)?a.view:new ol.View2D;var e=ol.renderer.Map,f;goog.isDef(a.renderer)?
|
|
goog.isArray(a.renderer)?f=a.renderer:goog.isString(a.renderer)&&(f=[a.renderer]):f=ol.DEFAULT_RENDERER_HINTS;var g,h;g=0;for(h=f.length;g<h;++g){var k=f[g];if(ol.ENABLE_CANVAS&&k==ol.RendererHint.CANVAS){if(ol.BrowserFeature.HAS_CANVAS){e=ol.renderer.canvas.Map;break}}else if(ol.ENABLE_DOM&&k==ol.RendererHint.DOM){if(ol.BrowserFeature.HAS_DOM){e=ol.renderer.dom.Map;break}}else if(ol.ENABLE_WEBGL&&k==ol.RendererHint.WEBGL&&ol.BrowserFeature.HAS_WEBGL){e=ol.renderer.webgl.Map;break}}f=goog.isDef(a.controls)?
|
|
goog.isArray(a.controls)?new ol.Collection(goog.array.clone(a.controls)):a.controls:ol.control.defaults();g=goog.isDef(a.deviceOptions)?a.deviceOptions:{};h=goog.isDef(a.interactions)?goog.isArray(a.interactions)?new ol.Collection(goog.array.clone(a.interactions)):a.interactions:ol.interaction.defaults();a=goog.isDef(a.overlays)?goog.isArray(a.overlays)?new ol.Collection(goog.array.clone(a.overlays)):a.overlays:new ol.Collection;return{controls:f,deviceOptions:g,interactions:h,keyboardEventTarget:b,
|
|
ol3Logo:d,overlays:a,rendererConstructor:e,values:c}};ol.proj.common.add();goog.DEBUG&&function(){}();ol.DrawEventType={DRAWSTART:"drawstart",DRAWEND:"drawend"};ol.DrawEvent=function(a,b){goog.events.Event.call(this,a);this.feature=b};goog.inherits(ol.DrawEvent,goog.events.Event);
|
|
ol.interaction.Draw=function(a){ol.interaction.Interaction.call(this);this.source_=goog.isDef(a.source)?a.source:null;this.features_=goog.isDef(a.features)?a.features:null;this.snapTolerance_=goog.isDef(a.snapTolerance)?a.snapTolerance:12;this.minPointsPerRing_=goog.isDef(a.minPointsPerRing)?a.minPointsPerRing:3;this.type_=a.type;this.mode_=ol.interaction.Draw.getMode_(this.type_);this.sketchRawPolygon_=this.sketchLine_=this.sketchPoint_=this.sketchFeature_=this.finishCoordinate_=null;this.squaredClickTolerance_=
|
|
4;this.overlay_=new ol.FeatureOverlay({style:goog.isDef(a.style)?a.style:ol.interaction.Draw.getDefaultStyleFunction()})};goog.inherits(ol.interaction.Draw,ol.interaction.Interaction);
|
|
ol.interaction.Draw.getDefaultStyleFunction=function(){var a={};a[ol.geom.GeometryType.POLYGON]=[new ol.style.Style({fill:new ol.style.Fill({color:[255,255,255,0.5]})})];a[ol.geom.GeometryType.MULTI_POLYGON]=a[ol.geom.GeometryType.POLYGON];a[ol.geom.GeometryType.LINE_STRING]=[new ol.style.Style({stroke:new ol.style.Stroke({color:[255,255,255,1],width:5})}),new ol.style.Style({stroke:new ol.style.Stroke({color:[0,153,255,1],width:3})})];a[ol.geom.GeometryType.MULTI_LINE_STRING]=a[ol.geom.GeometryType.LINE_STRING];
|
|
a[ol.geom.GeometryType.POINT]=[new ol.style.Style({image:new ol.style.Circle({radius:7,fill:new ol.style.Fill({color:[0,153,255,1]}),stroke:new ol.style.Stroke({color:[255,255,255,0.75],width:1.5})}),zIndex:1E5})];a[ol.geom.GeometryType.MULTI_POINT]=a[ol.geom.GeometryType.POINT];return function(b,c){return a[b.getGeometry().getType()]}};ol.interaction.Draw.prototype.setMap=function(a){goog.isNull(a)&&this.abortDrawing_();this.overlay_.setMap(a);ol.interaction.Draw.superClass_.setMap.call(this,a)};
|
|
ol.interaction.Draw.prototype.handleMapBrowserEvent=function(a){if(!a.map.isDef())return!0;var b=!0;a.type===ol.MapBrowserEvent.EventType.CLICK?b=this.handleClick_(a):a.type===ol.MapBrowserEvent.EventType.MOUSEMOVE?b=this.handleMove_(a):a.type===ol.MapBrowserEvent.EventType.DBLCLICK&&(b=!1);return b};
|
|
ol.interaction.Draw.prototype.handleClick_=function(a){var b=a.map.getEventPixel(a.target.getDown()),c=a.pixel,d=b[0]-c[0],b=b[1]-c[1],c=!0;d*d+b*b<=this.squaredClickTolerance_&&(goog.isNull(this.finishCoordinate_)?this.startDrawing_(a):this.mode_===ol.interaction.DrawMode.POINT||this.atFinish_(a)?this.finishDrawing_(a):this.addToDrawing_(a),c=!1);return c};
|
|
ol.interaction.Draw.prototype.handleMove_=function(a){this.mode_===ol.interaction.DrawMode.POINT&&goog.isNull(this.finishCoordinate_)?this.startDrawing_(a):goog.isNull(this.finishCoordinate_)||this.modifyDrawing_(a);return!0};
|
|
ol.interaction.Draw.prototype.atFinish_=function(a){var b=!1;if(!goog.isNull(this.sketchFeature_)){var c=this.sketchFeature_.getGeometry(),d=!1,e=[this.finishCoordinate_];this.mode_===ol.interaction.DrawMode.LINE_STRING?d=2<c.getCoordinates().length:this.mode_===ol.interaction.DrawMode.POLYGON&&(d=c.getCoordinates()[0].length>this.minPointsPerRing_,e=[this.sketchRawPolygon_[0][0],this.sketchRawPolygon_[0][this.sketchRawPolygon_[0].length-2]]);if(d)for(var c=a.map,d=0,f=e.length;d<f;d++){var g=e[d],
|
|
h=c.getPixelFromCoordinate(g),k=a.pixel,b=k[0]-h[0],h=k[1]-h[1];if(b=Math.sqrt(b*b+h*h)<=this.snapTolerance_){this.finishCoordinate_=g;break}}}return b};
|
|
ol.interaction.Draw.prototype.startDrawing_=function(a){this.finishCoordinate_=a=a.coordinate;var b;this.mode_===ol.interaction.DrawMode.POINT?b=new ol.geom.Point(a.slice()):(this.sketchPoint_=new ol.Feature(new ol.geom.Point(a.slice())),this.mode_===ol.interaction.DrawMode.LINE_STRING?b=new ol.geom.LineString([a.slice(),a.slice()]):this.mode_===ol.interaction.DrawMode.POLYGON&&(this.sketchLine_=new ol.Feature(new ol.geom.LineString([a.slice(),a.slice()])),this.sketchRawPolygon_=[[a.slice(),a.slice()]],
|
|
b=new ol.geom.Polygon(this.sketchRawPolygon_)));this.sketchFeature_=new ol.Feature(b);this.updateSketchFeatures_();this.dispatchEvent(new ol.DrawEvent(ol.DrawEventType.DRAWSTART,this.sketchFeature_))};
|
|
ol.interaction.Draw.prototype.modifyDrawing_=function(a){var b=a.coordinate,c=this.sketchFeature_.getGeometry(),d;this.mode_===ol.interaction.DrawMode.POINT?(a=c.getCoordinates(),a[0]=b[0],a[1]=b[1],c.setCoordinates(a)):(this.mode_===ol.interaction.DrawMode.LINE_STRING?d=c.getCoordinates():this.mode_===ol.interaction.DrawMode.POLYGON&&(d=this.sketchRawPolygon_[0]),this.atFinish_(a)&&(b=this.finishCoordinate_.slice()),this.sketchPoint_.getGeometry().setCoordinates(b),a=d[d.length-1],a[0]=b[0],a[1]=
|
|
b[1],this.mode_===ol.interaction.DrawMode.LINE_STRING?c.setCoordinates(d):this.mode_===ol.interaction.DrawMode.POLYGON&&(this.sketchLine_.getGeometry().setCoordinates(d),c.setCoordinates(this.sketchRawPolygon_)));this.updateSketchFeatures_()};
|
|
ol.interaction.Draw.prototype.addToDrawing_=function(a){a=a.coordinate;var b=this.sketchFeature_.getGeometry(),c;this.mode_===ol.interaction.DrawMode.LINE_STRING?(this.finishCoordinate_=a.slice(),c=b.getCoordinates(),c.push(a.slice()),b.setCoordinates(c)):this.mode_===ol.interaction.DrawMode.POLYGON&&(this.sketchRawPolygon_[0].push(a.slice()),b.setCoordinates(this.sketchRawPolygon_));this.updateSketchFeatures_()};
|
|
ol.interaction.Draw.prototype.finishDrawing_=function(a){a=this.abortDrawing_();var b,c=a.getGeometry();this.mode_===ol.interaction.DrawMode.POINT?b=c.getCoordinates():this.mode_===ol.interaction.DrawMode.LINE_STRING?(b=c.getCoordinates(),b.pop(),c.setCoordinates(b)):this.mode_===ol.interaction.DrawMode.POLYGON&&(this.sketchRawPolygon_[0].pop(),this.sketchRawPolygon_[0].push(this.sketchRawPolygon_[0][0]),c.setCoordinates(this.sketchRawPolygon_),b=c.getCoordinates());this.type_===ol.geom.GeometryType.MULTI_POINT?
|
|
a.setGeometry(new ol.geom.MultiPoint([b])):this.type_===ol.geom.GeometryType.MULTI_LINE_STRING?a.setGeometry(new ol.geom.MultiLineString([b])):this.type_===ol.geom.GeometryType.MULTI_POLYGON&&a.setGeometry(new ol.geom.MultiPolygon([b]));goog.isNull(this.features_)||this.features_.push(a);goog.isNull(this.source_)||this.source_.addFeature(a);this.dispatchEvent(new ol.DrawEvent(ol.DrawEventType.DRAWEND,a))};
|
|
ol.interaction.Draw.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var a=this.sketchFeature_;goog.isNull(a)||(this.sketchLine_=this.sketchPoint_=this.sketchFeature_=null,this.overlay_.getFeatures().clear());return a};ol.interaction.Draw.prototype.updateSketchFeatures_=function(){var a=[this.sketchFeature_];goog.isNull(this.sketchLine_)||a.push(this.sketchLine_);goog.isNull(this.sketchPoint_)||a.push(this.sketchPoint_);this.overlay_.setFeatures(new ol.Collection(a))};
|
|
ol.interaction.Draw.getMode_=function(a){var b;if(a===ol.geom.GeometryType.POINT||a===ol.geom.GeometryType.MULTI_POINT)b=ol.interaction.DrawMode.POINT;else if(a===ol.geom.GeometryType.LINE_STRING||a===ol.geom.GeometryType.MULTI_LINE_STRING)b=ol.interaction.DrawMode.LINE_STRING;else if(a===ol.geom.GeometryType.POLYGON||a===ol.geom.GeometryType.MULTI_POLYGON)b=ol.interaction.DrawMode.POLYGON;return b};ol.interaction.DrawMode={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon"};ol.Ellipsoid=function(a,b){this.a=a;this.flattening=b;this.b=this.a*(1-this.flattening);this.eSquared=2*b-b*b;this.e=Math.sqrt(this.eSquared)};
|
|
ol.Ellipsoid.prototype.vincenty=function(a,b,c,d){c=goog.isDef(c)?c:1E-12;var e=goog.isDef(d)?d:100,f=this.flattening,g=goog.math.toRadians(a[1]);d=goog.math.toRadians(b[1]);var h=goog.math.toRadians(b[0]-a[0]);b=Math.atan((1-f)*Math.tan(g));a=Math.cos(b);b=Math.sin(b);g=Math.atan((1-f)*Math.tan(d));d=Math.cos(g);var g=Math.sin(g),k=h,l,m,n;m=Infinity;for(var p,r,q;0<e;--e){n=Math.cos(k);p=Math.sin(k);r=d*p;q=a*g-b*d*n;q=Math.sqrt(r*r+q*q);if(0===q)return{distance:0,initialBearing:0,finalBearing:0};
|
|
n=b*g+a*d*n;r=Math.atan2(q,n);m=a*d*p/q;l=1-m*m;p=n-2*b*g/l;isNaN(p)&&(p=0);var u=f/16*l*(4+f*(4-3*l)),u=h+(1-u)*f*m*(r+u*q*(p+u*n*(2*p*p-1)));m=Math.abs(u-k);k=u;if(m<c)break}if(0===e)return{distance:NaN,finalBearing:NaN,initialBearing:NaN};c=this.b*this.b;f=l*(this.a*this.a-c)/c;c=1+f/16384*(4096+f*(f*(320-175*f)-768));f=f/1024*(256+f*(f*(74-47*f)-128));q=f*q*(p+f/4*(n*(2*p*p-1)-f/6*p*(4*q*q-3)*(4*p*p-3)));n=Math.cos(k);p=Math.sin(k);f=Math.atan2(d*p,a*g-b*d*n);a=Math.atan2(a*p,a*g*n-b*d);return{distance:this.b*
|
|
c*(r-q),initialBearing:goog.math.toDegrees(f),finalBearing:goog.math.toDegrees(a)}};ol.Ellipsoid.prototype.vincentyDistance=function(a,b,c,d){return this.vincenty(a,b,c,d).distance};ol.Ellipsoid.prototype.vincentyFinalBearing=function(a,b,c,d){return this.vincenty(a,b,c,d).finalBearing};ol.Ellipsoid.prototype.vincentyInitialBearing=function(a,b,c,d){return this.vincenty(a,b,c,d).initialBearing};ol.GeolocationProperty={ACCURACY:"accuracy",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",PROJECTION:"projection",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"};
|
|
ol.Geolocation=function(a){ol.Object.call(this);a=goog.isDef(a)?a:{};this.position_=null;this.transform_=ol.proj.identityTransform;this.watchId_=void 0;goog.events.listen(this,ol.Object.getChangeEventType(ol.GeolocationProperty.PROJECTION),this.handleProjectionChanged_,!1,this);goog.events.listen(this,ol.Object.getChangeEventType(ol.GeolocationProperty.TRACKING),this.handleTrackingChanged_,!1,this);goog.isDef(a.projection)&&this.setProjection(ol.proj.get(a.projection));goog.isDef(a.trackingOptions)&&
|
|
this.setTrackingOptions(a.trackingOptions);this.setTracking(goog.isDef(a.tracking)?a.tracking:!1)};goog.inherits(ol.Geolocation,ol.Object);ol.Geolocation.prototype.disposeInternal=function(){this.setTracking(!1);ol.Geolocation.superClass_.disposeInternal.call(this)};
|
|
ol.Geolocation.prototype.handleProjectionChanged_=function(){var a=this.getProjection();goog.isDefAndNotNull(a)&&(this.transform_=ol.proj.getTransformFromProjections(ol.proj.get("EPSG:4326"),a),goog.isNull(this.position_)||this.set(ol.GeolocationProperty.POSITION,this.transform_(this.position_)))};
|
|
ol.Geolocation.prototype.handleTrackingChanged_=function(){if(ol.BrowserFeature.HAS_GEOLOCATION){var a=this.getTracking();a&&!goog.isDef(this.watchId_)?this.watchId_=goog.global.navigator.geolocation.watchPosition(goog.bind(this.positionChange_,this),goog.bind(this.positionError_,this),this.getTrackingOptions()):!a&&goog.isDef(this.watchId_)&&(goog.global.navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}};
|
|
ol.Geolocation.prototype.positionChange_=function(a){a=a.coords;this.set(ol.GeolocationProperty.ACCURACY,a.accuracy);this.set(ol.GeolocationProperty.ALTITUDE,goog.isNull(a.altitude)?void 0:a.altitude);this.set(ol.GeolocationProperty.ALTITUDE_ACCURACY,goog.isNull(a.altitudeAccuracy)?void 0:a.altitudeAccuracy);this.set(ol.GeolocationProperty.HEADING,goog.isNull(a.heading)?void 0:goog.math.toRadians(a.heading));goog.isNull(this.position_)?this.position_=[a.longitude,a.latitude]:(this.position_[0]=a.longitude,
|
|
this.position_[1]=a.latitude);this.set(ol.GeolocationProperty.POSITION,this.transform_(this.position_));this.set(ol.GeolocationProperty.SPEED,goog.isNull(a.speed)?void 0:a.speed)};ol.Geolocation.prototype.positionError_=function(a){a.type=goog.events.EventType.ERROR;this.dispatchEvent(a)};ol.Geolocation.prototype.getAccuracy=function(){return this.get(ol.GeolocationProperty.ACCURACY)};goog.exportProperty(ol.Geolocation.prototype,"getAccuracy",ol.Geolocation.prototype.getAccuracy);
|
|
ol.Geolocation.prototype.getAltitude=function(){return this.get(ol.GeolocationProperty.ALTITUDE)};goog.exportProperty(ol.Geolocation.prototype,"getAltitude",ol.Geolocation.prototype.getAltitude);ol.Geolocation.prototype.getAltitudeAccuracy=function(){return this.get(ol.GeolocationProperty.ALTITUDE_ACCURACY)};goog.exportProperty(ol.Geolocation.prototype,"getAltitudeAccuracy",ol.Geolocation.prototype.getAltitudeAccuracy);ol.Geolocation.prototype.getHeading=function(){return this.get(ol.GeolocationProperty.HEADING)};
|
|
goog.exportProperty(ol.Geolocation.prototype,"getHeading",ol.Geolocation.prototype.getHeading);ol.Geolocation.prototype.getPosition=function(){return this.get(ol.GeolocationProperty.POSITION)};goog.exportProperty(ol.Geolocation.prototype,"getPosition",ol.Geolocation.prototype.getPosition);ol.Geolocation.prototype.getProjection=function(){return this.get(ol.GeolocationProperty.PROJECTION)};goog.exportProperty(ol.Geolocation.prototype,"getProjection",ol.Geolocation.prototype.getProjection);
|
|
ol.Geolocation.prototype.getSpeed=function(){return this.get(ol.GeolocationProperty.SPEED)};goog.exportProperty(ol.Geolocation.prototype,"getSpeed",ol.Geolocation.prototype.getSpeed);ol.Geolocation.prototype.getTracking=function(){return this.get(ol.GeolocationProperty.TRACKING)};goog.exportProperty(ol.Geolocation.prototype,"getTracking",ol.Geolocation.prototype.getTracking);ol.Geolocation.prototype.getTrackingOptions=function(){return this.get(ol.GeolocationProperty.TRACKING_OPTIONS)};
|
|
goog.exportProperty(ol.Geolocation.prototype,"getTrackingOptions",ol.Geolocation.prototype.getTrackingOptions);ol.Geolocation.prototype.setProjection=function(a){this.set(ol.GeolocationProperty.PROJECTION,a)};goog.exportProperty(ol.Geolocation.prototype,"setProjection",ol.Geolocation.prototype.setProjection);ol.Geolocation.prototype.setTracking=function(a){this.set(ol.GeolocationProperty.TRACKING,a)};goog.exportProperty(ol.Geolocation.prototype,"setTracking",ol.Geolocation.prototype.setTracking);
|
|
ol.Geolocation.prototype.setTrackingOptions=function(a){this.set(ol.GeolocationProperty.TRACKING_OPTIONS,a)};goog.exportProperty(ol.Geolocation.prototype,"setTrackingOptions",ol.Geolocation.prototype.setTrackingOptions);ol.ImageCanvas=function(a,b,c,d,e){ol.ImageBase.call(this,a,b,c,ol.ImageState.LOADED,d);this.canvas_=e};goog.inherits(ol.ImageCanvas,ol.ImageBase);ol.ImageCanvas.prototype.getImageElement=function(a){return this.canvas_};ol.ImageTile=function(a,b,c,d,e){ol.Tile.call(this,a,b);this.src_=c;this.image_=new Image;goog.isNull(d)||(this.image_.crossOrigin=d);this.imageByContext_={};this.imageListenerKeys_=null;this.tileLoadFunction_=e};goog.inherits(ol.ImageTile,ol.Tile);
|
|
ol.ImageTile.prototype.getImage=function(a){if(goog.isDef(a)){var b=goog.getUid(a);if(b in this.imageByContext_)return this.imageByContext_[b];a=goog.object.isEmpty(this.imageByContext_)?this.image_:this.image_.cloneNode(!1);return this.imageByContext_[b]=a}return this.image_};ol.ImageTile.prototype.getKey=function(){return this.src_};ol.ImageTile.prototype.handleImageError_=function(){this.state=ol.TileState.ERROR;this.unlistenImage_();this.dispatchChangeEvent()};
|
|
ol.ImageTile.prototype.handleImageLoad_=function(){goog.isDef(this.image_.naturalWidth)||(this.image_.naturalWidth=this.image_.width,this.image_.naturalHeight=this.image_.height);this.state=this.image_.naturalWidth&&this.image_.naturalHeight?ol.TileState.LOADED:ol.TileState.EMPTY;this.unlistenImage_();this.dispatchChangeEvent()};
|
|
ol.ImageTile.prototype.load=function(){this.state==ol.TileState.IDLE&&(this.state=ol.TileState.LOADING,this.imageListenerKeys_=[goog.events.listenOnce(this.image_,goog.events.EventType.ERROR,this.handleImageError_,!1,this),goog.events.listenOnce(this.image_,goog.events.EventType.LOAD,this.handleImageLoad_,!1,this)],this.tileLoadFunction_(this,this.src_))};
|
|
ol.ImageTile.prototype.unlistenImage_=function(){goog.array.forEach(this.imageListenerKeys_,goog.events.unlistenByKey);this.imageListenerKeys_=null};ol.ImageUrlFunction={};ol.ImageUrlFunction.createFromParamsFunction=function(a,b,c){return function(d,e,f){return c(a,b,d,e,f)}};ol.ImageUrlFunction.nullImageUrlFunction=function(a,b){};ol.OverlayProperty={ELEMENT:"element",MAP:"map",POSITION:"position",POSITIONING:"positioning"};ol.OverlayPositioning={BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_CENTER:"center-center",CENTER_RIGHT:"center-right",TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right"};
|
|
ol.Overlay=function(a){ol.Object.call(this);this.insertFirst_=goog.isDef(a.insertFirst)?a.insertFirst:!0;this.stopEvent_=goog.isDef(a.stopEvent)?a.stopEvent:!0;this.element_=goog.dom.createElement(goog.dom.TagName.DIV);this.element_.style.position="absolute";this.rendered_={bottom_:"",left_:"",right_:"",top_:"",visible:!0};this.mapPostrenderListenerKey_=null;goog.events.listen(this,ol.Object.getChangeEventType(ol.OverlayProperty.ELEMENT),this.handleElementChanged,!1,this);goog.events.listen(this,
|
|
ol.Object.getChangeEventType(ol.OverlayProperty.MAP),this.handleMapChanged,!1,this);goog.events.listen(this,ol.Object.getChangeEventType(ol.OverlayProperty.POSITION),this.handlePositionChanged,!1,this);goog.events.listen(this,ol.Object.getChangeEventType(ol.OverlayProperty.POSITIONING),this.handlePositioningChanged,!1,this);goog.isDef(a.element)&&this.setElement(a.element);goog.isDef(a.position)&&this.setPosition(a.position);goog.isDef(a.positioning)&&this.setPositioning(a.positioning)};
|
|
goog.inherits(ol.Overlay,ol.Object);ol.Overlay.prototype.getElement=function(){return this.get(ol.OverlayProperty.ELEMENT)};goog.exportProperty(ol.Overlay.prototype,"getElement",ol.Overlay.prototype.getElement);ol.Overlay.prototype.getMap=function(){return this.get(ol.OverlayProperty.MAP)};goog.exportProperty(ol.Overlay.prototype,"getMap",ol.Overlay.prototype.getMap);ol.Overlay.prototype.getPosition=function(){return this.get(ol.OverlayProperty.POSITION)};
|
|
goog.exportProperty(ol.Overlay.prototype,"getPosition",ol.Overlay.prototype.getPosition);ol.Overlay.prototype.getPositioning=function(){return this.get(ol.OverlayProperty.POSITIONING)};goog.exportProperty(ol.Overlay.prototype,"getPositioning",ol.Overlay.prototype.getPositioning);ol.Overlay.prototype.handleElementChanged=function(){goog.dom.removeChildren(this.element_);var a=this.getElement();goog.isDefAndNotNull(a)&&goog.dom.append(this.element_,a)};
|
|
ol.Overlay.prototype.handleMapChanged=function(){goog.isNull(this.mapPostrenderListenerKey_)||(goog.dom.removeNode(this.element_),goog.events.unlistenByKey(this.mapPostrenderListenerKey_),this.mapPostrenderListenerKey_=null);var a=this.getMap();goog.isDefAndNotNull(a)&&(this.mapPostrenderListenerKey_=goog.events.listen(a,ol.MapEventType.POSTRENDER,this.handleMapPostrender,!1,this),this.updatePixelPosition_(),a=this.stopEvent_?a.getOverlayContainerStopEvent():a.getOverlayContainer(),this.insertFirst_?
|
|
goog.dom.insertChildAt(a,this.element_,0):goog.dom.append(a,this.element_))};ol.Overlay.prototype.handleMapPostrender=function(){this.updatePixelPosition_()};ol.Overlay.prototype.handlePositionChanged=function(){this.updatePixelPosition_()};ol.Overlay.prototype.handlePositioningChanged=function(){this.updatePixelPosition_()};ol.Overlay.prototype.setElement=function(a){this.set(ol.OverlayProperty.ELEMENT,a)};goog.exportProperty(ol.Overlay.prototype,"setElement",ol.Overlay.prototype.setElement);
|
|
ol.Overlay.prototype.setMap=function(a){this.set(ol.OverlayProperty.MAP,a)};goog.exportProperty(ol.Overlay.prototype,"setMap",ol.Overlay.prototype.setMap);ol.Overlay.prototype.setPosition=function(a){this.set(ol.OverlayProperty.POSITION,a)};goog.exportProperty(ol.Overlay.prototype,"setPosition",ol.Overlay.prototype.setPosition);ol.Overlay.prototype.setPositioning=function(a){this.set(ol.OverlayProperty.POSITIONING,a)};goog.exportProperty(ol.Overlay.prototype,"setPositioning",ol.Overlay.prototype.setPositioning);
|
|
ol.Overlay.prototype.updatePixelPosition_=function(){var a=this.getMap(),b=this.getPosition();if(goog.isDef(a)&&a.isRendered()&&goog.isDef(b)){var b=a.getPixelFromCoordinate(b),c=a.getSize(),a=this.element_.style,d=this.getPositioning();if(d==ol.OverlayPositioning.BOTTOM_RIGHT||d==ol.OverlayPositioning.CENTER_RIGHT||d==ol.OverlayPositioning.TOP_RIGHT){""!==this.rendered_.left_&&(this.rendered_.left_=a.left="");var e=Math.round(c[0]-b[0])+"px";this.rendered_.right_!=e&&(this.rendered_.right_=a.right=
|
|
e)}else{""!==this.rendered_.right_&&(this.rendered_.right_=a.right="");e=0;if(d==ol.OverlayPositioning.BOTTOM_CENTER||d==ol.OverlayPositioning.CENTER_CENTER||d==ol.OverlayPositioning.TOP_CENTER)e=goog.style.getSize(this.element_).width/2;e=Math.round(b[0]-e)+"px";this.rendered_.left_!=e&&(this.rendered_.left_=a.left=e)}if(d==ol.OverlayPositioning.BOTTOM_LEFT||d==ol.OverlayPositioning.BOTTOM_CENTER||d==ol.OverlayPositioning.BOTTOM_RIGHT)""!==this.rendered_.top_&&(this.rendered_.top_=a.top=""),b=Math.round(c[1]-
|
|
b[1])+"px",this.rendered_.bottom_!=b&&(this.rendered_.bottom_=a.bottom=b);else{""!==this.rendered_.bottom_&&(this.rendered_.bottom_=a.bottom="");c=0;if(d==ol.OverlayPositioning.CENTER_LEFT||d==ol.OverlayPositioning.CENTER_CENTER||d==ol.OverlayPositioning.CENTER_RIGHT)c=goog.style.getSize(this.element_).height/2;b=Math.round(b[1]-c)+"px";this.rendered_.top_!=b&&(this.rendered_.top_=a.top=b)}this.rendered_.visible||(goog.style.setElementShown(this.element_,!0),this.rendered_.visible=!0)}else this.rendered_.visible&&
|
|
(goog.style.setElementShown(this.element_,!1),this.rendered_.visible=!1)};ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK=2048;ol.TileCache=function(a){ol.structs.LRUCache.call(this);this.highWaterMark_=goog.isDef(a)?a:ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK};goog.inherits(ol.TileCache,ol.structs.LRUCache);ol.TileCache.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark_};ol.TileCache.prototype.expireCache=function(a){for(var b,c;this.canExpireCache()&&!(b=this.peekLast(),c=b.tileCoord.z.toString(),c in a&&a[c].contains(b.tileCoord));)this.pop()};
|
|
ol.TileCache.prototype.pruneTileRange=function(a){for(var b=this.getCount(),c;b--;)c=this.peekLastKey(),a.contains(ol.TileCoord.createFromString(c))?this.pop():this.get(c)};ol.TileUrlFunction={};ol.TileUrlFunction.createFromTemplate=function(a){return function(b,c,d){return goog.isNull(b)?void 0:a.replace("{z}",b.z.toString()).replace("{x}",b.x.toString()).replace("{y}",b.y.toString())}};ol.TileUrlFunction.createFromTemplates=function(a){return ol.TileUrlFunction.createFromTileUrlFunctions(goog.array.map(a,ol.TileUrlFunction.createFromTemplate))};
|
|
ol.TileUrlFunction.createFromTileUrlFunctions=function(a){return 1===a.length?a[0]:function(b,c,d){if(!goog.isNull(b)){var e=goog.math.modulo(b.hash(),a.length);return a[e].call(this,b,c,d)}}};ol.TileUrlFunction.nullTileUrlFunction=function(a,b,c){};ol.TileUrlFunction.withTileCoordTransform=function(a,b){var c=new ol.TileCoord(0,0,0);return function(d,e,f){return goog.isNull(d)?void 0:b.call(this,a.call(this,d,f,c),e,f)}};
|
|
ol.TileUrlFunction.expandUrl=function(a){var b=[],c=/\{(\d)-(\d)\}/.exec(a)||/\{([a-z])-([a-z])\}/.exec(a);if(c)for(var d=c[1].charCodeAt(0),e=c[2].charCodeAt(0);d<=e;++d)b.push(a.replace(c[0],String.fromCharCode(d)));else b.push(a);return b};ol.binary={};ol.binary.Buffer=function(a){this.data_=a};ol.binary.Buffer.prototype.getReader=function(){var a=this.data_;if(ol.BrowserFeature.HAS_ARRAY_BUFFER){var b;if(a instanceof ArrayBuffer)b=a;else if(goog.isString(a)){b=new ArrayBuffer(a.length);var c=new Uint8Array(b),d,e;d=0;for(e=a.length;d<e;++d)c[d]=a.charCodeAt(d)}else return null;return new ol.binary.ArrayBufferReader(b)}return new ol.binary.ArrayReader((new VBArray(a)).toArray())};ol.binary.IReader=function(){};
|
|
ol.binary.IReader.prototype.atEOF=function(){};ol.binary.IReader.prototype.readByte=function(){};ol.binary.ArrayBufferReader=function(a){this.uint8View_=new Uint8Array(a);this.length_=this.uint8View_.length;this.offset_=0};ol.binary.ArrayBufferReader.prototype.atEOF=function(){return this.offset_==this.length_};ol.binary.ArrayBufferReader.prototype.readByte=function(){return this.offset_<this.length_?this.uint8View_[this.offset_++]:0};
|
|
ol.binary.ArrayReader=function(a){this.array_=a;this.length_=a.length;this.offset_=0};ol.binary.ArrayReader.prototype.atEOF=function(){return this.offset_==this.length_};ol.binary.ArrayReader.prototype.readByte=function(){return this.offset_<this.length_?this.array_[this.offset_++]:0};var googx={dom:{}};googx.dom.fullscreen={};googx.dom.fullscreen.EventType={CHANGE:function(){return goog.userAgent.WEBKIT?"webkitfullscreenchange":goog.userAgent.GECKO?"mozfullscreenchange":goog.userAgent.IE?"MSFullscreenChange":"fullscreenchange"}()};googx.dom.fullscreen.isSupported=function(a){a=googx.dom.fullscreen.getDocument_(a);var b=a.body;return!!(b.webkitRequestFullscreen||b.mozRequestFullScreen&&a.mozFullScreenEnabled||b.msRequestFullscreen&&a.msFullscreenEnabled||b.requestFullscreen&&a.fullscreenEnabled)};
|
|
googx.dom.fullscreen.requestFullScreen=function(a){a.webkitRequestFullscreen?a.webkitRequestFullscreen():a.mozRequestFullScreen?a.mozRequestFullScreen():a.msRequestFullscreen?a.msRequestFullscreen():a.requestFullscreen&&a.requestFullscreen()};googx.dom.fullscreen.requestFullScreenWithKeys=function(a){a.mozRequestFullScreenWithKeys?a.mozRequestFullScreenWithKeys():a.webkitRequestFullscreen?a.webkitRequestFullscreen():googx.dom.fullscreen.requestFullScreen(a)};
|
|
googx.dom.fullscreen.exitFullScreen=function(a){a=googx.dom.fullscreen.getDocument_(a);a.webkitCancelFullScreen?a.webkitCancelFullScreen():a.mozCancelFullScreen?a.mozCancelFullScreen():a.msExitFullscreen?a.msExitFullscreen():a.exitFullscreen&&a.exitFullscreen()};googx.dom.fullscreen.isFullScreen=function(a){a=googx.dom.fullscreen.getDocument_(a);return!!(a.webkitIsFullScreen||a.mozFullScreen||a.msFullscreenElement||a.fullscreenElement)};
|
|
googx.dom.fullscreen.getDocument_=function(a){return a?a.getDocument():goog.dom.getDomHelper().getDocument()};ol.control.FullScreen=function(a){a=goog.isDef(a)?a:{};this.cssClassName_=goog.isDef(a.className)?a.className:"ol-full-screen";var b=goog.isDef(a.tipLabel)?a.tipLabel:"Toggle full-screen",b=goog.dom.createDom(goog.dom.TagName.SPAN,{role:"tooltip"},b),c=goog.dom.createDom(goog.dom.TagName.BUTTON,{"class":this.cssClassName_+"-"+googx.dom.fullscreen.isFullScreen()+" ol-has-tooltip"});goog.dom.appendChild(c,b);goog.events.listen(c,[goog.events.EventType.CLICK,goog.events.EventType.TOUCHEND],this.handleClick_,
|
|
!1,this);goog.events.listen(c,[goog.events.EventType.MOUSEOUT,goog.events.EventType.FOCUSOUT],function(){this.blur()},!1);goog.events.listen(goog.global.document,googx.dom.fullscreen.EventType.CHANGE,this.handleFullScreenChange_,!1,this);b=goog.dom.createDom(goog.dom.TagName.DIV,{"class":this.cssClassName_+" "+ol.css.CLASS_UNSELECTABLE+" "+(googx.dom.fullscreen.isSupported()?"":ol.css.CLASS_UNSUPPORTED)},c);ol.control.Control.call(this,{element:b,target:a.target});this.keys_=goog.isDef(a.keys)?a.keys:
|
|
!1};goog.inherits(ol.control.FullScreen,ol.control.Control);ol.control.FullScreen.prototype.handleClick_=function(a){googx.dom.fullscreen.isSupported()&&(a.preventDefault(),a=this.getMap(),goog.isNull(a)||(googx.dom.fullscreen.isFullScreen()?googx.dom.fullscreen.exitFullScreen():(a=a.getTarget(),a=goog.dom.getElement(a),this.keys_?googx.dom.fullscreen.requestFullScreenWithKeys(a):googx.dom.fullscreen.requestFullScreen(a))))};
|
|
ol.control.FullScreen.prototype.handleFullScreenChange_=function(){var a=this.cssClassName_+"-true",b=this.cssClassName_+"-false",c=goog.dom.getFirstElementChild(this.element),d=this.getMap();googx.dom.fullscreen.isFullScreen()?goog.dom.classes.swap(c,b,a):goog.dom.classes.swap(c,a,b);goog.isNull(d)||d.updateSize()};ol.control.MousePositionProperty={PROJECTION:"projection",COORDINATE_FORMAT:"coordinateFormat"};
|
|
ol.control.MousePosition=function(a){a=goog.isDef(a)?a:{};var b=goog.isDef(a.className)?a.className:"ol-mouse-position",b=goog.dom.createDom(goog.dom.TagName.DIV,{"class":b});ol.control.Control.call(this,{element:b,target:a.target});goog.events.listen(this,ol.Object.getChangeEventType(ol.control.MousePositionProperty.PROJECTION),this.handleProjectionChanged_,!1,this);goog.isDef(a.coordinateFormat)&&this.setCoordinateFormat(a.coordinateFormat);goog.isDef(a.projection)&&this.setProjection(ol.proj.get(a.projection));
|
|
this.undefinedHTML_=goog.isDef(a.undefinedHTML)?a.undefinedHTML:"";this.renderedHTML_=b.innerHTML;this.lastMouseMovePixel_=this.transform_=this.mapProjection_=null};goog.inherits(ol.control.MousePosition,ol.control.Control);ol.control.MousePosition.prototype.handleMapPostrender=function(a){a=a.frameState;goog.isNull(a)?this.mapProjection_=null:this.mapProjection_!=a.view2DState.projection&&(this.mapProjection_=a.view2DState.projection,this.transform_=null);this.updateHTML_(this.lastMouseMovePixel_)};
|
|
ol.control.MousePosition.prototype.handleProjectionChanged_=function(){this.transform_=null};ol.control.MousePosition.prototype.getCoordinateFormat=function(){return this.get(ol.control.MousePositionProperty.COORDINATE_FORMAT)};goog.exportProperty(ol.control.MousePosition.prototype,"getCoordinateFormat",ol.control.MousePosition.prototype.getCoordinateFormat);ol.control.MousePosition.prototype.getProjection=function(){return this.get(ol.control.MousePositionProperty.PROJECTION)};
|
|
goog.exportProperty(ol.control.MousePosition.prototype,"getProjection",ol.control.MousePosition.prototype.getProjection);ol.control.MousePosition.prototype.handleMouseMove=function(a){var b=this.getMap();a=goog.style.getRelativePosition(a,b.getViewport());this.lastMouseMovePixel_=[a.x,a.y];this.updateHTML_(this.lastMouseMovePixel_)};ol.control.MousePosition.prototype.handleMouseOut=function(a){this.updateHTML_(null);this.lastMouseMovePixel_=null};
|
|
ol.control.MousePosition.prototype.setMap=function(a){ol.control.MousePosition.superClass_.setMap.call(this,a);goog.isNull(a)||(a=a.getViewport(),this.listenerKeys.push(goog.events.listen(a,goog.events.EventType.MOUSEMOVE,this.handleMouseMove,!1,this),goog.events.listen(a,goog.events.EventType.MOUSEOUT,this.handleMouseOut,!1,this)))};ol.control.MousePosition.prototype.setCoordinateFormat=function(a){this.set(ol.control.MousePositionProperty.COORDINATE_FORMAT,a)};
|
|
goog.exportProperty(ol.control.MousePosition.prototype,"setCoordinateFormat",ol.control.MousePosition.prototype.setCoordinateFormat);ol.control.MousePosition.prototype.setProjection=function(a){this.set(ol.control.MousePositionProperty.PROJECTION,a)};goog.exportProperty(ol.control.MousePosition.prototype,"setProjection",ol.control.MousePosition.prototype.setProjection);
|
|
ol.control.MousePosition.prototype.updateHTML_=function(a){var b=this.undefinedHTML_;if(!goog.isNull(a)&&!goog.isNull(this.mapProjection_)){if(goog.isNull(this.transform_)){var c=this.getProjection();goog.isDef(c)?this.transform_=ol.proj.getTransformFromProjections(this.mapProjection_,c):this.transform_=ol.proj.identityTransform}a=this.getMap().getCoordinateFromPixel(a);goog.isNull(a)||(this.transform_(a,a),b=this.getCoordinateFormat(),b=goog.isDef(b)?b(a):a.toString())}goog.isDef(this.renderedHTML_)&&
|
|
b==this.renderedHTML_||(this.renderedHTML_=this.element.innerHTML=b)};ol.control.ScaleLineProperty={UNITS:"units"};ol.control.ScaleLineUnits={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"};
|
|
ol.control.ScaleLine=function(a){a=a||{};var b=goog.isDef(a.className)?a.className:"ol-scale-line";this.innerElement_=goog.dom.createDom(goog.dom.TagName.DIV,{"class":b+"-inner"});this.element_=goog.dom.createDom(goog.dom.TagName.DIV,{"class":b+" "+ol.css.CLASS_UNSELECTABLE},this.innerElement_);this.view2DState_=null;this.minWidth_=goog.isDef(a.minWidth)?a.minWidth:64;this.renderedVisible_=!1;this.renderedWidth_=void 0;this.renderedHTML_="";this.toEPSG4326_=null;ol.control.Control.call(this,{element:this.element_,
|
|
target:a.target});goog.events.listen(this,ol.Object.getChangeEventType(ol.control.ScaleLineProperty.UNITS),this.handleUnitsChanged_,!1,this);this.setUnits(a.units||ol.control.ScaleLineUnits.METRIC)};goog.inherits(ol.control.ScaleLine,ol.control.Control);ol.control.ScaleLine.LEADING_DIGITS=[1,2,5];ol.control.ScaleLine.prototype.getUnits=function(){return this.get(ol.control.ScaleLineProperty.UNITS)};goog.exportProperty(ol.control.ScaleLine.prototype,"getUnits",ol.control.ScaleLine.prototype.getUnits);
|
|
ol.control.ScaleLine.prototype.handleMapPostrender=function(a){a=a.frameState;goog.isNull(a)?this.view2DState_=null:this.view2DState_=a.view2DState;this.updateElement_()};ol.control.ScaleLine.prototype.handleUnitsChanged_=function(){this.updateElement_()};ol.control.ScaleLine.prototype.setUnits=function(a){this.set(ol.control.ScaleLineProperty.UNITS,a)};goog.exportProperty(ol.control.ScaleLine.prototype,"setUnits",ol.control.ScaleLine.prototype.setUnits);
|
|
ol.control.ScaleLine.prototype.updateElement_=function(){var a=this.view2DState_;if(goog.isNull(a))this.renderedVisible_&&(goog.style.setElementShown(this.element_,!1),this.renderedVisible_=!1);else{var b=a.center,c=a.projection,a=c.getPointResolution(a.resolution,b),d=c.getUnits(),e=this.getUnits();d!=ol.proj.Units.DEGREES||e!=ol.control.ScaleLineUnits.METRIC&&e!=ol.control.ScaleLineUnits.IMPERIAL?d!=ol.proj.Units.FEET&&d!=ol.proj.Units.METERS||e!=ol.control.ScaleLineUnits.DEGREES?this.toEPSG4326_=
|
|
null:(goog.isNull(this.toEPSG4326_)&&(this.toEPSG4326_=ol.proj.getTransformFromProjections(c,ol.proj.get("EPSG:4326"))),b=Math.cos(goog.math.toRadians(this.toEPSG4326_(b)[1])),c=ol.sphere.NORMAL.radius,d==ol.proj.Units.FEET&&(c/=0.3048),a*=180/(Math.PI*b*c)):(this.toEPSG4326_=null,b=Math.cos(goog.math.toRadians(b[1])),a*=Math.PI*b*ol.sphere.NORMAL.radius/180);b=this.minWidth_*a;d="";e==ol.control.ScaleLineUnits.DEGREES?b<1/60?(d="\u2033",a*=3600):1>b?(d="\u2032",a*=60):d="\u00b0":e==ol.control.ScaleLineUnits.IMPERIAL?
|
|
0.9144>b?(d="in",a/=0.0254):1609.344>b?(d="ft",a/=0.3048):(d="mi",a/=1609.344):e==ol.control.ScaleLineUnits.NAUTICAL?(a/=1852,d="nm"):e==ol.control.ScaleLineUnits.METRIC?1>b?(d="mm",a*=1E3):1E3>b?d="m":(d="km",a/=1E3):e==ol.control.ScaleLineUnits.US&&(0.9144>b?(d="in",a*=39.37):1609.344>b?(d="ft",a/=0.30480061):(d="mi",a/=1609.3472));for(var e=3*Math.floor(Math.log(this.minWidth_*a)/Math.log(10)),f,g;;){f=ol.control.ScaleLine.LEADING_DIGITS[e%3]*Math.pow(10,Math.floor(e/3));g=Math.round(f/a);if(g>=
|
|
this.minWidth_)break;++e}f+=d;this.renderedHTML_!=f&&(this.renderedHTML_=this.innerElement_.innerHTML=f);this.renderedWidth_!=g&&(this.innerElement_.style.width=g+"px",this.renderedWidth_=g);this.renderedVisible_||(goog.style.setElementShown(this.element_,!0),this.renderedVisible_=!0)}};goog.events.EventHandler=function(a){goog.Disposable.call(this);this.handler_=a;this.keys_={}};goog.inherits(goog.events.EventHandler,goog.Disposable);goog.events.EventHandler.typeArray_=[];goog.events.EventHandler.prototype.listen=function(a,b,c,d,e){goog.isArray(b)||(goog.events.EventHandler.typeArray_[0]=b,b=goog.events.EventHandler.typeArray_);for(var f=0;f<b.length;f++){var g=goog.events.listen(a,b[f],c||this,d||!1,e||this.handler_||this);if(goog.DEBUG&&!g)break;this.keys_[g.key]=g}return this};
|
|
goog.events.EventHandler.prototype.listenOnce=function(a,b,c,d,e){if(goog.isArray(b))for(var f=0;f<b.length;f++)this.listenOnce(a,b[f],c,d,e);else a=goog.events.listenOnce(a,b,c||this,d,e||this.handler_||this),this.keys_[a.key]=a;return this};goog.events.EventHandler.prototype.listenWithWrapper=function(a,b,c,d,e){b.listen(a,c,d,e||this.handler_||this,this);return this};
|
|
goog.events.EventHandler.prototype.getListenerCount=function(){var a=0,b;for(b in this.keys_)Object.prototype.hasOwnProperty.call(this.keys_,b)&&a++;return a};goog.events.EventHandler.prototype.unlisten=function(a,b,c,d,e){if(goog.isArray(b))for(var f=0;f<b.length;f++)this.unlisten(a,b[f],c,d,e);else if(a=goog.events.getListener(a,b,c||this,d,e||this.handler_||this))goog.events.unlistenByKey(a),delete this.keys_[a.key];return this};
|
|
goog.events.EventHandler.prototype.unlistenWithWrapper=function(a,b,c,d,e){b.unlisten(a,c,d,e||this.handler_||this,this);return this};goog.events.EventHandler.prototype.removeAll=function(){goog.object.forEach(this.keys_,goog.events.unlistenByKey);this.keys_={}};goog.events.EventHandler.prototype.disposeInternal=function(){goog.events.EventHandler.superClass_.disposeInternal.call(this);this.removeAll()};
|
|
goog.events.EventHandler.prototype.handleEvent=function(a){throw Error("EventHandler.handleEvent not implemented");};goog.style.bidi={};goog.style.bidi.getScrollLeft=function(a){var b=goog.style.isRightToLeft(a);return b&&goog.userAgent.GECKO?-a.scrollLeft:!b||goog.userAgent.IE&&goog.userAgent.isVersionOrHigher("8")||"visible"==goog.style.getComputedOverflowX(a)?a.scrollLeft:a.scrollWidth-a.clientWidth-a.scrollLeft};
|
|
goog.style.bidi.getOffsetStart=function(a){var b=a.offsetLeft,c=a.offsetParent;c||"fixed"!=goog.style.getComputedPosition(a)||(c=goog.dom.getOwnerDocument(a).documentElement);if(!c)return b;if(goog.userAgent.GECKO)var d=goog.style.getBorderBox(c),b=b+d.left;else goog.userAgent.isDocumentModeOrHigher(8)&&(d=goog.style.getBorderBox(c),b-=d.left);return goog.style.isRightToLeft(c)?c.clientWidth-(b+a.offsetWidth):b};
|
|
goog.style.bidi.setScrollOffset=function(a,b){b=Math.max(b,0);goog.style.isRightToLeft(a)?goog.userAgent.GECKO?a.scrollLeft=-b:goog.userAgent.IE&&goog.userAgent.isVersionOrHigher("8")?a.scrollLeft=b:a.scrollLeft=a.scrollWidth-b-a.clientWidth:a.scrollLeft=b};goog.style.bidi.setPosition=function(a,b,c,d){goog.isNull(c)||(a.style.top=c+"px");d?(a.style.right=b+"px",a.style.left=""):(a.style.left=b+"px",a.style.right="")};goog.fx.Dragger=function(a,b,c){goog.events.EventTarget.call(this);this.target=a;this.handle=b||a;this.limits=c||new goog.math.Rect(NaN,NaN,NaN,NaN);this.document_=goog.dom.getOwnerDocument(a);this.eventHandler_=new goog.events.EventHandler(this);this.registerDisposable(this.eventHandler_);goog.events.listen(this.handle,[goog.events.EventType.TOUCHSTART,goog.events.EventType.MOUSEDOWN],this.startDrag,!1,this)};goog.inherits(goog.fx.Dragger,goog.events.EventTarget);
|
|
goog.fx.Dragger.HAS_SET_CAPTURE_=goog.userAgent.IE||goog.userAgent.GECKO&&goog.userAgent.isVersionOrHigher("1.9.3");goog.fx.Dragger.EventType={EARLY_CANCEL:"earlycancel",START:"start",BEFOREDRAG:"beforedrag",DRAG:"drag",END:"end"};goog.fx.Dragger.prototype.clientX=0;goog.fx.Dragger.prototype.clientY=0;goog.fx.Dragger.prototype.screenX=0;goog.fx.Dragger.prototype.screenY=0;goog.fx.Dragger.prototype.startX=0;goog.fx.Dragger.prototype.startY=0;goog.fx.Dragger.prototype.deltaX=0;
|
|
goog.fx.Dragger.prototype.deltaY=0;goog.fx.Dragger.prototype.enabled_=!0;goog.fx.Dragger.prototype.dragging_=!1;goog.fx.Dragger.prototype.hysteresisDistanceSquared_=0;goog.fx.Dragger.prototype.mouseDownTime_=0;goog.fx.Dragger.prototype.ieDragStartCancellingOn_=!1;goog.fx.Dragger.prototype.useRightPositioningForRtl_=!1;goog.fx.Dragger.prototype.enableRightPositioningForRtl=function(a){this.useRightPositioningForRtl_=a};goog.fx.Dragger.prototype.getHandler=function(){return this.eventHandler_};
|
|
goog.fx.Dragger.prototype.setLimits=function(a){this.limits=a||new goog.math.Rect(NaN,NaN,NaN,NaN)};goog.fx.Dragger.prototype.setHysteresis=function(a){this.hysteresisDistanceSquared_=Math.pow(a,2)};goog.fx.Dragger.prototype.getHysteresis=function(){return Math.sqrt(this.hysteresisDistanceSquared_)};goog.fx.Dragger.prototype.setScrollTarget=function(a){this.scrollTarget_=a};goog.fx.Dragger.prototype.setCancelIeDragStart=function(a){this.ieDragStartCancellingOn_=a};
|
|
goog.fx.Dragger.prototype.getEnabled=function(){return this.enabled_};goog.fx.Dragger.prototype.setEnabled=function(a){this.enabled_=a};goog.fx.Dragger.prototype.disposeInternal=function(){goog.fx.Dragger.superClass_.disposeInternal.call(this);goog.events.unlisten(this.handle,[goog.events.EventType.TOUCHSTART,goog.events.EventType.MOUSEDOWN],this.startDrag,!1,this);this.cleanUpAfterDragging_();this.handle=this.target=null};
|
|
goog.fx.Dragger.prototype.isRightToLeft_=function(){goog.isDef(this.rightToLeft_)||(this.rightToLeft_=goog.style.isRightToLeft(this.target));return this.rightToLeft_};
|
|
goog.fx.Dragger.prototype.startDrag=function(a){var b=a.type==goog.events.EventType.MOUSEDOWN;if(!this.enabled_||this.dragging_||b&&!a.isMouseActionButton())this.dispatchEvent(goog.fx.Dragger.EventType.EARLY_CANCEL);else{this.maybeReinitTouchEvent_(a);if(0==this.hysteresisDistanceSquared_)if(this.fireDragStart_(a))this.dragging_=!0,a.preventDefault();else return;else a.preventDefault();this.setupDragHandlers();this.clientX=this.startX=a.clientX;this.clientY=this.startY=a.clientY;this.screenX=a.screenX;
|
|
this.screenY=a.screenY;this.deltaX=this.useRightPositioningForRtl_?goog.style.bidi.getOffsetStart(this.target):this.target.offsetLeft;this.deltaY=this.target.offsetTop;this.pageScroll=goog.dom.getDomHelper(this.document_).getDocumentScroll();this.mouseDownTime_=goog.now()}};
|
|
goog.fx.Dragger.prototype.setupDragHandlers=function(){var a=this.document_,b=a.documentElement,c=!goog.fx.Dragger.HAS_SET_CAPTURE_;this.eventHandler_.listen(a,[goog.events.EventType.TOUCHMOVE,goog.events.EventType.MOUSEMOVE],this.handleMove_,c);this.eventHandler_.listen(a,[goog.events.EventType.TOUCHEND,goog.events.EventType.MOUSEUP],this.endDrag,c);goog.fx.Dragger.HAS_SET_CAPTURE_?(b.setCapture(!1),this.eventHandler_.listen(b,goog.events.EventType.LOSECAPTURE,this.endDrag)):this.eventHandler_.listen(goog.dom.getWindow(a),
|
|
goog.events.EventType.BLUR,this.endDrag);goog.userAgent.IE&&this.ieDragStartCancellingOn_&&this.eventHandler_.listen(a,goog.events.EventType.DRAGSTART,goog.events.Event.preventDefault);this.scrollTarget_&&this.eventHandler_.listen(this.scrollTarget_,goog.events.EventType.SCROLL,this.onScroll_,c)};goog.fx.Dragger.prototype.fireDragStart_=function(a){return this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.START,this,a.clientX,a.clientY,a))};
|
|
goog.fx.Dragger.prototype.cleanUpAfterDragging_=function(){this.eventHandler_.removeAll();goog.fx.Dragger.HAS_SET_CAPTURE_&&this.document_.releaseCapture()};goog.fx.Dragger.prototype.endDrag=function(a,b){this.cleanUpAfterDragging_();if(this.dragging_){this.maybeReinitTouchEvent_(a);this.dragging_=!1;var c=this.limitX(this.deltaX),d=this.limitY(this.deltaY);this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.END,this,a.clientX,a.clientY,a,c,d,b||a.type==goog.events.EventType.TOUCHCANCEL))}else this.dispatchEvent(goog.fx.Dragger.EventType.EARLY_CANCEL)};
|
|
goog.fx.Dragger.prototype.endDragCancel=function(a){this.endDrag(a,!0)};goog.fx.Dragger.prototype.maybeReinitTouchEvent_=function(a){var b=a.type;b==goog.events.EventType.TOUCHSTART||b==goog.events.EventType.TOUCHMOVE?a.init(a.getBrowserEvent().targetTouches[0],a.currentTarget):b!=goog.events.EventType.TOUCHEND&&b!=goog.events.EventType.TOUCHCANCEL||a.init(a.getBrowserEvent().changedTouches[0],a.currentTarget)};
|
|
goog.fx.Dragger.prototype.handleMove_=function(a){if(this.enabled_){this.maybeReinitTouchEvent_(a);var b=(this.useRightPositioningForRtl_&&this.isRightToLeft_()?-1:1)*(a.clientX-this.clientX),c=a.clientY-this.clientY;this.clientX=a.clientX;this.clientY=a.clientY;this.screenX=a.screenX;this.screenY=a.screenY;if(!this.dragging_){var d=this.startX-this.clientX,e=this.startY-this.clientY;if(d*d+e*e>this.hysteresisDistanceSquared_)if(this.fireDragStart_(a))this.dragging_=!0;else{this.isDisposed()||this.endDrag(a);
|
|
return}}c=this.calculatePosition_(b,c);b=c.x;c=c.y;this.dragging_&&this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.BEFOREDRAG,this,a.clientX,a.clientY,a,b,c))&&(this.doDrag(a,b,c,!1),a.preventDefault())}};
|
|
goog.fx.Dragger.prototype.calculatePosition_=function(a,b){var c=goog.dom.getDomHelper(this.document_).getDocumentScroll();a+=c.x-this.pageScroll.x;b+=c.y-this.pageScroll.y;this.pageScroll=c;this.deltaX+=a;this.deltaY+=b;var c=this.limitX(this.deltaX),d=this.limitY(this.deltaY);return new goog.math.Coordinate(c,d)};goog.fx.Dragger.prototype.onScroll_=function(a){var b=this.calculatePosition_(0,0);a.clientX=this.clientX;a.clientY=this.clientY;this.doDrag(a,b.x,b.y,!0)};
|
|
goog.fx.Dragger.prototype.doDrag=function(a,b,c,d){this.defaultAction(b,c);this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.DRAG,this,a.clientX,a.clientY,a,b,c))};goog.fx.Dragger.prototype.limitX=function(a){var b=this.limits,c=isNaN(b.left)?null:b.left,b=isNaN(b.width)?0:b.width;return Math.min(null!=c?c+b:Infinity,Math.max(null!=c?c:-Infinity,a))};
|
|
goog.fx.Dragger.prototype.limitY=function(a){var b=this.limits,c=isNaN(b.top)?null:b.top,b=isNaN(b.height)?0:b.height;return Math.min(null!=c?c+b:Infinity,Math.max(null!=c?c:-Infinity,a))};goog.fx.Dragger.prototype.defaultAction=function(a,b){this.useRightPositioningForRtl_&&this.isRightToLeft_()?this.target.style.right=a+"px":this.target.style.left=a+"px";this.target.style.top=b+"px"};goog.fx.Dragger.prototype.isDragging=function(){return this.dragging_};
|
|
goog.fx.DragEvent=function(a,b,c,d,e,f,g,h){goog.events.Event.call(this,a);this.clientX=c;this.clientY=d;this.browserEvent=e;this.left=goog.isDef(f)?f:b.deltaX;this.top=goog.isDef(g)?g:b.deltaY;this.dragger=b;this.dragCanceled=!!h};goog.inherits(goog.fx.DragEvent,goog.events.Event);ol.control.ZOOMSLIDER_ANIMATION_DURATION=200;
|
|
ol.control.ZoomSlider=function(a){a=goog.isDef(a)?a:{};this.currentResolution_=void 0;this.direction_=ol.control.ZoomSlider.direction.VERTICAL;this.sliderInitialized_=!1;var b=goog.isDef(a.className)?a.className:"ol-zoomslider";a=goog.dom.createDom(goog.dom.TagName.DIV,[b+"-thumb",ol.css.CLASS_UNSELECTABLE]);b=goog.dom.createDom(goog.dom.TagName.DIV,[b,ol.css.CLASS_UNSELECTABLE],a);this.dragger_=new goog.fx.Dragger(a);this.registerDisposable(this.dragger_);goog.events.listen(this.dragger_,[goog.fx.Dragger.EventType.DRAG,
|
|
goog.fx.Dragger.EventType.END],this.handleSliderChange_,void 0,this);goog.events.listen(b,goog.events.EventType.CLICK,this.handleContainerClick_,!1,this);goog.events.listen(a,goog.events.EventType.CLICK,goog.events.Event.stopPropagation);ol.control.Control.call(this,{element:b})};goog.inherits(ol.control.ZoomSlider,ol.control.Control);ol.control.ZoomSlider.direction={VERTICAL:0,HORIZONTAL:1};
|
|
ol.control.ZoomSlider.prototype.setMap=function(a){ol.control.ZoomSlider.superClass_.setMap.call(this,a);goog.isNull(a)||a.render()};
|
|
ol.control.ZoomSlider.prototype.initSlider_=function(){var a=this.element,b=goog.dom.getFirstElementChild(a),a=goog.style.getContentBoxSize(a),c=goog.style.getBounds(b),d=goog.style.getMarginBox(b),e=goog.style.getBorderBox(b),b=a.width-d.left-d.right-e.left-e.right-c.width,c=a.height-d.top-d.bottom-e.top-e.bottom-c.height;a.width>a.height?(this.direction_=ol.control.ZoomSlider.direction.HORIZONTAL,a=new goog.math.Rect(0,0,b,0)):(this.direction_=ol.control.ZoomSlider.direction.VERTICAL,a=new goog.math.Rect(0,
|
|
0,0,c));this.dragger_.setLimits(a);this.sliderInitialized_=!0};ol.control.ZoomSlider.prototype.handleMapPostrender=function(a){goog.isNull(a.frameState)||(this.sliderInitialized_||this.initSlider_(),a=a.frameState.view2DState.resolution,a!==this.currentResolution_&&(this.currentResolution_=a,this.positionThumbForResolution_(a)))};
|
|
ol.control.ZoomSlider.prototype.handleContainerClick_=function(a){var b=this.getMap(),c=b.getView().getView2D();a=this.amountDragged_(a.offsetX,a.offsetY);a=this.resolutionForAmount_(a);b.beforeRender(ol.animation.zoom({resolution:a,duration:ol.control.ZOOMSLIDER_ANIMATION_DURATION,easing:ol.easing.easeOut}));a=c.constrainResolution(a);c.setResolution(a)};
|
|
ol.control.ZoomSlider.prototype.positionThumbForResolution_=function(a){a=this.amountForResolution_(a);var b=this.dragger_,c=goog.dom.getFirstElementChild(this.element);this.direction_==ol.control.ZoomSlider.direction.HORIZONTAL?goog.style.setPosition(c,b.limits.left+b.limits.width*a):goog.style.setPosition(c,b.limits.left,b.limits.top+b.limits.height*a)};
|
|
ol.control.ZoomSlider.prototype.amountDragged_=function(a,b){var c=this.dragger_.limits,d=0;return d=this.direction_===ol.control.ZoomSlider.direction.HORIZONTAL?(a-c.left)/c.width:(b-c.top)/c.height};ol.control.ZoomSlider.prototype.resolutionForAmount_=function(a){a=-1*(goog.math.clamp(a,0,1)-1);return this.getMap().getView().getView2D().getResolutionForValueFunction()(a)};
|
|
ol.control.ZoomSlider.prototype.amountForResolution_=function(a){return-1*(this.getMap().getView().getView2D().getValueForResolutionFunction()(a)-1)};
|
|
ol.control.ZoomSlider.prototype.handleSliderChange_=function(a){var b=this.getMap(),c=b.getView().getView2D();a.type===goog.fx.Dragger.EventType.DRAG?(a=this.amountDragged_(a.left,a.top),a=this.resolutionForAmount_(a),a!==this.currentResolution_&&(this.currentResolution_=a,c.setResolution(a))):(b.beforeRender(ol.animation.zoom({resolution:this.currentResolution_,duration:ol.control.ZOOMSLIDER_ANIMATION_DURATION,easing:ol.easing.easeOut})),a=c.constrainResolution(this.currentResolution_),c.setResolution(a))};ol.control.ZoomToExtent=function(a){a=goog.isDef(a)?a:{};this.extent_=goog.isDef(a.extent)?a.extent:null;var b=goog.isDef(a.className)?a.className:"ol-zoom-extent",c=goog.isDef(a.tipLabel)?a.tipLabel:"Fit to extent",c=goog.dom.createDom(goog.dom.TagName.SPAN,{role:"tooltip"},c),b=goog.dom.createDom(goog.dom.TagName.DIV,{"class":b+" "+ol.css.CLASS_UNSELECTABLE}),d=goog.dom.createDom(goog.dom.TagName.BUTTON,{"class":"ol-has-tooltip"});goog.dom.appendChild(d,c);goog.dom.appendChild(b,d);goog.events.listen(d,
|
|
[goog.events.EventType.TOUCHEND,goog.events.EventType.CLICK],this.handleZoomToExtent_,!1,this);goog.events.listen(d,[goog.events.EventType.MOUSEOUT,goog.events.EventType.FOCUSOUT],function(){this.blur()},!1);ol.control.Control.call(this,{element:b,target:a.target})};goog.inherits(ol.control.ZoomToExtent,ol.control.Control);
|
|
ol.control.ZoomToExtent.prototype.handleZoomToExtent_=function(a){a.preventDefault();a=this.getMap();var b=a.getView().getView2D(),c=goog.isNull(this.extent_)?b.getProjection().getExtent():this.extent_;b.fitExtent(c,a.getSize())};ol.dom.InputProperty={VALUE:"value",CHECKED:"checked"};ol.dom.Input=function(a){ol.Object.call(this);this.target_=a;goog.events.listen(this.target_,[goog.events.EventType.CHANGE,goog.events.EventType.INPUT],this.handleInputChanged_,!1,this);goog.events.listen(this,ol.Object.getChangeEventType(ol.dom.InputProperty.VALUE),this.handleValueChanged_,!1,this);goog.events.listen(this,ol.Object.getChangeEventType(ol.dom.InputProperty.CHECKED),this.handleCheckedChanged_,!1,this)};
|
|
goog.inherits(ol.dom.Input,ol.Object);ol.dom.Input.prototype.getChecked=function(){return this.get(ol.dom.InputProperty.CHECKED)};goog.exportProperty(ol.dom.Input.prototype,"getChecked",ol.dom.Input.prototype.getChecked);ol.dom.Input.prototype.getValue=function(){return this.get(ol.dom.InputProperty.VALUE)};goog.exportProperty(ol.dom.Input.prototype,"getValue",ol.dom.Input.prototype.getValue);ol.dom.Input.prototype.setValue=function(a){this.set(ol.dom.InputProperty.VALUE,a)};
|
|
goog.exportProperty(ol.dom.Input.prototype,"setValue",ol.dom.Input.prototype.setValue);ol.dom.Input.prototype.setChecked=function(a){this.set(ol.dom.InputProperty.CHECKED,a)};goog.exportProperty(ol.dom.Input.prototype,"setChecked",ol.dom.Input.prototype.setChecked);ol.dom.Input.prototype.handleInputChanged_=function(a){a=this.target_;"checkbox"===a.type||"radio"===a.type?this.setChecked(a.checked):this.setValue(a.value)};
|
|
ol.dom.Input.prototype.handleCheckedChanged_=function(a){this.target_.checked=this.getChecked()};ol.dom.Input.prototype.handleValueChanged_=function(a){this.target_.value=this.getValue()};ol.ellipsoid={};ol.ellipsoid.BESSEL1841=new ol.Ellipsoid(6377397.155,1/299.15281285);ol.ellipsoid.WGS84=new ol.Ellipsoid(6378137,1/298.257223563);ol.format={};ol.format.Feature=function(){};ol.format.FormatType={BINARY:"binary",JSON:"json",TEXT:"text",XML:"xml"};ol.format.BinaryFeature=function(){ol.format.Feature.call(this)};goog.inherits(ol.format.BinaryFeature,ol.format.Feature);ol.format.BinaryFeature.getBuffer_=function(a){return ol.BrowserFeature.HAS_ARRAY_BUFFER&&a instanceof ArrayBuffer?new ol.binary.Buffer(a):goog.isString(a)?new ol.binary.Buffer(a):null};ol.format.BinaryFeature.prototype.getType=function(){return ol.format.FormatType.BINARY};ol.format.BinaryFeature.prototype.readFeature=function(a){return this.readFeatureFromBuffer(ol.format.BinaryFeature.getBuffer_(a))};
|
|
ol.format.BinaryFeature.prototype.readFeatures=function(a){return this.readFeaturesFromBuffer(ol.format.BinaryFeature.getBuffer_(a))};ol.format.BinaryFeature.prototype.readGeometry=function(a){return this.readGeometryFromBuffer(ol.format.BinaryFeature.getBuffer_(a))};ol.format.BinaryFeature.prototype.readProjection=function(a){return this.readProjectionFromBuffer(ol.format.BinaryFeature.getBuffer_(a))};goog.dom.xml={};goog.dom.xml.MAX_XML_SIZE_KB=2048;goog.dom.xml.MAX_ELEMENT_DEPTH=256;
|
|
goog.dom.xml.createDocument=function(a,b){if(b&&!a)throw Error("Can't create document with namespace and no root tag");if(document.implementation&&document.implementation.createDocument)return document.implementation.createDocument(b||"",a||"",null);if("undefined"!=typeof ActiveXObject){var c=goog.dom.xml.createMsXmlDocument_();if(c)return a&&c.appendChild(c.createNode(goog.dom.NodeType.ELEMENT,a,b||"")),c}throw Error("Your browser does not support creating new documents");};
|
|
goog.dom.xml.loadXml=function(a){if("undefined"!=typeof DOMParser)return(new DOMParser).parseFromString(a,"application/xml");if("undefined"!=typeof ActiveXObject){var b=goog.dom.xml.createMsXmlDocument_();b.loadXML(a);return b}throw Error("Your browser does not support loading xml documents");};
|
|
goog.dom.xml.serialize=function(a){if("undefined"!=typeof XMLSerializer)return(new XMLSerializer).serializeToString(a);if(a=a.xml)return a;throw Error("Your browser does not support serializing XML documents");};
|
|
goog.dom.xml.selectSingleNode=function(a,b){if("undefined"!=typeof a.selectSingleNode){var c=goog.dom.getOwnerDocument(a);"undefined"!=typeof c.setProperty&&c.setProperty("SelectionLanguage","XPath");return a.selectSingleNode(b)}if(document.implementation.hasFeature("XPath","3.0")){var c=goog.dom.getOwnerDocument(a),d=c.createNSResolver(c.documentElement);return c.evaluate(b,a,d,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}return null};
|
|
goog.dom.xml.selectNodes=function(a,b){if("undefined"!=typeof a.selectNodes){var c=goog.dom.getOwnerDocument(a);"undefined"!=typeof c.setProperty&&c.setProperty("SelectionLanguage","XPath");return a.selectNodes(b)}if(document.implementation.hasFeature("XPath","3.0")){for(var c=goog.dom.getOwnerDocument(a),d=c.createNSResolver(c.documentElement),c=c.evaluate(b,a,d,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),d=[],e=c.snapshotLength,f=0;f<e;f++)d.push(c.snapshotItem(f));return d}return[]};
|
|
goog.dom.xml.setAttributes=function(a,b){for(var c in b)b.hasOwnProperty(c)&&a.setAttribute(c,b[c])};goog.dom.xml.createMsXmlDocument_=function(){var a=new ActiveXObject("MSXML2.DOMDocument");if(a){a.resolveExternals=!1;a.validateOnParse=!1;try{a.setProperty("ProhibitDTD",!0),a.setProperty("MaxXMLSize",goog.dom.xml.MAX_XML_SIZE_KB),a.setProperty("MaxElementDepth",goog.dom.xml.MAX_ELEMENT_DEPTH)}catch(b){}}return a};ol.xml={};ol.xml.DOCUMENT=goog.dom.xml.createDocument();ol.xml.createElementNS_=function(a,b){return ol.xml.DOCUMENT.createElementNS(a,b)};ol.xml.createElementNSActiveX_=function(a,b){goog.isNull(a)&&(a="");return ol.xml.DOCUMENT.createNode(1,b,a)};ol.xml.createElementNS=document.implementation&&document.implementation.createDocument?ol.xml.createElementNS_:ol.xml.createElementNSActiveX_;ol.xml.getAllTextContent=function(a,b){return ol.xml.getAllTextContent_(a,b,[]).join("")};
|
|
ol.xml.getAllTextContent_=function(a,b,c){if(a.nodeType==goog.dom.NodeType.CDATA_SECTION||a.nodeType==goog.dom.NodeType.TEXT)b?c.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):c.push(a.nodeValue);else for(a=a.firstChild;!goog.isNull(a);a=a.nextSibling)ol.xml.getAllTextContent_(a,b,c);return c};ol.xml.getLocalName_=function(a){return a.localName};ol.xml.getLocalNameIE_=function(a){var b=a.localName;return goog.isDef(b)?b:a.baseName};
|
|
ol.xml.getLocalName=goog.userAgent.IE?ol.xml.getLocalNameIE_:ol.xml.getLocalName_;ol.xml.isDocument_=function(a){return a instanceof Document};ol.xml.isDocumentIE_=function(a){return goog.isObject(a)&&a.nodeType==goog.dom.NodeType.DOCUMENT};ol.xml.isDocument=goog.userAgent.IE?ol.xml.isDocumentIE_:ol.xml.isDocument_;ol.xml.isNode_=function(a){return a instanceof Node};ol.xml.isNodeIE_=function(a){return goog.isObject(a)&&goog.isDef(a.nodeType)};ol.xml.isNode=goog.userAgent.IE?ol.xml.isNodeIE_:ol.xml.isNode_;
|
|
ol.xml.getAttributeNS_=function(a,b,c){return a.getAttributeNS(b,c)||""};ol.xml.getAttributeNSActiveX_=function(a,b,c){var d="";a=ol.xml.getAttributeNodeNS(a,b,c);goog.isDef(a)&&(d=a.nodeValue);return d};ol.xml.getAttributeNS=document.implementation&&document.implementation.createDocument?ol.xml.getAttributeNS_:ol.xml.getAttributeNSActiveX_;ol.xml.getAttributeNodeNS_=function(a,b,c){return a.getAttributeNodeNS(b,c)};
|
|
ol.xml.getAttributeNodeNSActiveX_=function(a,b,c){var d=null;a=a.attributes;for(var e,f,g=0,h=a.length;g<h;++g)if(e=a[g],e.namespaceURI==b&&(f=e.prefix?e.prefix+":"+c:c,f==e.nodeName)){d=e;break}return d};ol.xml.getAttributeNodeNS=document.implementation&&document.implementation.createDocument?ol.xml.getAttributeNodeNS_:ol.xml.getAttributeNodeNSActiveX_;ol.xml.setAttributeNS_=function(a,b,c,d){a.setAttributeNS(b,c,d)};
|
|
ol.xml.setAttributeNSActiveX_=function(a,b,c,d){goog.isNull(b)?a.setAttribute(c,d):(b=a.ownerDocument.createNode(2,c,b),b.nodeValue=d,a.setAttributeNode(b))};ol.xml.setAttributeNS=document.implementation&&document.implementation.createDocument?ol.xml.setAttributeNS_:ol.xml.setAttributeNSActiveX_;ol.xml.load=function(a){return(new DOMParser).parseFromString(a,"application/xml")};
|
|
ol.xml.makeArrayExtender=function(a,b){return function(c,d){var e=a.call(b,c,d);goog.isDef(e)&&goog.array.extend(d[d.length-1],e)}};ol.xml.makeArrayPusher=function(a,b){return function(c,d){var e=a.call(b,c,d);goog.isDef(e)&&d[d.length-1].push(e)}};ol.xml.makeReplacer=function(a,b){return function(c,d){var e=a.call(b,c,d);goog.isDef(e)&&(d[d.length-1]=e)}};
|
|
ol.xml.makeObjectPropertySetter=function(a,b,c){return function(d,e){var f=a.call(c,d,e);if(goog.isDef(f)){var g=e[e.length-1],h=goog.isDef(b)?b:d.localName;goog.object.set(g,h,f)}}};ol.xml.makeParsersNS=function(a,b,c){return ol.xml.makeStructureNS(a,b,c)};ol.xml.makeChildAppender=function(a,b){return function(c,d,e){a.call(b,c,d,e);e[e.length-1].node.appendChild(c)}};
|
|
ol.xml.makeArraySerializer=function(a,b){var c,d;return function(b,f,g){if(!goog.isDef(c)){c={};var h={};goog.object.set(h,b.localName,a);goog.object.set(c,b.namespaceURI,h);d=ol.xml.makeSimpleNodeFactory(b.localName)}ol.xml.serialize(c,d,f,g)}};ol.xml.makeSimpleNodeFactory=function(a,b){return function(c,d,e){c=d[d.length-1].node;d=a;goog.isDef(d)||(d=e);e=b;goog.isDef(b)||(e=c.namespaceURI);return ol.xml.createElementNS(e,d)}};ol.xml.OBJECT_PROPERTY_NODE_FACTORY=ol.xml.makeSimpleNodeFactory();
|
|
ol.xml.makeSequence=function(a,b){for(var c=b.length,d=Array(c),e=0;e<c;++e)d[e]=a[b[e]];return d};ol.xml.makeStructureNS=function(a,b,c){c=goog.isDef(c)?c:{};var d,e;d=0;for(e=a.length;d<e;++d)c[a[d]]=b;return c};ol.xml.parse=function(a,b,c,d){for(b=b.firstElementChild;!goog.isNull(b);b=b.nextElementSibling){var e=a[b.namespaceURI];goog.isDef(e)&&(e=e[b.localName],goog.isDef(e)&&e.call(d,b,c))}};ol.xml.pushParseAndPop=function(a,b,c,d,e){d.push(a);ol.xml.parse(b,c,d,e);return d.pop()};
|
|
ol.xml.serialize=function(a,b,c,d,e,f){for(var g=(goog.isDef(e)?e:c).length,h,k,l=0;l<g;++l)h=c[l],goog.isDef(h)&&(k=b.call(f,h,d,goog.isDef(e)?e[l]:void 0),goog.isDef(k)&&a[k.namespaceURI][k.localName].call(f,k,h,d))};ol.xml.pushSerializeAndPop=function(a,b,c,d,e,f,g){e.push(a);ol.xml.serialize(b,c,d,e,f,g);return e.pop()};ol.format.XMLFeature=function(){ol.format.Feature.call(this)};goog.inherits(ol.format.XMLFeature,ol.format.Feature);ol.format.XMLFeature.prototype.getType=function(){return ol.format.FormatType.XML};ol.format.XMLFeature.prototype.readFeature=function(a){return ol.xml.isDocument(a)?this.readFeatureFromDocument(a):ol.xml.isNode(a)?this.readFeatureFromNode(a):goog.isString(a)?(a=ol.xml.load(a),this.readFeatureFromDocument(a)):null};
|
|
ol.format.XMLFeature.prototype.readFeatureFromDocument=function(a){a=this.readFeaturesFromDocument(a);return 0<a.length?a[0]:null};ol.format.XMLFeature.prototype.readFeatures=function(a){return ol.xml.isDocument(a)?this.readFeaturesFromDocument(a):ol.xml.isNode(a)?this.readFeaturesFromNode(a):goog.isString(a)?(a=ol.xml.load(a),this.readFeaturesFromDocument(a)):[]};
|
|
ol.format.XMLFeature.prototype.readFeaturesFromDocument=function(a){var b=[];for(a=a.firstChild;!goog.isNull(a);a=a.nextSibling)a.nodeType==goog.dom.NodeType.ELEMENT&&goog.array.extend(b,this.readFeaturesFromNode(a));return b};ol.format.XMLFeature.prototype.readGeometry=function(a){return ol.xml.isDocument(a)?this.readGeometryFromDocument(a):ol.xml.isNode(a)?this.readGeometryFromNode(a):goog.isString(a)?(a=ol.xml.load(a),this.readGeometryFromDocument(a)):null};
|
|
ol.format.XMLFeature.prototype.readProjection=function(a){return ol.xml.isDocument(a)?this.readProjectionFromDocument(a):ol.xml.isNode(a)?this.readProjectionFromNode(a):goog.isString(a)?(a=ol.xml.load(a),this.readProjectionFromDocument(a)):null};ol.format.XMLFeature.prototype.writeFeature=function(a){return this.writeFeatureNode(a)};ol.format.XMLFeature.prototype.writeFeatures=function(a){return this.writeFeaturesNode(a)};ol.format.XMLFeature.prototype.writeGeometry=function(a){return this.writeGeometryNode(a)};ol.format.XSD={};ol.format.XSD.NAMESPACE_URI="http://www.w3.org/2001/XMLSchema";ol.format.XSD.readBoolean=function(a){a=ol.xml.getAllTextContent(a,!1);return ol.format.XSD.readBooleanString(a)};ol.format.XSD.readBooleanString=function(a){if(a=/^\s*(true|1)|(false|0)\s*$/.exec(a))return goog.isDef(a[1])||!1};
|
|
ol.format.XSD.readDateTime=function(a){a=ol.xml.getAllTextContent(a,!1);if(a=/^\s*(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(Z|(?:([+\-])(\d{2})(?::(\d{2}))?))\s*$/.exec(a)){var b=parseInt(a[1],10),c=parseInt(a[2],10)-1,d=parseInt(a[3],10),e=parseInt(a[4],10),f=parseInt(a[5],10),g=parseInt(a[6],10),b=Date.UTC(b,c,d,e,f,g)/1E3;"Z"!=a[7]&&(c="-"==a[8]?-1:1,b+=60*c*parseInt(a[9],10),goog.isDef(a[10])&&(b+=3600*c*parseInt(a[10],10)));return b}};
|
|
ol.format.XSD.readDecimal=function(a){a=ol.xml.getAllTextContent(a,!1);return ol.format.XSD.readDecimalString(a)};ol.format.XSD.readDecimalString=function(a){if(a=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(a))return parseFloat(a[1])};ol.format.XSD.readNonNegativeInteger=function(a){a=ol.xml.getAllTextContent(a,!1);return ol.format.XSD.readNonNegativeIntegerString(a)};ol.format.XSD.readNonNegativeIntegerString=function(a){if(a=/^\s*(\d+)\s*$/.exec(a))return parseInt(a[1],10)};
|
|
ol.format.XSD.readString=function(a){a=ol.xml.getAllTextContent(a,!1);return goog.string.trim(a)};ol.format.XSD.writeDateTimeTextNode=function(a,b){var c=new Date(1E3*b),c=c.getUTCFullYear()+"-"+goog.string.padNumber(c.getUTCMonth()+1,2)+"-"+goog.string.padNumber(c.getUTCDate(),2)+"T"+goog.string.padNumber(c.getUTCHours(),2)+":"+goog.string.padNumber(c.getUTCMinutes(),2)+":"+goog.string.padNumber(c.getUTCSeconds(),2)+"Z";a.appendChild(ol.xml.DOCUMENT.createTextNode(c))};
|
|
ol.format.XSD.writeDecimalTextNode=function(a,b){var c=b.toPrecision();a.appendChild(ol.xml.DOCUMENT.createTextNode(c))};ol.format.XSD.writeNonNegativeIntegerTextNode=function(a,b){a.appendChild(ol.xml.DOCUMENT.createTextNode(b.toString()))};ol.format.XSD.writeStringTextNode=function(a,b){a.appendChild(ol.xml.DOCUMENT.createTextNode(b))};ol.format.GML=function(a){a=goog.isDef(a)?a:{};this.featureType_=a.featureType;this.featureNS_=a.featureNS;this.srsName_=a.srsName;this.surface_=goog.isDef(a.surface)?a.surface:!1;this.curve_=goog.isDef(a.curve)?a.curve:!1;this.multiCurve_=goog.isDef(a.multiCurve)?a.multiCurve:!0;this.multiSurface_=goog.isDef(a.multiSurface)?a.multiSurface:!0;this.schemaLocation_=goog.isDef(a.schemaLocation)?a.schemaLocation:ol.format.GML.schemaLocation_;ol.format.XMLFeature.call(this)};
|
|
goog.inherits(ol.format.GML,ol.format.XMLFeature);ol.format.GML.schemaLocation_="http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd";
|
|
ol.format.GML.readFeatures_=function(a,b){var c=ol.xml.getLocalName(a),d=b[0],e=goog.object.get(d,"featureType"),f;"FeatureCollection"==c?f=ol.xml.pushParseAndPop(null,ol.format.GML.FEATURE_COLLECTION_PARSERS_,a,b):"featureMembers"==c&&(c={},f={},c[e]=ol.xml.makeArrayPusher(ol.format.GML.readFeature_),f[goog.object.get(d,"featureNS")]=c,f=ol.xml.pushParseAndPop([],f,a,b));goog.isDef(f)||(f=[]);return f};ol.format.GML.FEATURE_COLLECTION_PARSERS_={"http://www.opengis.net/gml":{featureMembers:ol.xml.makeReplacer(ol.format.GML.readFeatures_)}};
|
|
ol.format.GML.readGeometry_=function(a,b){goog.object.set(b[0],"srsName",a.firstElementChild.getAttribute("srsName"));var c=ol.xml.pushParseAndPop(null,ol.format.GML.GEOMETRY_PARSERS_,a,b);if(goog.isDefAndNotNull(c))return c};
|
|
ol.format.GML.readFeature_=function(a,b){var c,d=a.getAttribute("fid")||ol.xml.getAttributeNS(a,"http://www.opengis.net/gml","id"),e={},f;for(c=a.firstElementChild;!goog.isNull(c);c=c.nextElementSibling)if(0===c.childNodes.length||1===c.childNodes.length&&3===c.firstChild.nodeType){var g=ol.xml.getAllTextContent(c,!1);goog.string.isEmpty(g)&&(g=void 0);e[ol.xml.getLocalName(c)]=g}else f=ol.xml.getLocalName(c),e[f]=ol.format.GML.readGeometry_(c,b);c=new ol.Feature(e);goog.isDef(f)&&c.setGeometryName(f);
|
|
d&&c.setId(d);return c};ol.format.GML.readPoint_=function(a,b){var c=ol.format.GML.readFlatCoordinatesFromNode_(a,b);if(goog.isDefAndNotNull(c)){var d=new ol.geom.Point(null);d.setFlatCoordinates(ol.geom.GeometryLayout.XYZ,c);return d}};ol.format.GML.readMultiPoint_=function(a,b){var c=ol.xml.pushParseAndPop([],ol.format.GML.MULTIPOINT_PARSERS_,a,b);if(goog.isDef(c))return new ol.geom.MultiPoint(c)};
|
|
ol.format.GML.readMultiLineString_=function(a,b){var c=ol.xml.pushParseAndPop([],ol.format.GML.MULTILINESTRING_PARSERS_,a,b);if(goog.isDef(c)){var d=new ol.geom.MultiLineString(null);d.setLineStrings(c);return d}};ol.format.GML.readMultiCurve_=function(a,b){var c=ol.xml.pushParseAndPop([],ol.format.GML.MULTICURVE_PARSERS_,a,b);if(goog.isDef(c)){var d=new ol.geom.MultiLineString(null);d.setLineStrings(c);return d}};
|
|
ol.format.GML.readMultiSurface_=function(a,b){var c=ol.xml.pushParseAndPop([],ol.format.GML.MULTISURFACE_PARSERS_,a,b);if(goog.isDef(c)){var d=new ol.geom.MultiPolygon(null);d.setPolygons(c);return d}};ol.format.GML.readMultiPolygon_=function(a,b){var c=ol.xml.pushParseAndPop([],ol.format.GML.MULTIPOLYGON_PARSERS_,a,b);if(goog.isDef(c)){var d=new ol.geom.MultiPolygon(null);d.setPolygons(c);return d}};
|
|
ol.format.GML.pointMemberParser_=function(a,b){ol.xml.parse(ol.format.GML.POINTMEMBER_PARSERS_,a,b)};ol.format.GML.lineStringMemberParser_=function(a,b){ol.xml.parse(ol.format.GML.LINESTRINGMEMBER_PARSERS_,a,b)};ol.format.GML.curveMemberParser_=function(a,b){ol.xml.parse(ol.format.GML.CURVEMEMBER_PARSERS_,a,b)};ol.format.GML.surfaceMemberParser_=function(a,b){ol.xml.parse(ol.format.GML.SURFACEMEMBER_PARSERS_,a,b)};
|
|
ol.format.GML.polygonMemberParser_=function(a,b){ol.xml.parse(ol.format.GML.POLYGONMEMBER_PARSERS_,a,b)};ol.format.GML.readLineString_=function(a,b){var c=ol.format.GML.readFlatCoordinatesFromNode_(a,b);if(goog.isDefAndNotNull(c)){var d=new ol.geom.LineString(null);d.setFlatCoordinates(ol.geom.GeometryLayout.XYZ,c);return d}};ol.format.GML.readPatch_=function(a,b){return ol.xml.pushParseAndPop([null],ol.format.GML.PATCHES_PARSERS_,a,b)};
|
|
ol.format.GML.readSegment_=function(a,b){return ol.xml.pushParseAndPop([null],ol.format.GML.SEGMENTS_PARSERS_,a,b)};ol.format.GML.readPolygonPatch_=function(a,b){return ol.xml.pushParseAndPop([null],ol.format.GML.FLAT_LINEAR_RINGS_PARSERS_,a,b)};ol.format.GML.readLineStringSegment_=function(a,b){return ol.xml.pushParseAndPop([null],ol.format.GML.GEOMETRY_FLAT_COORDINATES_PARSERS_,a,b)};
|
|
ol.format.GML.interiorParser_=function(a,b){var c=ol.xml.pushParseAndPop(void 0,ol.format.GML.RING_PARSERS_,a,b);goog.isDef(c)&&b[b.length-1].push(c)};ol.format.GML.exteriorParser_=function(a,b){var c=ol.xml.pushParseAndPop(void 0,ol.format.GML.RING_PARSERS_,a,b);goog.isDef(c)&&(b[b.length-1][0]=c)};ol.format.GML.readFlatLinearRing_=function(a,b){var c=ol.xml.pushParseAndPop(null,ol.format.GML.GEOMETRY_FLAT_COORDINATES_PARSERS_,a,b);if(goog.isDefAndNotNull(c))return c};
|
|
ol.format.GML.readLinearRing_=function(a,b){var c=ol.format.GML.readFlatCoordinatesFromNode_(a,b);if(goog.isDef(c)){var d=new ol.geom.LinearRing(null);d.setFlatCoordinates(ol.geom.GeometryLayout.XYZ,c);return d}};
|
|
ol.format.GML.readPolygon_=function(a,b){var c=ol.xml.pushParseAndPop([null],ol.format.GML.FLAT_LINEAR_RINGS_PARSERS_,a,b);if(goog.isDef(c)&&!goog.isNull(c[0])){var d=new ol.geom.Polygon(null),e=c[0],f=[e.length],g,h;g=1;for(h=c.length;g<h;++g)goog.array.extend(e,c[g]),f.push(e.length);d.setFlatCoordinates(ol.geom.GeometryLayout.XYZ,e,f);return d}};
|
|
ol.format.GML.readSurface_=function(a,b){var c=ol.xml.pushParseAndPop([null],ol.format.GML.SURFACE_PARSERS_,a,b);if(goog.isDef(c)&&!goog.isNull(c[0])){var d=new ol.geom.Polygon(null),e=c[0],f=[e.length],g,h;g=1;for(h=c.length;g<h;++g)goog.array.extend(e,c[g]),f.push(e.length);d.setFlatCoordinates(ol.geom.GeometryLayout.XYZ,e,f);return d}};
|
|
ol.format.GML.readCurve_=function(a,b){var c=ol.xml.pushParseAndPop([null],ol.format.GML.CURVE_PARSERS_,a,b);if(goog.isDef(c)){var d=new ol.geom.LineString(null);d.setFlatCoordinates(ol.geom.GeometryLayout.XYZ,c);return d}};ol.format.GML.readEnvelope_=function(a,b){var c=ol.xml.pushParseAndPop([null],ol.format.GML.ENVELOPE_PARSERS_,a,b);return ol.extent.createOrUpdate(c[1][0],c[1][1],c[2][0],c[2][1])};
|
|
ol.format.GML.readFlatCoordinatesFromNode_=function(a,b){return ol.xml.pushParseAndPop(null,ol.format.GML.GEOMETRY_FLAT_COORDINATES_PARSERS_,a,b)};ol.format.GML.readFlatPos_=function(a,b){var c=ol.xml.getAllTextContent(a,!1).replace(/^\s*|\s*$/g,""),c=goog.array.map(c.split(/\s+/),parseFloat),d=goog.object.get(b[0],"srsName"),e="enu";goog.isNull(d)||(e=ol.proj.get(d).getAxisOrientation());"neu"===e&&(c=c.reverse());d=c.length;2==d&&c.push(0);return 0===d?void 0:c};
|
|
ol.format.GML.readFlatPosList_=function(a,b){var c=ol.xml.getAllTextContent(a,!1).replace(/^\s*|\s*$/g,""),d=goog.object.get(b[0],"srsName"),e=a.parentNode.getAttribute("srsDimension"),f="enu";goog.isNull(d)||(f=ol.proj.get(d).getAxisOrientation());c=c.split(/\s+/);d=2;goog.isNull(a.getAttribute("srsDimension"))?goog.isNull(a.getAttribute("dimension"))?goog.isNull(e)||(d=ol.format.XSD.readNonNegativeIntegerString(e)):d=ol.format.XSD.readNonNegativeIntegerString(a.getAttribute("dimension")):d=ol.format.XSD.readNonNegativeIntegerString(a.getAttribute("srsDimension"));
|
|
for(var g,h,k=[],l=0,m=c.length;l<m;l+=d)e=parseFloat(c[l]),g=parseFloat(c[l+1]),h=3===d?parseFloat(c[l+2]):0,"en"===f.substr(0,2)?k.push(e,g,h):k.push(g,e,h);return k};
|
|
ol.format.GML.GEOMETRY_PARSERS_={"http://www.opengis.net/gml":{Point:ol.xml.makeReplacer(ol.format.GML.readPoint_),MultiPoint:ol.xml.makeReplacer(ol.format.GML.readMultiPoint_),LineString:ol.xml.makeReplacer(ol.format.GML.readLineString_),MultiLineString:ol.xml.makeReplacer(ol.format.GML.readMultiLineString_),LinearRing:ol.xml.makeReplacer(ol.format.GML.readLinearRing_),Polygon:ol.xml.makeReplacer(ol.format.GML.readPolygon_),MultiPolygon:ol.xml.makeReplacer(ol.format.GML.readMultiPolygon_),Surface:ol.xml.makeReplacer(ol.format.GML.readSurface_),
|
|
MultiSurface:ol.xml.makeReplacer(ol.format.GML.readMultiSurface_),Curve:ol.xml.makeReplacer(ol.format.GML.readCurve_),MultiCurve:ol.xml.makeReplacer(ol.format.GML.readMultiCurve_),Envelope:ol.xml.makeReplacer(ol.format.GML.readEnvelope_)}};ol.format.GML.GEOMETRY_FLAT_COORDINATES_PARSERS_={"http://www.opengis.net/gml":{pos:ol.xml.makeReplacer(ol.format.GML.readFlatPos_),posList:ol.xml.makeReplacer(ol.format.GML.readFlatPosList_)}};
|
|
ol.format.GML.FLAT_LINEAR_RINGS_PARSERS_={"http://www.opengis.net/gml":{interior:ol.format.GML.interiorParser_,exterior:ol.format.GML.exteriorParser_}};ol.format.GML.MULTIPOINT_PARSERS_={"http://www.opengis.net/gml":{pointMember:ol.xml.makeArrayPusher(ol.format.GML.pointMemberParser_),pointMembers:ol.xml.makeArrayPusher(ol.format.GML.pointMemberParser_)}};
|
|
ol.format.GML.MULTILINESTRING_PARSERS_={"http://www.opengis.net/gml":{lineStringMember:ol.xml.makeArrayPusher(ol.format.GML.lineStringMemberParser_),lineStringMembers:ol.xml.makeArrayPusher(ol.format.GML.lineStringMemberParser_)}};ol.format.GML.MULTICURVE_PARSERS_={"http://www.opengis.net/gml":{curveMember:ol.xml.makeArrayPusher(ol.format.GML.curveMemberParser_),curveMembers:ol.xml.makeArrayPusher(ol.format.GML.curveMemberParser_)}};
|
|
ol.format.GML.MULTISURFACE_PARSERS_={"http://www.opengis.net/gml":{surfaceMember:ol.xml.makeArrayPusher(ol.format.GML.surfaceMemberParser_),surfaceMembers:ol.xml.makeArrayPusher(ol.format.GML.surfaceMemberParser_)}};ol.format.GML.MULTIPOLYGON_PARSERS_={"http://www.opengis.net/gml":{polygonMember:ol.xml.makeArrayPusher(ol.format.GML.polygonMemberParser_),polygonMembers:ol.xml.makeArrayPusher(ol.format.GML.polygonMemberParser_)}};ol.format.GML.POINTMEMBER_PARSERS_={"http://www.opengis.net/gml":{Point:ol.xml.makeArrayPusher(ol.format.GML.readFlatCoordinatesFromNode_)}};
|
|
ol.format.GML.LINESTRINGMEMBER_PARSERS_={"http://www.opengis.net/gml":{LineString:ol.xml.makeArrayPusher(ol.format.GML.readLineString_)}};ol.format.GML.CURVEMEMBER_PARSERS_={"http://www.opengis.net/gml":{LineString:ol.xml.makeArrayPusher(ol.format.GML.readLineString_),Curve:ol.xml.makeArrayPusher(ol.format.GML.readCurve_)}};ol.format.GML.SURFACEMEMBER_PARSERS_={"http://www.opengis.net/gml":{Polygon:ol.xml.makeArrayPusher(ol.format.GML.readPolygon_),Surface:ol.xml.makeArrayPusher(ol.format.GML.readSurface_)}};
|
|
ol.format.GML.POLYGONMEMBER_PARSERS_={"http://www.opengis.net/gml":{Polygon:ol.xml.makeArrayPusher(ol.format.GML.readPolygon_)}};ol.format.GML.SURFACE_PARSERS_={"http://www.opengis.net/gml":{patches:ol.xml.makeReplacer(ol.format.GML.readPatch_)}};ol.format.GML.CURVE_PARSERS_={"http://www.opengis.net/gml":{segments:ol.xml.makeReplacer(ol.format.GML.readSegment_)}};ol.format.GML.ENVELOPE_PARSERS_={"http://www.opengis.net/gml":{lowerCorner:ol.xml.makeArrayPusher(ol.format.GML.readFlatPosList_),upperCorner:ol.xml.makeArrayPusher(ol.format.GML.readFlatPosList_)}};
|
|
ol.format.GML.PATCHES_PARSERS_={"http://www.opengis.net/gml":{PolygonPatch:ol.xml.makeReplacer(ol.format.GML.readPolygonPatch_)}};ol.format.GML.SEGMENTS_PARSERS_={"http://www.opengis.net/gml":{LineStringSegment:ol.xml.makeReplacer(ol.format.GML.readLineStringSegment_)}};ol.format.GML.RING_PARSERS_={"http://www.opengis.net/gml":{LinearRing:ol.xml.makeReplacer(ol.format.GML.readFlatLinearRing_)}};
|
|
ol.format.GML.prototype.readGeometryFromNode=function(a){a=ol.format.GML.readGeometry_(a,[{}]);return goog.isDef(a)?a:null};ol.format.GML.prototype.readFeaturesFromNode=function(a){return ol.format.GML.readFeatures_(a,[{featureType:this.featureType_,featureNS:this.featureNS_}])};
|
|
ol.format.GML.writePos_=function(a,b,c){var d=goog.object.get(c[c.length-1],"srsName");c="enu";goog.isDefAndNotNull(d)&&(c=ol.proj.get(d).getAxisOrientation());b=b.getCoordinates();b="en"===c.substr(0,2)?b[0]+" "+b[1]:b[1]+" "+b[0];ol.format.XSD.writeStringTextNode(a,b)};ol.format.GML.getCoords_=function(a,b){var c="enu";goog.isDefAndNotNull(b)&&(c=ol.proj.get(b).getAxisOrientation());return"en"===c.substr(0,2)?a[0]+" "+a[1]:a[1]+" "+a[0]};
|
|
ol.format.GML.writePosList_=function(a,b,c){c=goog.object.get(c[c.length-1],"srsName");b=b.getCoordinates();for(var d=b.length,e=Array(d),f,g=0;g<d;++g)f=b[g],e[g]=ol.format.GML.getCoords_(f,c);ol.format.XSD.writeStringTextNode(a,e.join(" "))};ol.format.GML.writePoint_=function(a,b,c){var d=goog.object.get(c[c.length-1],"srsName");goog.isDefAndNotNull(d)&&a.setAttribute("srsName",d);d=ol.xml.createElementNS(a.namespaceURI,"pos");a.appendChild(d);ol.format.GML.writePos_(d,b,c)};
|
|
ol.format.GML.writeLinearRing_=function(a,b,c){var d=goog.object.get(c[c.length-1],"srsName");goog.isDefAndNotNull(d)&&a.setAttribute("srsName",d);d=ol.xml.createElementNS(a.namespaceURI,"posList");a.appendChild(d);ol.format.GML.writePosList_(d,b,c)};ol.format.GML.RING_NODE_FACTORY_=function(a,b,c){a=b[b.length-1];b=a.node;c=goog.object.get(a,"exteriorWritten");goog.isDef(c)||goog.object.set(a,"exteriorWritten",!0);return ol.xml.createElementNS(b.namespaceURI,goog.isDef(c)?"interior":"exterior")};
|
|
ol.format.GML.writeSurfaceOrPolygon_=function(a,b,c){var d=goog.object.get(c[c.length-1],"srsName");"PolygonPatch"!==a.nodeName&&goog.isDefAndNotNull(d)&&a.setAttribute("srsName",d);"Polygon"===a.nodeName||"PolygonPatch"===a.nodeName?(b=b.getLinearRings(),ol.xml.pushSerializeAndPop({node:a,srsName:d},ol.format.GML.RING_SERIALIZERS_,ol.format.GML.RING_NODE_FACTORY_,b,c)):"Surface"===a.nodeName&&(d=ol.xml.createElementNS(a.namespaceURI,"patches"),a.appendChild(d),ol.format.GML.writeSurfacePatches_(d,
|
|
b,c))};ol.format.GML.writeCurveOrLineString_=function(a,b,c){var d=goog.object.get(c[c.length-1],"srsName");"LineStringSegment"!==a.nodeName&&goog.isDefAndNotNull(d)&&a.setAttribute("srsName",d);"LineString"===a.nodeName||"LineStringSegment"===a.nodeName?(d=ol.xml.createElementNS(a.namespaceURI,"posList"),a.appendChild(d),ol.format.GML.writePosList_(d,b,c)):"Curve"===a.nodeName&&(d=ol.xml.createElementNS(a.namespaceURI,"segments"),a.appendChild(d),ol.format.GML.writeCurveSegments_(d,b,c))};
|
|
ol.format.GML.writeMultiSurfaceOrPolygon_=function(a,b,c){var d=c[c.length-1],e=goog.object.get(d,"srsName"),d=goog.object.get(d,"surface");goog.isDefAndNotNull(e)&&a.setAttribute("srsName",e);b=b.getPolygons();ol.xml.pushSerializeAndPop({node:a,srsName:e,surface:d},ol.format.GML.SURFACEORPOLYGONMEMBER_SERIALIZERS_,ol.format.GML.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,b,c)};
|
|
ol.format.GML.writeMultiPoint_=function(a,b,c){var d=goog.object.get(c[c.length-1],"srsName");goog.isDefAndNotNull(d)&&a.setAttribute("srsName",d);b=b.getPoints();ol.xml.pushSerializeAndPop({node:a,srsName:d},ol.format.GML.POINTMEMBER_SERIALIZERS_,ol.xml.makeSimpleNodeFactory("pointMember"),b,c)};
|
|
ol.format.GML.writeMultiCurveOrLineString_=function(a,b,c){var d=c[c.length-1],e=goog.object.get(d,"srsName"),d=goog.object.get(d,"curve");goog.isDefAndNotNull(e)&&a.setAttribute("srsName",e);b=b.getLineStrings();ol.xml.pushSerializeAndPop({node:a,srsName:e,curve:d},ol.format.GML.LINESTRINGORCURVEMEMBER_SERIALIZERS_,ol.format.GML.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,b,c)};
|
|
ol.format.GML.writeRing_=function(a,b,c){var d=ol.xml.createElementNS(a.namespaceURI,"LinearRing");a.appendChild(d);ol.format.GML.writeLinearRing_(d,b,c)};ol.format.GML.writeSurfaceOrPolygonMember_=function(a,b,c){var d=ol.format.GML.GEOMETRY_NODE_FACTORY_(b,c);goog.isDef(d)&&(a.appendChild(d),ol.format.GML.writeSurfaceOrPolygon_(d,b,c))};ol.format.GML.writePointMember_=function(a,b,c){var d=ol.xml.createElementNS(a.namespaceURI,"Point");a.appendChild(d);ol.format.GML.writePoint_(d,b,c)};
|
|
ol.format.GML.writeLineStringOrCurveMember_=function(a,b,c){var d=ol.format.GML.GEOMETRY_NODE_FACTORY_(b,c);goog.isDef(d)&&(a.appendChild(d),ol.format.GML.writeCurveOrLineString_(d,b,c))};ol.format.GML.writeSurfacePatches_=function(a,b,c){var d=ol.xml.createElementNS(a.namespaceURI,"PolygonPatch");a.appendChild(d);ol.format.GML.writeSurfaceOrPolygon_(d,b,c)};
|
|
ol.format.GML.writeCurveSegments_=function(a,b,c){var d=ol.xml.createElementNS(a.namespaceURI,"LineStringSegment");a.appendChild(d);ol.format.GML.writeCurveOrLineString_(d,b,c)};ol.format.GML.writeGeometry_=function(a,b,c){var d=goog.object.clone(c[c.length-1]);d.node=a;ol.xml.pushSerializeAndPop(d,ol.format.GML.GEOMETRY_SERIALIZERS_,ol.format.GML.GEOMETRY_NODE_FACTORY_,[b],c)};
|
|
ol.format.GML.writeFeature_=function(a,b,c){var d=b.getId();goog.isDef(d)&&a.setAttribute("fid",d);var d=c[c.length-1],e=goog.object.get(d,"featureNS"),f=b.getGeometryName();goog.isDef(d.serializers)||(d.serializers={},d.serializers[e]={});var g=b.getProperties();b=[];var h=[],k;for(k in g)b.push(k),h.push(g[k]),k==f?k in d.serializers[e]||(d.serializers[e][k]=ol.xml.makeChildAppender(ol.format.GML.writeGeometry_)):k in d.serializers[e]||(d.serializers[e][k]=ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode));
|
|
k=goog.object.clone(d);k.node=a;ol.xml.pushSerializeAndPop(k,d.serializers,ol.xml.OBJECT_PROPERTY_NODE_FACTORY,h,c,b)};ol.format.GML.writeFeatureMembers_=function(a,b,c){var d=c[c.length-1],e=goog.object.get(d,"featureType"),f=goog.object.get(d,"featureNS"),g={};g[f]={};g[f][e]=ol.xml.makeChildAppender(ol.format.GML.writeFeature_);d=goog.object.clone(d);d.node=a;ol.xml.pushSerializeAndPop(d,g,ol.xml.makeSimpleNodeFactory(e,f),b,c)};
|
|
ol.format.GML.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{surfaceMember:ol.xml.makeChildAppender(ol.format.GML.writeSurfaceOrPolygonMember_),polygonMember:ol.xml.makeChildAppender(ol.format.GML.writeSurfaceOrPolygonMember_)}};ol.format.GML.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{pointMember:ol.xml.makeChildAppender(ol.format.GML.writePointMember_)}};
|
|
ol.format.GML.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{lineStringMember:ol.xml.makeChildAppender(ol.format.GML.writeLineStringOrCurveMember_),curveMember:ol.xml.makeChildAppender(ol.format.GML.writeLineStringOrCurveMember_)}};ol.format.GML.RING_SERIALIZERS_={"http://www.opengis.net/gml":{exterior:ol.xml.makeChildAppender(ol.format.GML.writeRing_),interior:ol.xml.makeChildAppender(ol.format.GML.writeRing_)}};
|
|
ol.format.GML.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml":{Curve:ol.xml.makeChildAppender(ol.format.GML.writeCurveOrLineString_),MultiCurve:ol.xml.makeChildAppender(ol.format.GML.writeMultiCurveOrLineString_),Point:ol.xml.makeChildAppender(ol.format.GML.writePoint_),MultiPoint:ol.xml.makeChildAppender(ol.format.GML.writeMultiPoint_),LineString:ol.xml.makeChildAppender(ol.format.GML.writeCurveOrLineString_),MultiLineString:ol.xml.makeChildAppender(ol.format.GML.writeMultiCurveOrLineString_),
|
|
LinearRing:ol.xml.makeChildAppender(ol.format.GML.writeLinearRing_),Polygon:ol.xml.makeChildAppender(ol.format.GML.writeSurfaceOrPolygon_),MultiPolygon:ol.xml.makeChildAppender(ol.format.GML.writeMultiSurfaceOrPolygon_),Surface:ol.xml.makeChildAppender(ol.format.GML.writeSurfaceOrPolygon_),MultiSurface:ol.xml.makeChildAppender(ol.format.GML.writeMultiSurfaceOrPolygon_)}};
|
|
ol.format.GML.MULTIGEOMETRY_TO_MEMBER_NODENAME_={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};ol.format.GML.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(a,b,c){return ol.xml.createElementNS("http://www.opengis.net/gml",ol.format.GML.MULTIGEOMETRY_TO_MEMBER_NODENAME_[b[b.length-1].node.nodeName])};
|
|
ol.format.GML.GEOMETRY_NODE_FACTORY_=function(a,b,c){var d=b[b.length-1];b=goog.object.get(d,"multiSurface");c=goog.object.get(d,"surface");var e=goog.object.get(d,"curve"),d=goog.object.get(d,"multiCurve");a=a.getType();"MultiPolygon"===a&&!0===b?a="MultiSurface":"Polygon"===a&&!0===c?a="Surface":"LineString"===a&&!0===e?a="Curve":"MultiLineString"===a&&!0===d&&(a="MultiCurve");return ol.xml.createElementNS("http://www.opengis.net/gml",a)};
|
|
ol.format.GML.prototype.writeGeometryNode=function(a){var b=ol.xml.createElementNS("http://www.opengis.net/gml","geom");ol.xml.pushSerializeAndPop({node:b,srsName:this.srsName_,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_},ol.format.GML.GEOMETRY_SERIALIZERS_,ol.format.GML.GEOMETRY_NODE_FACTORY_,[a],[]);return b};
|
|
ol.format.GML.prototype.writeFeaturesNode=function(a){var b=ol.xml.createElementNS("http://www.opengis.net/gml","featureMembers");ol.xml.setAttributeNS(b,"http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation",this.schemaLocation_);ol.format.GML.writeFeatureMembers_(b,a,[{srsName:this.srsName_,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_,featureNS:this.featureNS_,featureType:this.featureType_}]);return b};ol.format.GPX=function(){ol.format.XMLFeature.call(this)};goog.inherits(ol.format.GPX,ol.format.XMLFeature);ol.format.GPX.NAMESPACE_URIS_=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"];
|
|
ol.format.GPX.appendCoordinate_=function(a,b,c){a.push(parseFloat(b.getAttribute("lon")),parseFloat(b.getAttribute("lat")));goog.object.containsKey(c,"ele")?(a.push(goog.object.get(c,"ele")),goog.object.remove(c,"ele")):a.push(0);goog.object.containsKey(c,"time")?(a.push(goog.object.get(c,"time")),goog.object.remove(c,"time")):a.push(0);return a};
|
|
ol.format.GPX.parseLink_=function(a,b){var c=b[b.length-1],d=a.getAttribute("href");goog.isNull(d)||goog.object.set(c,"link",d);ol.xml.parse(ol.format.GPX.LINK_PARSERS_,a,b)};ol.format.GPX.parseRtePt_=function(a,b){var c=ol.xml.pushParseAndPop({},ol.format.GPX.RTEPT_PARSERS_,a,b);if(goog.isDef(c)){var d=goog.object.get(b[b.length-1],"flatCoordinates");ol.format.GPX.appendCoordinate_(d,a,c)}};
|
|
ol.format.GPX.parseTrkPt_=function(a,b){var c=ol.xml.pushParseAndPop({},ol.format.GPX.TRKPT_PARSERS_,a,b);if(goog.isDef(c)){var d=goog.object.get(b[b.length-1],"flatCoordinates");ol.format.GPX.appendCoordinate_(d,a,c)}};ol.format.GPX.parseTrkSeg_=function(a,b){var c=b[b.length-1];ol.xml.parse(ol.format.GPX.TRKSEG_PARSERS_,a,b);var d=goog.object.get(c,"flatCoordinates");goog.object.get(c,"ends").push(d.length)};
|
|
ol.format.GPX.readRte_=function(a,b){var c=ol.xml.pushParseAndPop({flatCoordinates:[]},ol.format.GPX.RTE_PARSERS_,a,b);if(goog.isDef(c)){var d=goog.object.get(c,"flatCoordinates");goog.object.remove(c,"flatCoordinates");var e=new ol.geom.LineString(null);e.setFlatCoordinates(ol.geom.GeometryLayout.XYZM,d);d=new ol.Feature(e);d.setValues(c);return d}};
|
|
ol.format.GPX.readTrk_=function(a,b){var c=ol.xml.pushParseAndPop({flatCoordinates:[],ends:[]},ol.format.GPX.TRK_PARSERS_,a,b);if(goog.isDef(c)){var d=goog.object.get(c,"flatCoordinates");goog.object.remove(c,"flatCoordinates");var e=goog.object.get(c,"ends");goog.object.remove(c,"ends");var f=new ol.geom.MultiLineString(null);f.setFlatCoordinates(ol.geom.GeometryLayout.XYZM,d,e);d=new ol.Feature(f);d.setValues(c);return d}};
|
|
ol.format.GPX.readWpt_=function(a,b){var c=ol.xml.pushParseAndPop({},ol.format.GPX.WPT_PARSERS_,a,b);if(goog.isDef(c)){var d=ol.format.GPX.appendCoordinate_([],a,c),d=new ol.geom.Point(d,ol.geom.GeometryLayout.XYZM),d=new ol.Feature(d);d.setValues(c);return d}};ol.format.GPX.FEATURE_READER_={rte:ol.format.GPX.readRte_,trk:ol.format.GPX.readTrk_,wpt:ol.format.GPX.readWpt_};
|
|
ol.format.GPX.GPX_PARSERS_=ol.xml.makeParsersNS(ol.format.GPX.NAMESPACE_URIS_,{rte:ol.xml.makeArrayPusher(ol.format.GPX.readRte_),trk:ol.xml.makeArrayPusher(ol.format.GPX.readTrk_),wpt:ol.xml.makeArrayPusher(ol.format.GPX.readWpt_)});ol.format.GPX.LINK_PARSERS_=ol.xml.makeParsersNS(ol.format.GPX.NAMESPACE_URIS_,{text:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,"linkText"),type:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,"linkType")});
|
|
ol.format.GPX.RTE_PARSERS_=ol.xml.makeParsersNS(ol.format.GPX.NAMESPACE_URIS_,{name:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),cmt:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),desc:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),src:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),link:ol.format.GPX.parseLink_,number:ol.xml.makeObjectPropertySetter(ol.format.XSD.readNonNegativeInteger),type:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),rtept:ol.format.GPX.parseRtePt_});
|
|
ol.format.GPX.RTEPT_PARSERS_=ol.xml.makeParsersNS(ol.format.GPX.NAMESPACE_URIS_,{ele:ol.xml.makeObjectPropertySetter(ol.format.XSD.readDecimal),time:ol.xml.makeObjectPropertySetter(ol.format.XSD.readDateTime)});
|
|
ol.format.GPX.TRK_PARSERS_=ol.xml.makeParsersNS(ol.format.GPX.NAMESPACE_URIS_,{name:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),cmt:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),desc:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),src:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),link:ol.format.GPX.parseLink_,number:ol.xml.makeObjectPropertySetter(ol.format.XSD.readNonNegativeInteger),type:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),trkseg:ol.format.GPX.parseTrkSeg_});
|
|
ol.format.GPX.TRKSEG_PARSERS_=ol.xml.makeParsersNS(ol.format.GPX.NAMESPACE_URIS_,{trkpt:ol.format.GPX.parseTrkPt_});ol.format.GPX.TRKPT_PARSERS_=ol.xml.makeParsersNS(ol.format.GPX.NAMESPACE_URIS_,{ele:ol.xml.makeObjectPropertySetter(ol.format.XSD.readDecimal),time:ol.xml.makeObjectPropertySetter(ol.format.XSD.readDateTime)});
|
|
ol.format.GPX.WPT_PARSERS_=ol.xml.makeParsersNS(ol.format.GPX.NAMESPACE_URIS_,{ele:ol.xml.makeObjectPropertySetter(ol.format.XSD.readDecimal),time:ol.xml.makeObjectPropertySetter(ol.format.XSD.readDateTime),magvar:ol.xml.makeObjectPropertySetter(ol.format.XSD.readDecimal),geoidheight:ol.xml.makeObjectPropertySetter(ol.format.XSD.readDecimal),name:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),cmt:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),desc:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
|
|
src:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),link:ol.format.GPX.parseLink_,sym:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),type:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),fix:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),sat:ol.xml.makeObjectPropertySetter(ol.format.XSD.readNonNegativeInteger),hdop:ol.xml.makeObjectPropertySetter(ol.format.XSD.readDecimal),vdop:ol.xml.makeObjectPropertySetter(ol.format.XSD.readDecimal),pdop:ol.xml.makeObjectPropertySetter(ol.format.XSD.readDecimal),
|
|
ageofdgpsdata:ol.xml.makeObjectPropertySetter(ol.format.XSD.readDecimal),dgpsid:ol.xml.makeObjectPropertySetter(ol.format.XSD.readNonNegativeInteger)});ol.format.GPX.prototype.readFeatureFromNode=function(a){if(-1==goog.array.indexOf(ol.format.GPX.NAMESPACE_URIS_,a.namespaceURI))return null;var b=ol.format.GPX.FEATURE_READER_[a.localName];if(!goog.isDef(b))return null;a=b(a,[]);return goog.isDef(a)?a:null};
|
|
ol.format.GPX.prototype.readFeaturesFromNode=function(a){return-1==goog.array.indexOf(ol.format.GPX.NAMESPACE_URIS_,a.namespaceURI)?[]:"gpx"==a.localName&&(a=ol.xml.pushParseAndPop([],ol.format.GPX.GPX_PARSERS_,a,[]),goog.isDef(a))?a:[]};ol.format.GPX.prototype.readProjectionFromDocument=function(a){return ol.proj.get("EPSG:4326")};ol.format.GPX.prototype.readProjectionFromNode=function(a){return ol.proj.get("EPSG:4326")};
|
|
ol.format.GPX.writeLink_=function(a,b,c){a.setAttribute("href",b);b=goog.object.get(c[c.length-1],"properties");b=[goog.object.get(b,"linkText"),goog.object.get(b,"linkType")];ol.xml.pushSerializeAndPop({node:a},ol.format.GPX.LINK_SERIALIZERS_,ol.xml.OBJECT_PROPERTY_NODE_FACTORY,b,c,ol.format.GPX.LINK_SEQUENCE_)};
|
|
ol.format.GPX.writeWptType_=function(a,b,c){var d=c[c.length-1],e=d.node.namespaceURI,f=goog.object.get(d,"properties");ol.xml.setAttributeNS(a,null,"lat",b[1]);ol.xml.setAttributeNS(a,null,"lon",b[0]);switch(goog.object.get(d,"geometryLayout")){case ol.geom.GeometryLayout.XYZM:0!==b[3]&&goog.object.set(f,"time",b[3]);case ol.geom.GeometryLayout.XYZ:0!==b[2]&&goog.object.set(f,"ele",b[2]);break;case ol.geom.GeometryLayout.XYM:0!==b[2]&&goog.object.set(f,"time",b[2])}b=ol.format.GPX.WPT_TYPE_SEQUENCE_[e];
|
|
d=ol.xml.makeSequence(f,b);ol.xml.pushSerializeAndPop({node:a,properties:f},ol.format.GPX.WPT_TYPE_SERIALIZERS_,ol.xml.OBJECT_PROPERTY_NODE_FACTORY,d,c,b)};
|
|
ol.format.GPX.writeRte_=function(a,b,c){var d=b.getProperties();a={node:a,properties:d};b=b.getGeometry();goog.isDef(b)&&(goog.object.set(a,"geometryLayout",b.getLayout()),goog.object.set(d,"rtept",b.getCoordinates()));b=ol.format.GPX.RTE_SEQUENCE_[c[c.length-1].node.namespaceURI];d=ol.xml.makeSequence(d,b);ol.xml.pushSerializeAndPop(a,ol.format.GPX.RTE_SERIALIZERS_,ol.xml.OBJECT_PROPERTY_NODE_FACTORY,d,c,b)};
|
|
ol.format.GPX.writeTrk_=function(a,b,c){var d=b.getProperties();a={node:a,properties:d};b=b.getGeometry();goog.isDef(b)&&goog.object.set(d,"trkseg",b.getLineStrings());b=ol.format.GPX.TRK_SEQUENCE_[c[c.length-1].node.namespaceURI];d=ol.xml.makeSequence(d,b);ol.xml.pushSerializeAndPop(a,ol.format.GPX.TRK_SERIALIZERS_,ol.xml.OBJECT_PROPERTY_NODE_FACTORY,d,c,b)};
|
|
ol.format.GPX.writeTrkSeg_=function(a,b,c){a={node:a,geometryLayout:b.getLayout(),properties:{}};ol.xml.pushSerializeAndPop(a,ol.format.GPX.TRKSEG_SERIALIZERS_,ol.format.GPX.TRKSEG_NODE_FACTORY_,b.getCoordinates(),c)};ol.format.GPX.writeWpt_=function(a,b,c){var d=c[c.length-1];goog.object.set(d,"properties",b.getProperties());b=b.getGeometry();goog.isDef(b)&&(goog.object.set(d,"geometryLayout",b.getLayout()),ol.format.GPX.writeWptType_(a,b.getCoordinates(),c))};
|
|
ol.format.GPX.LINK_SEQUENCE_=["text","type"];ol.format.GPX.LINK_SERIALIZERS_=ol.xml.makeStructureNS(ol.format.GPX.NAMESPACE_URIS_,{text:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),type:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode)});ol.format.GPX.RTE_SEQUENCE_=ol.xml.makeStructureNS(ol.format.GPX.NAMESPACE_URIS_,"name cmt desc src link number type rtept".split(" "));
|
|
ol.format.GPX.RTE_SERIALIZERS_=ol.xml.makeStructureNS(ol.format.GPX.NAMESPACE_URIS_,{name:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),cmt:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),desc:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),src:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),link:ol.xml.makeChildAppender(ol.format.GPX.writeLink_),number:ol.xml.makeChildAppender(ol.format.XSD.writeNonNegativeIntegerTextNode),type:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),
|
|
rtept:ol.xml.makeArraySerializer(ol.xml.makeChildAppender(ol.format.GPX.writeWptType_))});ol.format.GPX.TRK_SEQUENCE_=ol.xml.makeStructureNS(ol.format.GPX.NAMESPACE_URIS_,"name cmt desc src link number type trkseg".split(" "));
|
|
ol.format.GPX.TRK_SERIALIZERS_=ol.xml.makeStructureNS(ol.format.GPX.NAMESPACE_URIS_,{name:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),cmt:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),desc:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),src:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),link:ol.xml.makeChildAppender(ol.format.GPX.writeLink_),number:ol.xml.makeChildAppender(ol.format.XSD.writeNonNegativeIntegerTextNode),type:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),
|
|
trkseg:ol.xml.makeArraySerializer(ol.xml.makeChildAppender(ol.format.GPX.writeTrkSeg_))});ol.format.GPX.TRKSEG_NODE_FACTORY_=ol.xml.makeSimpleNodeFactory("trkpt");ol.format.GPX.TRKSEG_SERIALIZERS_=ol.xml.makeStructureNS(ol.format.GPX.NAMESPACE_URIS_,{trkpt:ol.xml.makeChildAppender(ol.format.GPX.writeWptType_)});ol.format.GPX.WPT_TYPE_SEQUENCE_=ol.xml.makeStructureNS(ol.format.GPX.NAMESPACE_URIS_,"ele time magvar geoidheight name cmt desc src link sym type fix sat hdop vdop pdop ageofdgpsdata dgpsid".split(" "));
|
|
ol.format.GPX.WPT_TYPE_SERIALIZERS_=ol.xml.makeStructureNS(ol.format.GPX.NAMESPACE_URIS_,{ele:ol.xml.makeChildAppender(ol.format.XSD.writeDecimalTextNode),time:ol.xml.makeChildAppender(ol.format.XSD.writeDateTimeTextNode),magvar:ol.xml.makeChildAppender(ol.format.XSD.writeDecimalTextNode),geoidheight:ol.xml.makeChildAppender(ol.format.XSD.writeDecimalTextNode),name:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),cmt:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),desc:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),
|
|
src:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),link:ol.xml.makeChildAppender(ol.format.GPX.writeLink_),sym:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),type:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),fix:ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode),sat:ol.xml.makeChildAppender(ol.format.XSD.writeNonNegativeIntegerTextNode),hdop:ol.xml.makeChildAppender(ol.format.XSD.writeDecimalTextNode),vdop:ol.xml.makeChildAppender(ol.format.XSD.writeDecimalTextNode),
|
|
pdop:ol.xml.makeChildAppender(ol.format.XSD.writeDecimalTextNode),ageofdgpsdata:ol.xml.makeChildAppender(ol.format.XSD.writeDecimalTextNode),dgpsid:ol.xml.makeChildAppender(ol.format.XSD.writeNonNegativeIntegerTextNode)});ol.format.GPX.GEOMETRY_TYPE_TO_NODENAME_={Point:"wpt",LineString:"rte",MultiLineString:"trk"};ol.format.GPX.GPX_NODE_FACTORY_=function(a,b,c){a=a.getGeometry();if(goog.isDef(a))return ol.xml.createElementNS(b[b.length-1].node.namespaceURI,ol.format.GPX.GEOMETRY_TYPE_TO_NODENAME_[a.getType()])};
|
|
ol.format.GPX.GPX_SERIALIZERS_=ol.xml.makeStructureNS(ol.format.GPX.NAMESPACE_URIS_,{rte:ol.xml.makeChildAppender(ol.format.GPX.writeRte_),trk:ol.xml.makeChildAppender(ol.format.GPX.writeTrk_),wpt:ol.xml.makeChildAppender(ol.format.GPX.writeWpt_)});ol.format.GPX.V1_1=function(){ol.format.GPX.call(this)};goog.inherits(ol.format.GPX.V1_1,ol.format.GPX);
|
|
ol.format.GPX.V1_1.prototype.writeFeaturesNode=function(a){var b=ol.xml.createElementNS("http://www.topografix.com/GPX/1/1","gpx");ol.xml.pushSerializeAndPop({node:b},ol.format.GPX.GPX_SERIALIZERS_,ol.format.GPX.GPX_NODE_FACTORY_,a,[]);return b};goog.json={};goog.json.isValid_=function(a){return/^\s*$/.test(a)?!1:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,""))};goog.json.parse=function(a){a=String(a);if(goog.json.isValid_(a))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);};goog.json.unsafeParse=function(a){return eval("("+a+")")};
|
|
goog.json.serialize=function(a,b){return(new goog.json.Serializer(b)).serialize(a)};goog.json.Serializer=function(a){this.replacer_=a};goog.json.Serializer.prototype.serialize=function(a){var b=[];this.serialize_(a,b);return b.join("")};
|
|
goog.json.Serializer.prototype.serialize_=function(a,b){switch(typeof a){case "string":this.serializeString_(a,b);break;case "number":this.serializeNumber_(a,b);break;case "boolean":b.push(a);break;case "undefined":b.push("null");break;case "object":if(null==a){b.push("null");break}if(goog.isArray(a)){this.serializeArray(a,b);break}this.serializeObject_(a,b);break;case "function":break;default:throw Error("Unknown type: "+typeof a);}};
|
|
goog.json.Serializer.charToJsonCharCache_={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"};goog.json.Serializer.charsToReplace_=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
|
|
goog.json.Serializer.prototype.serializeString_=function(a,b){b.push('"',a.replace(goog.json.Serializer.charsToReplace_,function(a){if(a in goog.json.Serializer.charToJsonCharCache_)return goog.json.Serializer.charToJsonCharCache_[a];var b=a.charCodeAt(0),e="\\u";16>b?e+="000":256>b?e+="00":4096>b&&(e+="0");return goog.json.Serializer.charToJsonCharCache_[a]=e+b.toString(16)}),'"')};goog.json.Serializer.prototype.serializeNumber_=function(a,b){b.push(isFinite(a)&&!isNaN(a)?a:"null")};
|
|
goog.json.Serializer.prototype.serializeArray=function(a,b){var c=a.length;b.push("[");for(var d="",e=0;e<c;e++)b.push(d),d=a[e],this.serialize_(this.replacer_?this.replacer_.call(a,String(e),d):d,b),d=",";b.push("]")};
|
|
goog.json.Serializer.prototype.serializeObject_=function(a,b){b.push("{");var c="",d;for(d in a)if(Object.prototype.hasOwnProperty.call(a,d)){var e=a[d];"function"!=typeof e&&(b.push(c),this.serializeString_(d,b),b.push(":"),this.serialize_(this.replacer_?this.replacer_.call(a,d,e):e,b),c=",")}b.push("}")};ol.format.JSONFeature=function(){ol.format.Feature.call(this)};goog.inherits(ol.format.JSONFeature,ol.format.Feature);ol.format.JSONFeature.prototype.getObject_=function(a){return goog.isObject(a)?a:goog.isString(a)?(a=goog.json.parse(a),goog.isDef(a)?a:null):null};ol.format.JSONFeature.prototype.getType=function(){return ol.format.FormatType.JSON};ol.format.JSONFeature.prototype.readFeature=function(a){return this.readFeatureFromObject(this.getObject_(a))};
|
|
ol.format.JSONFeature.prototype.readFeatures=function(a){return this.readFeaturesFromObject(this.getObject_(a))};ol.format.JSONFeature.prototype.readGeometry=function(a){return this.readGeometryFromObject(this.getObject_(a))};ol.format.JSONFeature.prototype.readProjection=function(a){return this.readProjectionFromObject(this.getObject_(a))};ol.format.JSONFeature.prototype.writeFeature=function(a){return this.writeFeatureObject(a)};ol.format.JSONFeature.prototype.writeFeatures=function(a){return this.writeFeaturesObject(a)};
|
|
ol.format.JSONFeature.prototype.writeGeometry=function(a){return this.writeGeometryObject(a)};ol.format.GeoJSON=function(a){a=goog.isDef(a)?a:{};ol.format.JSONFeature.call(this);this.defaultProjection_=ol.proj.get(a.defaultProjection?a.defaultProjection:"EPSG:4326")};goog.inherits(ol.format.GeoJSON,ol.format.JSONFeature);ol.format.GeoJSON.EXTENSIONS_=[".geojson"];ol.format.GeoJSON.readGeometry_=function(a){return goog.isNull(a)?null:(0,ol.format.GeoJSON.GEOMETRY_READERS_[a.type])(a)};
|
|
ol.format.GeoJSON.readGeometryCollectionGeometry_=function(a){a=goog.array.map(a.geometries,ol.format.GeoJSON.readGeometry_);return new ol.geom.GeometryCollection(a)};ol.format.GeoJSON.readPointGeometry_=function(a){return new ol.geom.Point(a.coordinates)};ol.format.GeoJSON.readLineStringGeometry_=function(a){return new ol.geom.LineString(a.coordinates)};ol.format.GeoJSON.readMultiLineStringGeometry_=function(a){return new ol.geom.MultiLineString(a.coordinates)};
|
|
ol.format.GeoJSON.readMultiPointGeometry_=function(a){return new ol.geom.MultiPoint(a.coordinates)};ol.format.GeoJSON.readMultiPolygonGeometry_=function(a){return new ol.geom.MultiPolygon(a.coordinates)};ol.format.GeoJSON.readPolygonGeometry_=function(a){return new ol.geom.Polygon(a.coordinates)};ol.format.GeoJSON.writeGeometry_=function(a){return(0,ol.format.GeoJSON.GEOMETRY_WRITERS_[a.getType()])(a)};
|
|
ol.format.GeoJSON.writeEmptyGeometryCollectionGeometry_=function(a){return{type:"GeometryCollection",geometries:[]}};ol.format.GeoJSON.writeGeometryCollectionGeometry_=function(a){return{type:"GeometryCollection",geometries:goog.array.map(a.getGeometriesArray(),ol.format.GeoJSON.writeGeometry_)}};ol.format.GeoJSON.writeLineStringGeometry_=function(a){return{type:"LineString",coordinates:a.getCoordinates()}};
|
|
ol.format.GeoJSON.writeMultiLineStringGeometry_=function(a){return{type:"MultiLineString",coordinates:a.getCoordinates()}};ol.format.GeoJSON.writeMultiPointGeometry_=function(a){return{type:"MultiPoint",coordinates:a.getCoordinates()}};ol.format.GeoJSON.writeMultiPolygonGeometry_=function(a){return{type:"MultiPolygon",coordinates:a.getCoordinates()}};ol.format.GeoJSON.writePointGeometry_=function(a){return{type:"Point",coordinates:a.getCoordinates()}};
|
|
ol.format.GeoJSON.writePolygonGeometry_=function(a){return{type:"Polygon",coordinates:a.getCoordinates()}};ol.format.GeoJSON.GEOMETRY_READERS_={Point:ol.format.GeoJSON.readPointGeometry_,LineString:ol.format.GeoJSON.readLineStringGeometry_,Polygon:ol.format.GeoJSON.readPolygonGeometry_,MultiPoint:ol.format.GeoJSON.readMultiPointGeometry_,MultiLineString:ol.format.GeoJSON.readMultiLineStringGeometry_,MultiPolygon:ol.format.GeoJSON.readMultiPolygonGeometry_,GeometryCollection:ol.format.GeoJSON.readGeometryCollectionGeometry_};
|
|
ol.format.GeoJSON.GEOMETRY_WRITERS_={Point:ol.format.GeoJSON.writePointGeometry_,LineString:ol.format.GeoJSON.writeLineStringGeometry_,Polygon:ol.format.GeoJSON.writePolygonGeometry_,MultiPoint:ol.format.GeoJSON.writeMultiPointGeometry_,MultiLineString:ol.format.GeoJSON.writeMultiLineStringGeometry_,MultiPolygon:ol.format.GeoJSON.writeMultiPolygonGeometry_,GeometryCollection:ol.format.GeoJSON.writeGeometryCollectionGeometry_,Circle:ol.format.GeoJSON.writeEmptyGeometryCollectionGeometry_};
|
|
ol.format.GeoJSON.prototype.getExtensions=function(){return ol.format.GeoJSON.EXTENSIONS_};ol.format.GeoJSON.prototype.readFeatureFromObject=function(a){var b=ol.format.GeoJSON.readGeometry_(a.geometry),b=new ol.Feature(b);goog.isDef(a.id)&&b.setId(a.id);goog.isDef(a.properties)&&b.setValues(a.properties);return b};
|
|
ol.format.GeoJSON.prototype.readFeaturesFromObject=function(a){if("Feature"==a.type)return[this.readFeatureFromObject(a)];if("FeatureCollection"==a.type){var b=[];a=a.features;var c,d;c=0;for(d=a.length;c<d;++c)b.push(this.readFeatureFromObject(a[c]));return b}return[]};ol.format.GeoJSON.prototype.readGeometryFromObject=function(a){return ol.format.GeoJSON.readGeometry_(a)};
|
|
ol.format.GeoJSON.prototype.readProjection=function(a){a=a.crs;return goog.isDefAndNotNull(a)?"name"==a.type?ol.proj.get(a.properties.name):"EPSG"==a.type?ol.proj.get("EPSG:"+a.properties.code):null:this.defaultProjection_};
|
|
ol.format.GeoJSON.prototype.writeFeatureObject=function(a){var b={type:"Feature"},c=a.getId();goog.isDefAndNotNull(c)&&goog.object.set(b,"id",c);c=a.getGeometry();goog.isDefAndNotNull(c)&&goog.object.set(b,"geometry",ol.format.GeoJSON.writeGeometry_(c));a=a.getProperties();goog.object.remove(a,"geometry");goog.object.isEmpty(a)||goog.object.set(b,"properties",a);return b};
|
|
ol.format.GeoJSON.prototype.writeFeaturesObject=function(a){var b=[],c,d;c=0;for(d=a.length;c<d;++c)b.push(this.writeFeatureObject(a[c]));return{type:"FeatureCollection",features:b}};ol.format.GeoJSON.prototype.writeGeometryObject=ol.format.GeoJSON.writeGeometry_;goog.string.newlines={};goog.string.newlines.splitLines=function(a,b){var c=goog.string.newlines.getLines(a);return goog.array.map(c,function(a){return b?a.getFullLine():a.getContent()})};goog.string.newlines.Line=function(a,b,c,d){this.string=a;this.startLineIndex=b;this.endContentIndex=c;this.endLineIndex=d};goog.string.newlines.Line.prototype.getContent=function(){return this.string.substring(this.startLineIndex,this.endContentIndex)};
|
|
goog.string.newlines.Line.prototype.getFullLine=function(){return this.string.substring(this.startLineIndex,this.endLineIndex)};goog.string.newlines.Line.prototype.getNewline=function(){return this.string.substring(this.endContentIndex,this.endLineIndex)};
|
|
goog.string.newlines.getLines=function(a){for(var b=RegExp("\r\n|\r|\n","g"),c=0,d,e=[];d=b.exec(a);)c=new goog.string.newlines.Line(a,c,d.index,d.index+d[0].length),e.push(c),c=b.lastIndex;c<a.length&&(c=new goog.string.newlines.Line(a,c,a.length,a.length),e.push(c));return e};ol.format.TextFeature=function(){ol.format.Feature.call(this)};goog.inherits(ol.format.TextFeature,ol.format.Feature);ol.format.TextFeature.prototype.getText_=function(a){return goog.isString(a)?a:""};ol.format.TextFeature.prototype.getType=function(){return ol.format.FormatType.TEXT};ol.format.TextFeature.prototype.readFeature=function(a){return this.readFeatureFromText(this.getText_(a))};ol.format.TextFeature.prototype.readFeatures=function(a){return this.readFeaturesFromText(this.getText_(a))};
|
|
ol.format.TextFeature.prototype.readGeometry=function(a){return this.readGeometryFromText(this.getText_(a))};ol.format.TextFeature.prototype.readProjection=function(a){return this.readProjectionFromText(this.getText_(a))};ol.format.TextFeature.prototype.writeFeature=function(a){return this.writeFeatureText(a)};ol.format.TextFeature.prototype.writeFeatures=function(a){return this.writeFeaturesText(a)};ol.format.TextFeature.prototype.writeGeometry=function(a){return this.writeGeometryText(a)};ol.format.IGCZ={BAROMETRIC:"barometric",GPS:"gps",NONE:"none"};ol.format.IGC=function(a){a=goog.isDef(a)?a:{};ol.format.TextFeature.call(this);this.altitudeMode_=goog.isDef(a.altitudeMode)?a.altitudeMode:ol.format.IGCZ.NONE};goog.inherits(ol.format.IGC,ol.format.TextFeature);ol.format.IGC.EXTENSIONS_=[".igc"];ol.format.IGC.B_RECORD_RE_=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/;ol.format.IGC.H_RECORD_RE_=/^H.([A-Z]{3}).*?:(.*)/;
|
|
ol.format.IGC.HFDTE_RECORD_RE_=/^HFDTE(\d{2})(\d{2})(\d{2})/;ol.format.IGC.prototype.getExtensions=function(){return ol.format.IGC.EXTENSIONS_};
|
|
ol.format.IGC.prototype.readFeatureFromText=function(a){var b=this.altitudeMode_,c=goog.string.newlines.splitLines(a);a={};var d=[],e=2E3,f=0,g=1,h,k;h=0;for(k=c.length;h<k;++h){var l=c[h],m;if("B"==l.charAt(0)){if(m=ol.format.IGC.B_RECORD_RE_.exec(l)){var l=parseInt(m[1],10),n=parseInt(m[2],10),p=parseInt(m[3],10),r=parseInt(m[4],10)+parseInt(m[5],10)/6E4;"S"==m[6]&&(r=-r);var q=parseInt(m[7],10)+parseInt(m[8],10)/6E4;"W"==m[9]&&(q=-q);d.push(q,r);b!=ol.format.IGCZ.NONE&&(m=b==ol.format.IGCZ.GPS?
|
|
parseInt(m[11],10):b==ol.format.IGCZ.BAROMETRIC?parseInt(m[12],10):0,d.push(m));m=Date.UTC(e,f,g,l,n,p);d.push(m/1E3)}}else if("H"==l.charAt(0))if(m=ol.format.IGC.HFDTE_RECORD_RE_.exec(l))g=parseInt(m[1],10),f=parseInt(m[2],10)-1,e=2E3+parseInt(m[3],10);else if(m=ol.format.IGC.H_RECORD_RE_.exec(l))a[m[1]]=goog.string.trim(m[2]),ol.format.IGC.HFDTE_RECORD_RE_.exec(l)}c=new ol.geom.LineString(null);c.setFlatCoordinates(b==ol.format.IGCZ.NONE?ol.geom.GeometryLayout.XYM:ol.geom.GeometryLayout.XYZM,d);
|
|
b=new ol.Feature(c);b.setValues(a);return b};ol.format.IGC.prototype.readFeaturesFromText=function(a){a=this.readFeatureFromText(a);return goog.isNull(a)?[]:[a]};ol.format.IGC.prototype.readProjectionFromText=function(a){return ol.proj.get("EPSG:4326")};ol.format.KML=function(a){a=goog.isDef(a)?a:{};ol.format.XMLFeature.call(this);var b=goog.isDef(a.defaultStyle)?a.defaultStyle:ol.format.KML.DEFAULT_STYLE_ARRAY_,c={},d=function(a){return goog.isArray(a)?a:goog.isString(a)?(!(a in c)&&"#"+a in c&&(a="#"+a),d(c[a])):b};this.sharedStyles_=c;this.featureStyleFunction_=function(a){a=this.get("Style");if(goog.isDef(a))return a;a=this.get("styleUrl");return goog.isDef(a)?d(a):b}};goog.inherits(ol.format.KML,ol.format.XMLFeature);
|
|
ol.format.KML.EXTENSIONS_=[".kml"];ol.format.KML.GX_NAMESPACE_URIS_=["http://www.google.com/kml/ext/2.2"];ol.format.KML.NAMESPACE_URIS_=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"];ol.format.KML.DEFAULT_COLOR_=[255,255,255,1];ol.format.KML.DEFAULT_FILL_STYLE_=new ol.style.Fill({color:ol.format.KML.DEFAULT_COLOR_});ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_=[2,20];
|
|
ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS_=ol.style.IconAnchorUnits.PIXELS;ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS_=ol.style.IconAnchorUnits.PIXELS;ol.format.KML.DEFAULT_IMAGE_STYLE_SIZE_=[32,32];ol.format.KML.DEFAULT_IMAGE_STYLE_SRC_="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png";
|
|
ol.format.KML.DEFAULT_IMAGE_STYLE_=new ol.style.Icon({anchor:ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_,anchorXUnits:ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS_,anchorYUnits:ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS_,crossOrigin:"anonymous",rotation:0,scale:1,size:ol.format.KML.DEFAULT_IMAGE_STYLE_SIZE_,src:ol.format.KML.DEFAULT_IMAGE_STYLE_SRC_});ol.format.KML.DEFAULT_STROKE_STYLE_=new ol.style.Stroke({color:ol.format.KML.DEFAULT_COLOR_,width:1});
|
|
ol.format.KML.DEFAULT_STYLE_=new ol.style.Style({fill:ol.format.KML.DEFAULT_FILL_STYLE_,image:ol.format.KML.DEFAULT_IMAGE_STYLE_,text:null,stroke:ol.format.KML.DEFAULT_STROKE_STYLE_,zIndex:0});ol.format.KML.DEFAULT_STYLE_ARRAY_=[ol.format.KML.DEFAULT_STYLE_];ol.format.KML.ICON_ANCHOR_UNITS_MAP_={fraction:ol.style.IconAnchorUnits.FRACTION,pixels:ol.style.IconAnchorUnits.PIXELS};
|
|
ol.format.KML.readColor_=function(a){a=ol.xml.getAllTextContent(a,!1);if(a=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(a))return a=a[1],[parseInt(a.substr(6,2),16),parseInt(a.substr(4,2),16),parseInt(a.substr(2,2),16),parseInt(a.substr(0,2),16)/255]};
|
|
ol.format.KML.readFlatCoordinates_=function(a){a=ol.xml.getAllTextContent(a,!1);for(var b=[],c=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?))?\s*/i,d;d=c.exec(a);){var e=parseFloat(d[1]),f=parseFloat(d[2]),g=d[3]?parseFloat(d[3]):0;b.push(e,f,g);a=a.substr(d[0].length)}return""!==a?void 0:b};
|
|
ol.format.KML.readStyleUrl_=function(a){var b=goog.string.trim(ol.xml.getAllTextContent(a,!1));return goog.isDefAndNotNull(a.baseURI)?goog.Uri.resolve(a.baseURI,b).toString():b};ol.format.KML.readURI_=function(a){var b=ol.xml.getAllTextContent(a,!1);return goog.isDefAndNotNull(a.baseURI)?goog.Uri.resolve(a.baseURI,goog.string.trim(b)).toString():goog.string.trim(b)};
|
|
ol.format.KML.readVec2_=function(a){var b=a.getAttribute("xunits"),c=a.getAttribute("yunits");return{x:parseFloat(a.getAttribute("x")),xunits:ol.format.KML.ICON_ANCHOR_UNITS_MAP_[b],y:parseFloat(a.getAttribute("y")),yunits:ol.format.KML.ICON_ANCHOR_UNITS_MAP_[c]}};ol.format.KML.readScale_=function(a){a=ol.format.XSD.readDecimal(a);if(goog.isDef(a))return Math.sqrt(a)};ol.format.KML.readStyleMapValue_=function(a,b){return ol.xml.pushParseAndPop(void 0,ol.format.KML.STYLE_MAP_PARSERS_,a,b)};
|
|
ol.format.KML.IconStyleParser_=function(a,b){var c=ol.xml.pushParseAndPop({},ol.format.KML.ICON_STYLE_PARSERS_,a,b);if(goog.isDef(c)){var d=b[b.length-1],e=goog.object.get(c,"Icon",{}),e=goog.object.get(e,"href"),e=goog.isDef(e)?e:ol.format.KML.DEFAULT_IMAGE_STYLE_SRC_,f,g,h,k=goog.object.get(c,"hotSpot");goog.isDef(k)?(f=[k.x,k.y],g=k.xunits,h=k.yunits):e===ol.format.KML.DEFAULT_IMAGE_STYLE_SRC_?(f=ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_,g=ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS_,h=ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS_):
|
|
/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(e)&&(f=[0.5,1],h=g=ol.style.IconAnchorUnits.FRACTION);var l,k=goog.object.get(c,"heading");goog.isDef(k)&&(l=goog.math.toRadians(k));var c=goog.object.get(c,"scale"),m;e==ol.format.KML.DEFAULT_IMAGE_STYLE_SRC_&&(m=ol.format.KML.DEFAULT_IMAGE_STYLE_SIZE_);f=new ol.style.Icon({anchor:f,anchorOrigin:ol.style.IconAnchorOrigin.TOP_LEFT,anchorXUnits:g,anchorYUnits:h,crossOrigin:"anonymous",rotation:l,scale:c,size:m,src:e});goog.object.set(d,"imageStyle",
|
|
f)}};ol.format.KML.LineStyleParser_=function(a,b){var c=ol.xml.pushParseAndPop({},ol.format.KML.LINE_STYLE_PARSERS_,a,b);if(goog.isDef(c)){var d=b[b.length-1],c=new ol.style.Stroke({color:goog.object.get(c,"color",ol.format.KML.DEFAULT_COLOR_),width:goog.object.get(c,"width",1)});goog.object.set(d,"strokeStyle",c)}};
|
|
ol.format.KML.PolyStyleParser_=function(a,b){var c=ol.xml.pushParseAndPop({},ol.format.KML.POLY_STYLE_PARSERS_,a,b);if(goog.isDef(c)){var d=b[b.length-1],e=new ol.style.Fill({color:goog.object.get(c,"color",ol.format.KML.DEFAULT_COLOR_)});goog.object.set(d,"fillStyle",e);e=goog.object.get(c,"fill");goog.isDef(e)&&goog.object.set(d,"fill",e);c=goog.object.get(c,"outline");goog.isDef(c)&&goog.object.set(d,"outline",c)}};
|
|
ol.format.KML.readFlatLinearRing_=function(a,b){return ol.xml.pushParseAndPop(null,ol.format.KML.FLAT_LINEAR_RING_PARSERS_,a,b)};ol.format.KML.gxCoordParser_=function(a,b){var c=b[b.length-1].flatCoordinates,d=ol.xml.getAllTextContent(a,!1),e=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(d);if(e){var d=parseFloat(e[1]),f=parseFloat(e[2]),e=parseFloat(e[3]);c.push(d,f,e,0)}else c.push(0,0,0,0)};
|
|
ol.format.KML.readGxMultiTrack_=function(a,b){var c=ol.xml.pushParseAndPop([],ol.format.KML.GX_MULTITRACK_GEOMETRY_PARSERS_,a,b);if(goog.isDef(c)){var d=new ol.geom.MultiLineString(null);d.setLineStrings(c);return d}};
|
|
ol.format.KML.readGxTrack_=function(a,b){var c=ol.xml.pushParseAndPop({flatCoordinates:[],whens:[]},ol.format.KML.GX_TRACK_PARSERS_,a,b);if(goog.isDef(c)){var d=c.flatCoordinates,c=c.whens,e,f;e=0;for(f=Math.min(d.length,c.length);e<f;++e)d[4*e+3]=c[e];c=new ol.geom.LineString(null);c.setFlatCoordinates(ol.geom.GeometryLayout.XYZM,d);return c}};ol.format.KML.readIcon_=function(a,b){var c=ol.xml.pushParseAndPop({},ol.format.KML.ICON_PARSERS_,a,b);return goog.isDef(c)?c:null};
|
|
ol.format.KML.readFlatCoordinatesFromNode_=function(a,b){return ol.xml.pushParseAndPop(null,ol.format.KML.GEOMETRY_FLAT_COORDINATES_PARSERS_,a,b)};ol.format.KML.readLineString_=function(a,b){var c=ol.format.KML.readFlatCoordinatesFromNode_(a,b);if(goog.isDef(c)){var d=new ol.geom.LineString(null);d.setFlatCoordinates(ol.geom.GeometryLayout.XYZ,c);return d}};
|
|
ol.format.KML.readLinearRing_=function(a,b){var c=ol.format.KML.readFlatCoordinatesFromNode_(a,b);if(goog.isDef(c)){var d=new ol.geom.Polygon(null);d.setFlatCoordinates(ol.geom.GeometryLayout.XYZ,c,[c.length]);return d}};
|
|
ol.format.KML.readMultiGeometry_=function(a,b){var c=ol.xml.pushParseAndPop([],ol.format.KML.MULTI_GEOMETRY_PARSERS_,a,b);if(!goog.isDef(c))return null;if(0===c.length)return new ol.geom.GeometryCollection(c);var d=!0,e=c[0].getType(),f,g,h;g=1;for(h=c.length;g<h;++g)if(f=c[g],f.getType()!=e){d=!1;break}if(d){if(e==ol.geom.GeometryType.POINT){f=c[0];d=f.getLayout();e=f.getFlatCoordinates();g=1;for(h=c.length;g<h;++g)f=c[g],goog.array.extend(e,f.getFlatCoordinates());c=new ol.geom.MultiPoint(null);
|
|
c.setFlatCoordinates(d,e);return c}return e==ol.geom.GeometryType.LINE_STRING?(f=new ol.geom.MultiLineString(null),f.setLineStrings(c),f):e==ol.geom.GeometryType.POLYGON?(f=new ol.geom.MultiPolygon(null),f.setPolygons(c),f):e==ol.geom.GeometryType.GEOMETRY_COLLECTION?new ol.geom.GeometryCollection(c):null}return new ol.geom.GeometryCollection(c)};
|
|
ol.format.KML.readPoint_=function(a,b){var c=ol.format.KML.readFlatCoordinatesFromNode_(a,b);if(goog.isDefAndNotNull(c)){var d=new ol.geom.Point(null);d.setFlatCoordinates(ol.geom.GeometryLayout.XYZ,c);return d}};
|
|
ol.format.KML.readPolygon_=function(a,b){var c=ol.xml.pushParseAndPop([null],ol.format.KML.FLAT_LINEAR_RINGS_PARSERS_,a,b);if(goog.isDefAndNotNull(c)&&!goog.isNull(c[0])){var d=new ol.geom.Polygon(null),e=c[0],f=[e.length],g,h;g=1;for(h=c.length;g<h;++g)goog.array.extend(e,c[g]),f.push(e.length);d.setFlatCoordinates(ol.geom.GeometryLayout.XYZ,e,f);return d}};
|
|
ol.format.KML.readStyle_=function(a,b){var c=ol.xml.pushParseAndPop({},ol.format.KML.STYLE_PARSERS_,a,b);if(!goog.isDef(c))return null;var d=goog.object.get(c,"fillStyle",ol.format.KML.DEFAULT_FILL_STYLE_),e=goog.object.get(c,"fill");goog.isDef(e)&&!e&&(d=null);var e=goog.object.get(c,"imageStyle",ol.format.KML.DEFAULT_IMAGE_STYLE_),f=goog.object.get(c,"strokeStyle",ol.format.KML.DEFAULT_STROKE_STYLE_),c=goog.object.get(c,"outline");goog.isDef(c)&&!c&&(f=null);return[new ol.style.Style({fill:d,image:e,
|
|
stroke:f,text:null,zIndex:void 0})]};ol.format.KML.DataParser_=function(a,b){var c=a.getAttribute("name");if(!goog.isNull(c)){var d=ol.xml.pushParseAndPop(void 0,ol.format.KML.DATA_PARSERS_,a,b);goog.isDef(d)&&goog.object.set(b[b.length-1],c,d)}};ol.format.KML.ExtendedDataParser_=function(a,b){ol.xml.parse(ol.format.KML.EXTENDED_DATA_PARSERS_,a,b)};
|
|
ol.format.KML.PairDataParser_=function(a,b){var c=ol.xml.pushParseAndPop({},ol.format.KML.PAIR_PARSERS_,a,b);if(goog.isDef(c)){var d=goog.object.get(c,"key");goog.isDef(d)&&"normal"==d&&(d=goog.object.get(c,"styleUrl"),goog.isDef(d)&&(b[b.length-1]=d),c=goog.object.get(c,"Style"),goog.isDef(c)&&(b[b.length-1]=c))}};
|
|
ol.format.KML.PlacemarkStyleMapParser_=function(a,b){var c=ol.format.KML.readStyleMapValue_(a,b);if(goog.isDef(c)){var d=b[b.length-1];goog.isArray(c)?goog.object.set(d,"Style",c):goog.isString(c)&&goog.object.set(d,"styleUrl",c)}};ol.format.KML.SchemaDataParser_=function(a,b){ol.xml.parse(ol.format.KML.SCHEMA_DATA_PARSERS_,a,b)};ol.format.KML.SimpleDataParser_=function(a,b){var c=a.getAttribute("name");if(!goog.isNull(c)){var d=ol.format.XSD.readString(a);goog.object.set(b[b.length-1],c,d)}};
|
|
ol.format.KML.innerBoundaryIsParser_=function(a,b){var c=ol.xml.pushParseAndPop(void 0,ol.format.KML.INNER_BOUNDARY_IS_PARSERS_,a,b);goog.isDef(c)&&b[b.length-1].push(c)};ol.format.KML.outerBoundaryIsParser_=function(a,b){var c=ol.xml.pushParseAndPop(void 0,ol.format.KML.OUTER_BOUNDARY_IS_PARSERS_,a,b);goog.isDef(c)&&(b[b.length-1][0]=c)};
|
|
ol.format.KML.whenParser_=function(a,b){var c=b[b.length-1].whens,d=ol.xml.getAllTextContent(a,!1);if(d=/^\s*(\d{4})($|-(\d{2})($|-(\d{2})($|T(\d{2}):(\d{2}):(\d{2})(Z|(?:([+\-])(\d{2})(?::(\d{2}))?)))))\s*$/.exec(d)){var e=parseInt(d[1],10),f=goog.isDef(d[3])?parseInt(d[3],10)-1:0,g=goog.isDef(d[5])?parseInt(d[5],10):1,h=goog.isDef(d[7])?parseInt(d[7],10):0,k=goog.isDef(d[8])?parseInt(d[8],10):0,l=goog.isDef(d[9])?parseInt(d[9],10):0,e=Date.UTC(e,f,g,h,k,l);goog.isDef(d[10])&&"Z"!=d[10]&&(f="-"==
|
|
d[11]?-1:1,e+=60*f*parseInt(d[12],10),goog.isDef(d[13])&&(e+=3600*f*parseInt(d[13],10)));c.push(e)}else c.push(0)};ol.format.KML.DATA_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{value:ol.xml.makeReplacer(ol.format.XSD.readString)});ol.format.KML.EXTENDED_DATA_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{Data:ol.format.KML.DataParser_,SchemaData:ol.format.KML.SchemaDataParser_});
|
|
ol.format.KML.FLAT_LINEAR_RING_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{coordinates:ol.xml.makeReplacer(ol.format.KML.readFlatCoordinates_)});ol.format.KML.FLAT_LINEAR_RINGS_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{innerBoundaryIs:ol.format.KML.innerBoundaryIsParser_,outerBoundaryIs:ol.format.KML.outerBoundaryIsParser_});
|
|
ol.format.KML.GX_TRACK_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{when:ol.format.KML.whenParser_},ol.xml.makeParsersNS(ol.format.KML.GX_NAMESPACE_URIS_,{coord:ol.format.KML.gxCoordParser_}));ol.format.KML.GEOMETRY_FLAT_COORDINATES_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{coordinates:ol.xml.makeReplacer(ol.format.KML.readFlatCoordinates_)});ol.format.KML.ICON_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{href:ol.xml.makeObjectPropertySetter(ol.format.KML.readURI_)});
|
|
ol.format.KML.ICON_STYLE_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{Icon:ol.xml.makeObjectPropertySetter(ol.format.KML.readIcon_),heading:ol.xml.makeObjectPropertySetter(ol.format.XSD.readDecimal),hotSpot:ol.xml.makeObjectPropertySetter(ol.format.KML.readVec2_),scale:ol.xml.makeObjectPropertySetter(ol.format.KML.readScale_)});ol.format.KML.INNER_BOUNDARY_IS_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{LinearRing:ol.xml.makeReplacer(ol.format.KML.readFlatLinearRing_)});
|
|
ol.format.KML.LINE_STYLE_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{color:ol.xml.makeObjectPropertySetter(ol.format.KML.readColor_),width:ol.xml.makeObjectPropertySetter(ol.format.XSD.readDecimal)});
|
|
ol.format.KML.MULTI_GEOMETRY_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{LineString:ol.xml.makeArrayPusher(ol.format.KML.readLineString_),LinearRing:ol.xml.makeArrayPusher(ol.format.KML.readLinearRing_),MultiGeometry:ol.xml.makeArrayPusher(ol.format.KML.readMultiGeometry_),Point:ol.xml.makeArrayPusher(ol.format.KML.readPoint_),Polygon:ol.xml.makeArrayPusher(ol.format.KML.readPolygon_)});
|
|
ol.format.KML.GX_MULTITRACK_GEOMETRY_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.GX_NAMESPACE_URIS_,{Track:ol.xml.makeArrayPusher(ol.format.KML.readGxTrack_)});ol.format.KML.OUTER_BOUNDARY_IS_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{LinearRing:ol.xml.makeReplacer(ol.format.KML.readFlatLinearRing_)});
|
|
ol.format.KML.PAIR_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{Style:ol.xml.makeObjectPropertySetter(ol.format.KML.readStyle_),key:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),styleUrl:ol.xml.makeObjectPropertySetter(ol.format.KML.readStyleUrl_)});
|
|
ol.format.KML.PLACEMARK_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{ExtendedData:ol.format.KML.ExtendedDataParser_,MultiGeometry:ol.xml.makeObjectPropertySetter(ol.format.KML.readMultiGeometry_,"geometry"),LineString:ol.xml.makeObjectPropertySetter(ol.format.KML.readLineString_,"geometry"),LinearRing:ol.xml.makeObjectPropertySetter(ol.format.KML.readLinearRing_,"geometry"),Point:ol.xml.makeObjectPropertySetter(ol.format.KML.readPoint_,"geometry"),Polygon:ol.xml.makeObjectPropertySetter(ol.format.KML.readPolygon_,
|
|
"geometry"),Style:ol.xml.makeObjectPropertySetter(ol.format.KML.readStyle_),StyleMap:ol.format.KML.PlacemarkStyleMapParser_,address:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),description:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),name:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),open:ol.xml.makeObjectPropertySetter(ol.format.XSD.readBoolean),phoneNumber:ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),styleUrl:ol.xml.makeObjectPropertySetter(ol.format.KML.readURI_),
|
|
visibility:ol.xml.makeObjectPropertySetter(ol.format.XSD.readBoolean)},ol.xml.makeParsersNS(ol.format.KML.GX_NAMESPACE_URIS_,{MultiTrack:ol.xml.makeObjectPropertySetter(ol.format.KML.readGxMultiTrack_,"geometry"),Track:ol.xml.makeObjectPropertySetter(ol.format.KML.readGxTrack_,"geometry")}));
|
|
ol.format.KML.POLY_STYLE_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{color:ol.xml.makeObjectPropertySetter(ol.format.KML.readColor_),fill:ol.xml.makeObjectPropertySetter(ol.format.XSD.readBoolean),outline:ol.xml.makeObjectPropertySetter(ol.format.XSD.readBoolean)});ol.format.KML.SCHEMA_DATA_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{SimpleData:ol.format.KML.SimpleDataParser_});
|
|
ol.format.KML.STYLE_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{IconStyle:ol.format.KML.IconStyleParser_,LineStyle:ol.format.KML.LineStyleParser_,PolyStyle:ol.format.KML.PolyStyleParser_});ol.format.KML.STYLE_MAP_PARSERS_=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{Pair:ol.format.KML.PairDataParser_});ol.format.KML.prototype.getExtensions=function(){return ol.format.KML.EXTENSIONS_};
|
|
ol.format.KML.prototype.readDocumentOrFolder_=function(a,b){ol.xml.getLocalName(a);var c=ol.xml.makeParsersNS(ol.format.KML.NAMESPACE_URIS_,{Folder:ol.xml.makeArrayExtender(this.readDocumentOrFolder_,this),Placemark:ol.xml.makeArrayPusher(this.readPlacemark_,this),Style:goog.bind(this.readSharedStyle_,this),StyleMap:goog.bind(this.readSharedStyleMap_,this)}),c=ol.xml.pushParseAndPop([],c,a,b,this);if(goog.isDef(c))return c};
|
|
ol.format.KML.prototype.readPlacemark_=function(a,b){var c=ol.xml.pushParseAndPop({geometry:null},ol.format.KML.PLACEMARK_PARSERS_,a,b);if(goog.isDef(c)){var d=new ol.Feature,e=a.getAttribute("id");goog.isNull(e)||d.setId(e);d.setValues(c);d.setStyle(this.featureStyleFunction_);return d}};
|
|
ol.format.KML.prototype.readSharedStyle_=function(a,b){var c=a.getAttribute("id");if(!goog.isNull(c)){var d=ol.format.KML.readStyle_(a,b);goog.isDef(d)&&(c=goog.isDefAndNotNull(a.baseURI)?goog.Uri.resolve(a.baseURI,"#"+c).toString():"#"+c,this.sharedStyles_[c]=d)}};
|
|
ol.format.KML.prototype.readSharedStyleMap_=function(a,b){var c=a.getAttribute("id");if(!goog.isNull(c)){var d=ol.format.KML.readStyleMapValue_(a,b);goog.isDef(d)&&(c=goog.isDefAndNotNull(a.baseURI)?goog.Uri.resolve(a.baseURI,"#"+c).toString():"#"+c,this.sharedStyles_[c]=d)}};ol.format.KML.prototype.readFeatureFromNode=function(a){if(-1==goog.array.indexOf(ol.format.KML.NAMESPACE_URIS_,a.namespaceURI))return null;a=this.readPlacemark_(a,[]);return goog.isDef(a)?a:null};
|
|
ol.format.KML.prototype.readFeaturesFromNode=function(a){if(-1==goog.array.indexOf(ol.format.KML.NAMESPACE_URIS_,a.namespaceURI))return[];var b;b=ol.xml.getLocalName(a);if("Document"==b||"Folder"==b)return b=this.readDocumentOrFolder_(a,[]),goog.isDef(b)?b:[];if("Placemark"==b)return b=this.readPlacemark_(a,[]),goog.isDef(b)?[b]:[];if("kml"==b){b=[];for(a=a.firstElementChild;!goog.isNull(a);a=a.nextElementSibling){var c=this.readFeaturesFromNode(a);goog.isDef(c)&&goog.array.extend(b,c)}return b}return[]};
|
|
ol.format.KML.prototype.readName=function(a){if(ol.xml.isDocument(a))return this.readNameFromDocument(a);if(ol.xml.isNode(a))return this.readNameFromNode(a);if(goog.isString(a))return a=ol.xml.load(a),this.readNameFromDocument(a)};ol.format.KML.prototype.readNameFromDocument=function(a){for(a=a.firstChild;!goog.isNull(a);a=a.nextSibling)if(a.nodeType==goog.dom.NodeType.ELEMENT){var b=this.readNameFromNode(a);if(goog.isDef(b))return b}};
|
|
ol.format.KML.prototype.readNameFromNode=function(a){var b;for(b=a.firstElementChild;!goog.isNull(b);b=b.nextElementSibling)if(-1!=goog.array.indexOf(ol.format.KML.NAMESPACE_URIS_,b.namespaceURI)&&"name"==b.localName)return ol.format.XSD.readString(b);for(b=a.firstElementChild;!goog.isNull(b);b=b.nextElementSibling)if(a=ol.xml.getLocalName(b),-1!=goog.array.indexOf(ol.format.KML.NAMESPACE_URIS_,b.namespaceURI)&&("Document"==a||"Folder"==a||"Placemark"==a||"kml"==a)&&(a=this.readNameFromNode(b),goog.isDef(a)))return a};
|
|
ol.format.KML.prototype.readProjectionFromDocument=function(a){return ol.proj.get("EPSG:4326")};ol.format.KML.prototype.readProjectionFromNode=function(a){return ol.proj.get("EPSG:4326")};ol.format.OSMXML=function(){ol.format.XMLFeature.call(this)};goog.inherits(ol.format.OSMXML,ol.format.XMLFeature);ol.format.OSMXML.EXTENSIONS_=[".osm"];ol.format.OSMXML.prototype.getExtensions=function(){return ol.format.OSMXML.EXTENSIONS_};
|
|
ol.format.OSMXML.readNode_=function(a,b){var c=b[b.length-1],d=a.getAttribute("id"),e=[parseFloat(a.getAttribute("lon")),parseFloat(a.getAttribute("lat"))];goog.object.set(c.nodes,d,e);var f=ol.xml.pushParseAndPop({tags:{}},ol.format.OSMXML.NODE_PARSERS_,a,b);goog.object.isEmpty(f.tags)||(e=new ol.geom.Point(e),e=new ol.Feature(e),e.setId(d),e.setValues(f.tags),c.features.push(e))};
|
|
ol.format.OSMXML.readWay_=function(a,b){for(var c=a.getAttribute("id"),d=ol.xml.pushParseAndPop({ndrefs:[],tags:{}},ol.format.OSMXML.WAY_PARSERS_,a,b),e=b[b.length-1],f=[],g=0,h=d.ndrefs.length;g<h;g++){var k=goog.object.get(e.nodes,d.ndrefs[g]);goog.array.extend(f,k)}d.ndrefs[0]==d.ndrefs[d.ndrefs.length-1]?(g=new ol.geom.Polygon(null),g.setFlatCoordinates(ol.geom.GeometryLayout.XY,f,[f.length])):(g=new ol.geom.LineString(null),g.setFlatCoordinates(ol.geom.GeometryLayout.XY,f));f=new ol.Feature(g);
|
|
f.setId(c);f.setValues(d.tags);e.features.push(f)};ol.format.OSMXML.readNd_=function(a,b){b[b.length-1].ndrefs.push(a.getAttribute("ref"))};ol.format.OSMXML.readTag_=function(a,b){goog.object.set(b[b.length-1].tags,a.getAttribute("k"),a.getAttribute("v"))};ol.format.OSMXML.NAMESPACE_URIS_=[null];ol.format.OSMXML.WAY_PARSERS_=ol.xml.makeParsersNS(ol.format.OSMXML.NAMESPACE_URIS_,{nd:ol.format.OSMXML.readNd_,tag:ol.format.OSMXML.readTag_});
|
|
ol.format.OSMXML.PARSERS_=ol.xml.makeParsersNS(ol.format.OSMXML.NAMESPACE_URIS_,{node:ol.format.OSMXML.readNode_,way:ol.format.OSMXML.readWay_});ol.format.OSMXML.NODE_PARSERS_=ol.xml.makeParsersNS(ol.format.OSMXML.NAMESPACE_URIS_,{tag:ol.format.OSMXML.readTag_});ol.format.OSMXML.prototype.readFeaturesFromNode=function(a){return"osm"==a.localName&&(a=ol.xml.pushParseAndPop({nodes:{},features:[]},ol.format.OSMXML.PARSERS_,a,[]),goog.isDef(a.features))?a.features:[]};
|
|
ol.format.OSMXML.prototype.readProjectionFromDocument=function(a){return ol.proj.get("EPSG:4326")};ol.format.OSMXML.prototype.readProjectionFromNode=function(a){return ol.proj.get("EPSG:4326")};ol.format.Polyline=function(){ol.format.TextFeature.call(this)};goog.inherits(ol.format.Polyline,ol.format.TextFeature);ol.format.Polyline.encodeFlatCoordinates=function(a,b){var c=goog.isDef(b)?b:2;return ol.format.Polyline.encodeDeltas(a,c)};ol.format.Polyline.decodeFlatCoordinates=function(a,b){var c=goog.isDef(b)?b:2;return ol.format.Polyline.decodeDeltas(a,c)};
|
|
ol.format.Polyline.encodeDeltas=function(a,b,c){c=goog.isDef(c)?c:1E5;var d,e=Array(b);for(d=0;d<b;++d)e[d]=0;var f,g;f=0;for(g=a.length;f<g;)for(d=0;d<b;++d,++f){var h=a[f],k=h-e[d];e[d]=h;a[f]=k}return ol.format.Polyline.encodeFloats(a,c)};ol.format.Polyline.decodeDeltas=function(a,b,c){var d=goog.isDef(c)?c:1E5,e=Array(b);for(c=0;c<b;++c)e[c]=0;a=ol.format.Polyline.decodeFloats(a,d);var f,d=0;for(f=a.length;d<f;)for(c=0;c<b;++c,++d)e[c]+=a[d],a[d]=e[c];return a};
|
|
ol.format.Polyline.encodeFloats=function(a,b){var c=goog.isDef(b)?b:1E5,d,e;d=0;for(e=a.length;d<e;++d)a[d]=Math.round(a[d]*c);return ol.format.Polyline.encodeSignedIntegers(a)};ol.format.Polyline.decodeFloats=function(a,b){var c=goog.isDef(b)?b:1E5,d=ol.format.Polyline.decodeSignedIntegers(a),e,f;e=0;for(f=d.length;e<f;++e)d[e]/=c;return d};ol.format.Polyline.encodeSignedIntegers=function(a){var b,c;b=0;for(c=a.length;b<c;++b){var d=a[b];a[b]=0>d?~(d<<1):d<<1}return ol.format.Polyline.encodeUnsignedIntegers(a)};
|
|
ol.format.Polyline.decodeSignedIntegers=function(a){a=ol.format.Polyline.decodeUnsignedIntegers(a);var b,c;b=0;for(c=a.length;b<c;++b){var d=a[b];a[b]=d&1?~(d>>1):d>>1}return a};ol.format.Polyline.encodeUnsignedIntegers=function(a){var b="",c,d;c=0;for(d=a.length;c<d;++c)b+=ol.format.Polyline.encodeUnsignedInteger(a[c]);return b};ol.format.Polyline.decodeUnsignedIntegers=function(a){var b=[],c=0,d=0,e,f;e=0;for(f=a.length;e<f;++e){var g=a.charCodeAt(e)-63,c=c|(g&31)<<d;32>g?(b.push(c),d=c=0):d+=5}return b};
|
|
ol.format.Polyline.encodeUnsignedInteger=function(a){for(var b,c="";32<=a;)b=(32|a&31)+63,c+=String.fromCharCode(b),a>>=5;return c+=String.fromCharCode(a+63)};ol.format.Polyline.prototype.readFeatureFromText=function(a){a=this.readGeometryFromText(a);return new ol.Feature(a)};ol.format.Polyline.prototype.readFeaturesFromText=function(a){return[this.readFeatureFromText(a)]};
|
|
ol.format.Polyline.prototype.readGeometryFromText=function(a){a=ol.format.Polyline.decodeFlatCoordinates(a,2);a=ol.geom.flat.inflateCoordinates(a,0,a.length,2);return new ol.geom.LineString(a)};ol.format.Polyline.prototype.readProjectionFromText=function(a){return ol.proj.get("EPSG:4326")};ol.format.Polyline.prototype.writeFeatureText=function(a){a=a.getGeometry();return goog.isDefAndNotNull(a)?this.writeGeometryText(a):""};ol.format.Polyline.prototype.writeFeaturesText=function(a){return this.writeFeatureText(a[0])};
|
|
ol.format.Polyline.prototype.writeGeometryText=function(a){var b=a.getFlatCoordinates();a=a.getStride();return ol.format.Polyline.encodeFlatCoordinates(b,a)};ol.format.TopoJSON=function(a){a=goog.isDef(a)?a:{};ol.format.JSONFeature.call(this);this.defaultProjection_=ol.proj.get(a.defaultProjection||"EPSG:4326")};goog.inherits(ol.format.TopoJSON,ol.format.JSONFeature);ol.format.TopoJSON.EXTENSIONS_=[".topojson"];ol.format.TopoJSON.concatenateArcs_=function(a,b){var c=[],d,e,f;e=0;for(f=a.length;e<f;++e)d=a[e],0<e&&c.pop(),d=0<=d?b[d]:b[~d].slice().reverse(),c.push.apply(c,d);e=0;for(f=c.length;e<f;++e)c[e]=c[e].slice();return c};
|
|
ol.format.TopoJSON.readPointGeometry_=function(a,b,c){a=a.coordinates;goog.isDef(b)&&goog.isDef(c)&&ol.format.TopoJSON.transformVertex_(a,b,c);return new ol.geom.Point(a)};ol.format.TopoJSON.readMultiPointGeometry_=function(a,b,c){a=a.coordinates;var d,e;if(goog.isDef(b)&&goog.isDef(c))for(d=0,e=a.length;d<e;++d)ol.format.TopoJSON.transformVertex_(a[d],b,c);return new ol.geom.MultiPoint(a)};
|
|
ol.format.TopoJSON.readLineStringGeometry_=function(a,b){var c=ol.format.TopoJSON.concatenateArcs_(a.arcs,b);return new ol.geom.LineString(goog.array.flatten(c))};ol.format.TopoJSON.readMultiLineStringGeometry_=function(a,b){var c=[],d,e;d=0;for(e=a.arcs.length;d<e;++d)c[d]=ol.format.TopoJSON.concatenateArcs_(a.arcs[d],b);return new ol.geom.MultiLineString(c)};
|
|
ol.format.TopoJSON.readPolygonGeometry_=function(a,b){var c=[],d,e;d=0;for(e=a.arcs.length;d<e;++d)c[d]=ol.format.TopoJSON.concatenateArcs_(a.arcs[d],b);return new ol.geom.Polygon(c)};ol.format.TopoJSON.readMultiPolygonGeometry_=function(a,b){var c=[],d,e,f,g,h,k;h=0;for(k=a.arcs.length;h<k;++h){d=a.arcs[h];e=[];f=0;for(g=d.length;f<g;++f)e[f]=ol.format.TopoJSON.concatenateArcs_(d[f],b);c[h]=e}return new ol.geom.MultiPolygon(c)};ol.format.TopoJSON.prototype.getExtensions=function(){return ol.format.TopoJSON.EXTENSIONS_};
|
|
ol.format.TopoJSON.readFeaturesFromGeometryCollection_=function(a,b,c,d){a=a.geometries;var e=[],f,g;f=0;for(g=a.length;f<g;++f)e[f]=ol.format.TopoJSON.readFeatureFromGeometry_(a[f],b,c,d);return e};ol.format.TopoJSON.readFeatureFromGeometry_=function(a,b,c,d){var e=a.type,f=ol.format.TopoJSON.GEOMETRY_READERS_[e];b="Point"===e||"MultiPoint"===e?f(a,c,d):f(a,b);c=new ol.Feature;c.setGeometry(b);goog.isDef(a.id)&&c.setId(a.id);goog.isDef(a.properties)&&c.setValues(a.properties);return c};
|
|
ol.format.TopoJSON.prototype.readFeaturesFromObject=function(a){if("Topology"==a.type){var b,c=null,d=null;goog.isDef(a.transform)&&(b=a.transform,c=b.scale,d=b.translate);var e=a.arcs;goog.isDef(b)&&ol.format.TopoJSON.transformArcs_(e,c,d);b=[];a=goog.object.getValues(a.objects);var f,g,h;f=0;for(g=a.length;f<g;++f)"GeometryCollection"===a[f].type?(h=a[f],b.push.apply(b,ol.format.TopoJSON.readFeaturesFromGeometryCollection_(h,e,c,d))):(h=a[f],b.push(ol.format.TopoJSON.readFeatureFromGeometry_(h,
|
|
e,c,d)));return b}return[]};ol.format.TopoJSON.transformArcs_=function(a,b,c){var d,e;d=0;for(e=a.length;d<e;++d)ol.format.TopoJSON.transformArc_(a[d],b,c)};ol.format.TopoJSON.transformArc_=function(a,b,c){var d=0,e=0,f,g,h;g=0;for(h=a.length;g<h;++g)f=a[g],d+=f[0],e+=f[1],f[0]=d,f[1]=e,ol.format.TopoJSON.transformVertex_(f,b,c)};ol.format.TopoJSON.transformVertex_=function(a,b,c){a[0]=a[0]*b[0]+c[0];a[1]=a[1]*b[1]+c[1]};ol.format.TopoJSON.prototype.readProjection=function(a){return this.defaultProjection_};
|
|
ol.format.TopoJSON.GEOMETRY_READERS_={Point:ol.format.TopoJSON.readPointGeometry_,LineString:ol.format.TopoJSON.readLineStringGeometry_,Polygon:ol.format.TopoJSON.readPolygonGeometry_,MultiPoint:ol.format.TopoJSON.readMultiPointGeometry_,MultiLineString:ol.format.TopoJSON.readMultiLineStringGeometry_,MultiPolygon:ol.format.TopoJSON.readMultiPolygonGeometry_};goog.events.FileDropHandler=function(a,b){goog.events.EventTarget.call(this);this.eventHandler_=new goog.events.EventHandler(this);var c=a;b&&(c=goog.dom.getOwnerDocument(a));this.eventHandler_.listen(c,goog.events.EventType.DRAGENTER,this.onDocDragEnter_);c!=a&&this.eventHandler_.listen(c,goog.events.EventType.DRAGOVER,this.onDocDragOver_);this.eventHandler_.listen(a,goog.events.EventType.DRAGOVER,this.onElemDragOver_);this.eventHandler_.listen(a,goog.events.EventType.DROP,this.onElemDrop_)};
|
|
goog.inherits(goog.events.FileDropHandler,goog.events.EventTarget);goog.events.FileDropHandler.prototype.dndContainsFiles_=!1;goog.events.FileDropHandler.EventType={DROP:goog.events.EventType.DROP};goog.events.FileDropHandler.prototype.disposeInternal=function(){goog.events.FileDropHandler.superClass_.disposeInternal.call(this);this.eventHandler_.dispose()};
|
|
goog.events.FileDropHandler.prototype.dispatch_=function(a){a=new goog.events.BrowserEvent(a.getBrowserEvent());a.type=goog.events.FileDropHandler.EventType.DROP;this.dispatchEvent(a)};goog.events.FileDropHandler.prototype.onDocDragEnter_=function(a){var b=a.getBrowserEvent().dataTransfer;(this.dndContainsFiles_=!(!b||!(b.types&&(goog.array.contains(b.types,"Files")||goog.array.contains(b.types,"public.file-url"))||b.files&&0<b.files.length)))&&a.preventDefault()};
|
|
goog.events.FileDropHandler.prototype.onDocDragOver_=function(a){this.dndContainsFiles_&&(a.preventDefault(),a.getBrowserEvent().dataTransfer.dropEffect="none")};goog.events.FileDropHandler.prototype.onElemDragOver_=function(a){this.dndContainsFiles_&&(a.preventDefault(),a.stopPropagation(),a=a.getBrowserEvent().dataTransfer,a.effectAllowed="all",a.dropEffect="copy")};goog.events.FileDropHandler.prototype.onElemDrop_=function(a){this.dndContainsFiles_&&(a.preventDefault(),a.stopPropagation(),this.dispatch_(a))};/*
|
|
Portions of this code are from MochiKit, received by
|
|
The Closure Authors under the MIT license. All other code is Copyright
|
|
2005-2009 The Closure Authors. All Rights Reserved.
|
|
*/
|
|
goog.async.Deferred=function(a,b){this.sequence_=[];this.onCancelFunction_=a;this.defaultScope_=b||null;if(goog.async.Deferred.LONG_STACK_TRACES&&(this.constructorStack_=null,Error.captureStackTrace)){var c={stack:""};Error.captureStackTrace(c,goog.async.Deferred);"string"==typeof c.stack&&(this.constructorStack_=c.stack.replace(/^[^\n]*\n/,""))}};goog.async.Deferred.prototype.fired_=!1;goog.async.Deferred.prototype.hadError_=!1;goog.async.Deferred.prototype.blocked_=!1;
|
|
goog.async.Deferred.prototype.blocking_=!1;goog.async.Deferred.prototype.silentlyCanceled_=!1;goog.async.Deferred.prototype.branches_=0;goog.async.Deferred.STRICT_ERRORS=!1;goog.async.Deferred.LONG_STACK_TRACES=goog.DEBUG;
|
|
goog.async.Deferred.prototype.cancel=function(a){if(this.hasFired())this.result_ instanceof goog.async.Deferred&&this.result_.cancel();else{if(this.parent_){var b=this.parent_;delete this.parent_;a?b.cancel(a):b.branchCancel_()}this.onCancelFunction_?this.onCancelFunction_.call(this.defaultScope_,this):this.silentlyCanceled_=!0;this.hasFired()||this.errback(new goog.async.Deferred.CanceledError(this))}};goog.async.Deferred.prototype.branchCancel_=function(){this.branches_--;0>=this.branches_&&this.cancel()};
|
|
goog.async.Deferred.prototype.continue_=function(a,b){this.blocked_=!1;this.updateResult_(a,b)};goog.async.Deferred.prototype.updateResult_=function(a,b){this.fired_=!0;this.result_=b;this.hadError_=!a;this.fire_()};goog.async.Deferred.prototype.check_=function(){if(this.hasFired()){if(!this.silentlyCanceled_)throw new goog.async.Deferred.AlreadyCalledError(this);this.silentlyCanceled_=!1}};
|
|
goog.async.Deferred.prototype.callback=function(a){this.check_();this.assertNotDeferred_(a);this.updateResult_(!0,a)};goog.async.Deferred.prototype.errback=function(a){this.check_();this.assertNotDeferred_(a);this.makeStackTraceLong_(a);this.updateResult_(!1,a)};goog.async.Deferred.prototype.makeStackTraceLong_=function(a){goog.async.Deferred.LONG_STACK_TRACES&&(this.constructorStack_&&goog.isObject(a)&&a.stack&&/^[^\n]+(\n [^\n]+)+/.test(a.stack))&&(a.stack=a.stack+"\nDEFERRED OPERATION:\n"+this.constructorStack_)};
|
|
goog.async.Deferred.prototype.assertNotDeferred_=function(a){};goog.async.Deferred.prototype.addCallback=function(a,b){return this.addCallbacks(a,null,b)};goog.async.Deferred.prototype.addErrback=function(a,b){return this.addCallbacks(null,a,b)};goog.async.Deferred.prototype.addBoth=function(a,b){return this.addCallbacks(a,a,b)};goog.async.Deferred.prototype.addCallbacks=function(a,b,c){this.sequence_.push([a,b,c]);this.hasFired()&&this.fire_();return this};
|
|
goog.async.Deferred.prototype.chainDeferred=function(a){this.addCallbacks(a.callback,a.errback,a);return this};goog.async.Deferred.prototype.awaitDeferred=function(a){return this.addCallback(goog.bind(a.branch,a))};goog.async.Deferred.prototype.branch=function(a){var b=new goog.async.Deferred;this.chainDeferred(b);a&&(b.parent_=this,this.branches_++);return b};goog.async.Deferred.prototype.hasFired=function(){return this.fired_};
|
|
goog.async.Deferred.prototype.isError=function(a){return a instanceof Error};goog.async.Deferred.prototype.hasErrback_=function(){return goog.array.some(this.sequence_,function(a){return goog.isFunction(a[1])})};
|
|
goog.async.Deferred.prototype.fire_=function(){this.unhandledExceptionTimeoutId_&&(this.hasFired()&&this.hasErrback_())&&(goog.global.clearTimeout(this.unhandledExceptionTimeoutId_),delete this.unhandledExceptionTimeoutId_);this.parent_&&(this.parent_.branches_--,delete this.parent_);for(var a=this.result_,b=!1,c=!1;this.sequence_.length&&!this.blocked_;){var d=this.sequence_.shift(),e=d[0],f=d[1],d=d[2];if(e=this.hadError_?f:e)try{var g=e.call(d||this.defaultScope_,a);goog.isDef(g)&&(this.hadError_=
|
|
this.hadError_&&(g==a||this.isError(g)),this.result_=a=g);a instanceof goog.async.Deferred&&(this.blocked_=c=!0)}catch(h){a=h,this.hadError_=!0,this.makeStackTraceLong_(a),this.hasErrback_()||(b=!0)}}this.result_=a;c?(a.addCallbacks(goog.bind(this.continue_,this,!0),goog.bind(this.continue_,this,!1)),a.blocking_=!0):!goog.async.Deferred.STRICT_ERRORS||(!this.isError(a)||a instanceof goog.async.Deferred.CanceledError)||(b=this.hadError_=!0);b&&(this.unhandledExceptionTimeoutId_=goog.global.setTimeout(goog.functions.fail(a),
|
|
0))};goog.async.Deferred.succeed=function(a){var b=new goog.async.Deferred;b.callback(a);return b};goog.async.Deferred.fail=function(a){var b=new goog.async.Deferred;b.errback(a);return b};goog.async.Deferred.canceled=function(){var a=new goog.async.Deferred;a.cancel();return a};goog.async.Deferred.when=function(a,b,c){return a instanceof goog.async.Deferred?a.branch(!0).addCallback(b,c):goog.async.Deferred.succeed(a).addCallback(b,c)};
|
|
goog.async.Deferred.AlreadyCalledError=function(a){goog.debug.Error.call(this);this.deferred=a};goog.inherits(goog.async.Deferred.AlreadyCalledError,goog.debug.Error);goog.async.Deferred.AlreadyCalledError.prototype.message="Deferred has already fired";goog.async.Deferred.AlreadyCalledError.prototype.name="AlreadyCalledError";goog.async.Deferred.CanceledError=function(a){goog.debug.Error.call(this);this.deferred=a};goog.inherits(goog.async.Deferred.CanceledError,goog.debug.Error);
|
|
goog.async.Deferred.CanceledError.prototype.message="Deferred was canceled";goog.async.Deferred.CanceledError.prototype.name="CanceledError";goog.fs={};goog.fs.Error=function(a,b){goog.debug.Error.call(this,goog.string.subs("Error %s: %s",b,goog.fs.Error.getDebugMessage(a)));this.code=a};goog.inherits(goog.fs.Error,goog.debug.Error);goog.fs.Error.ErrorCode={NOT_FOUND:1,SECURITY:2,ABORT:3,NOT_READABLE:4,ENCODING:5,NO_MODIFICATION_ALLOWED:6,INVALID_STATE:7,SYNTAX:8,INVALID_MODIFICATION:9,QUOTA_EXCEEDED:10,TYPE_MISMATCH:11,PATH_EXISTS:12};
|
|
goog.fs.Error.getDebugMessage=function(a){switch(a){case goog.fs.Error.ErrorCode.NOT_FOUND:return"File or directory not found";case goog.fs.Error.ErrorCode.SECURITY:return"Insecure or disallowed operation";case goog.fs.Error.ErrorCode.ABORT:return"Operation aborted";case goog.fs.Error.ErrorCode.NOT_READABLE:return"File or directory not readable";case goog.fs.Error.ErrorCode.ENCODING:return"Invalid encoding";case goog.fs.Error.ErrorCode.NO_MODIFICATION_ALLOWED:return"Cannot modify file or directory";
|
|
case goog.fs.Error.ErrorCode.INVALID_STATE:return"Invalid state";case goog.fs.Error.ErrorCode.SYNTAX:return"Invalid line-ending specifier";case goog.fs.Error.ErrorCode.INVALID_MODIFICATION:return"Invalid modification";case goog.fs.Error.ErrorCode.QUOTA_EXCEEDED:return"Quota exceeded";case goog.fs.Error.ErrorCode.TYPE_MISMATCH:return"Invalid filetype";case goog.fs.Error.ErrorCode.PATH_EXISTS:return"File or directory already exists at specified path";default:return"Unrecognized error"}};goog.fs.ProgressEvent=function(a,b){goog.events.Event.call(this,a.type,b);this.event_=a};goog.inherits(goog.fs.ProgressEvent,goog.events.Event);goog.fs.ProgressEvent.prototype.isLengthComputable=function(){return this.event_.lengthComputable};goog.fs.ProgressEvent.prototype.getLoaded=function(){return this.event_.loaded};goog.fs.ProgressEvent.prototype.getTotal=function(){return this.event_.total};goog.fs.FileReader=function(){goog.events.EventTarget.call(this);this.reader_=new FileReader;this.reader_.onloadstart=goog.bind(this.dispatchProgressEvent_,this);this.reader_.onprogress=goog.bind(this.dispatchProgressEvent_,this);this.reader_.onload=goog.bind(this.dispatchProgressEvent_,this);this.reader_.onabort=goog.bind(this.dispatchProgressEvent_,this);this.reader_.onerror=goog.bind(this.dispatchProgressEvent_,this);this.reader_.onloadend=goog.bind(this.dispatchProgressEvent_,this)};
|
|
goog.inherits(goog.fs.FileReader,goog.events.EventTarget);goog.fs.FileReader.ReadyState={INIT:0,LOADING:1,DONE:2};goog.fs.FileReader.EventType={LOAD_START:"loadstart",PROGRESS:"progress",LOAD:"load",ABORT:"abort",ERROR:"error",LOAD_END:"loadend"};goog.fs.FileReader.prototype.abort=function(){try{this.reader_.abort()}catch(a){throw new goog.fs.Error(a.code,"aborting read");}};goog.fs.FileReader.prototype.getReadyState=function(){return this.reader_.readyState};
|
|
goog.fs.FileReader.prototype.getResult=function(){return this.reader_.result};goog.fs.FileReader.prototype.getError=function(){return this.reader_.error&&new goog.fs.Error(this.reader_.error.code,"reading file")};goog.fs.FileReader.prototype.dispatchProgressEvent_=function(a){this.dispatchEvent(new goog.fs.ProgressEvent(a,this))};goog.fs.FileReader.prototype.disposeInternal=function(){goog.fs.FileReader.superClass_.disposeInternal.call(this);delete this.reader_};
|
|
goog.fs.FileReader.prototype.readAsBinaryString=function(a){this.reader_.readAsBinaryString(a)};goog.fs.FileReader.readAsBinaryString=function(a){var b=new goog.fs.FileReader,c=goog.fs.FileReader.createDeferred_(b);b.readAsBinaryString(a);return c};goog.fs.FileReader.prototype.readAsArrayBuffer=function(a){this.reader_.readAsArrayBuffer(a)};goog.fs.FileReader.readAsArrayBuffer=function(a){var b=new goog.fs.FileReader,c=goog.fs.FileReader.createDeferred_(b);b.readAsArrayBuffer(a);return c};
|
|
goog.fs.FileReader.prototype.readAsText=function(a,b){this.reader_.readAsText(a,b)};goog.fs.FileReader.readAsText=function(a,b){var c=new goog.fs.FileReader,d=goog.fs.FileReader.createDeferred_(c);c.readAsText(a,b);return d};goog.fs.FileReader.prototype.readAsDataUrl=function(a){this.reader_.readAsDataURL(a)};goog.fs.FileReader.readAsDataUrl=function(a){var b=new goog.fs.FileReader,c=goog.fs.FileReader.createDeferred_(b);b.readAsDataUrl(a);return c};
|
|
goog.fs.FileReader.createDeferred_=function(a){var b=new goog.async.Deferred;a.addEventListener(goog.fs.FileReader.EventType.LOAD_END,goog.partial(function(a,b,e){e=b.getResult();var f=b.getError();null==e||f?a.errback(f):a.callback(e);b.dispose()},b,a));return b};ol.interaction.DragAndDrop=function(a){a=goog.isDef(a)?a:{};ol.interaction.Interaction.call(this);this.formatConstructors_=goog.isDef(a.formatConstructors)?a.formatConstructors:[];this.reprojectTo_=goog.isDef(a.reprojectTo)?ol.proj.get(a.reprojectTo):null;this.fileDropHandler_=null;this.dropListenKey_=void 0};goog.inherits(ol.interaction.DragAndDrop,ol.interaction.Interaction);
|
|
ol.interaction.DragAndDrop.prototype.disposeInternal=function(){goog.isDef(this.dropListenKey_)&&goog.events.unlistenByKey(this.dropListenKey_);ol.interaction.DragAndDrop.superClass_.disposeInternal.call(this)};ol.interaction.DragAndDrop.prototype.handleDrop_=function(a){a=a.getBrowserEvent().dataTransfer.files;var b,c;b=0;for(c=a.length;b<c;++b)goog.fs.FileReader.readAsText(a[b],"").addCallback(this.handleResult_,this)};
|
|
ol.interaction.DragAndDrop.prototype.handleResult_=function(a){var b=this.getMap(),c=this.reprojectTo_;goog.isNull(c)&&(c=b.getView().getView2D().getProjection());var b=this.formatConstructors_,d=[],e,f;e=0;for(f=b.length;e<f;++e){var g=new b[e],h=this.tryReadFeatures_(g,a);if(!goog.isNull(h)){var g=g.readProjection(a),g=ol.proj.getTransform(g,c),k,l;k=0;for(l=h.length;k<l;++k){var m=h[k],n=m.getGeometry();goog.isNull(n)||n.transform(g);d.push(m)}}}this.dispatchEvent(new ol.interaction.DragAndDropEvent(ol.interaction.DragAndDropEventType.ADD_FEATURES,
|
|
this,d,c))};ol.interaction.DragAndDrop.prototype.handleMapBrowserEvent=goog.functions.TRUE;
|
|
ol.interaction.DragAndDrop.prototype.setMap=function(a){goog.isDef(this.dropListenKey_)&&(goog.events.unlistenByKey(this.dropListenKey_),this.dropListenKey_=void 0);goog.isNull(this.fileDropHandler_)||(goog.dispose(this.fileDropHandler_),this.fileDropHandler_=null);ol.interaction.DragAndDrop.superClass_.setMap.call(this,a);goog.isNull(a)||(this.fileDropHandler_=new goog.events.FileDropHandler(a.getViewport()),this.dropListenKey_=goog.events.listen(this.fileDropHandler_,goog.events.FileDropHandler.EventType.DROP,
|
|
this.handleDrop_,!1,this))};ol.interaction.DragAndDrop.prototype.tryReadFeatures_=function(a,b){try{return a.readFeatures(b)}catch(c){return null}};ol.interaction.DragAndDropEventType={ADD_FEATURES:"addfeatures"};ol.interaction.DragAndDropEvent=function(a,b,c,d){goog.events.Event.call(this,a,b);this.features=c;this.projection=d};goog.inherits(ol.interaction.DragAndDropEvent,goog.events.Event);goog.math.Vec2=function(a,b){this.x=a;this.y=b};goog.inherits(goog.math.Vec2,goog.math.Coordinate);goog.math.Vec2.randomUnit=function(){var a=2*Math.random()*Math.PI;return new goog.math.Vec2(Math.cos(a),Math.sin(a))};goog.math.Vec2.random=function(){var a=Math.sqrt(Math.random()),b=2*Math.random()*Math.PI;return new goog.math.Vec2(Math.cos(b)*a,Math.sin(b)*a)};goog.math.Vec2.fromCoordinate=function(a){return new goog.math.Vec2(a.x,a.y)};
|
|
goog.math.Vec2.prototype.clone=function(){return new goog.math.Vec2(this.x,this.y)};goog.math.Vec2.prototype.magnitude=function(){return Math.sqrt(this.x*this.x+this.y*this.y)};goog.math.Vec2.prototype.squaredMagnitude=function(){return this.x*this.x+this.y*this.y};goog.math.Vec2.prototype.scale=goog.math.Coordinate.prototype.scale;goog.math.Vec2.prototype.invert=function(){this.x=-this.x;this.y=-this.y;return this};goog.math.Vec2.prototype.normalize=function(){return this.scale(1/this.magnitude())};
|
|
goog.math.Vec2.prototype.add=function(a){this.x+=a.x;this.y+=a.y;return this};goog.math.Vec2.prototype.subtract=function(a){this.x-=a.x;this.y-=a.y;return this};goog.math.Vec2.prototype.rotate=function(a){var b=Math.cos(a);a=Math.sin(a);var c=this.y*b+this.x*a;this.x=this.x*b-this.y*a;this.y=c;return this};goog.math.Vec2.rotateAroundPoint=function(a,b,c){return a.clone().subtract(b).rotate(c).add(b)};goog.math.Vec2.prototype.equals=function(a){return this==a||!!a&&this.x==a.x&&this.y==a.y};
|
|
goog.math.Vec2.distance=goog.math.Coordinate.distance;goog.math.Vec2.squaredDistance=goog.math.Coordinate.squaredDistance;goog.math.Vec2.equals=goog.math.Coordinate.equals;goog.math.Vec2.sum=function(a,b){return new goog.math.Vec2(a.x+b.x,a.y+b.y)};goog.math.Vec2.difference=function(a,b){return new goog.math.Vec2(a.x-b.x,a.y-b.y)};goog.math.Vec2.dot=function(a,b){return a.x*b.x+a.y*b.y};
|
|
goog.math.Vec2.lerp=function(a,b,c){return new goog.math.Vec2(goog.math.lerp(a.x,b.x,c),goog.math.lerp(a.y,b.y,c))};ol.interaction.DRAGROTATEANDZOOM_ANIMATION_DURATION=400;ol.interaction.DragRotateAndZoom=function(a){a=goog.isDef(a)?a:{};ol.interaction.Drag.call(this);this.condition_=goog.isDef(a.condition)?a.condition:ol.events.condition.shiftKeyOnly;this.lastMagnitude_=this.lastAngle_=void 0;this.lastScaleDelta_=0};goog.inherits(ol.interaction.DragRotateAndZoom,ol.interaction.Drag);
|
|
ol.interaction.DragRotateAndZoom.prototype.handleDrag=function(a){var b=a.map,c=b.getSize();a=a.pixel;a=new goog.math.Vec2(a[0]-c[0]/2,c[1]/2-a[1]);c=Math.atan2(a.y,a.x);a=a.magnitude();var d=b.getView().getView2D(),e=d.getView2DState();b.render();goog.isDef(this.lastAngle_)&&ol.interaction.Interaction.rotateWithoutConstraints(b,d,e.rotation-(c-this.lastAngle_));this.lastAngle_=c;goog.isDef(this.lastMagnitude_)&&ol.interaction.Interaction.zoomWithoutConstraints(b,d,this.lastMagnitude_*(e.resolution/
|
|
a));goog.isDef(this.lastMagnitude_)&&(this.lastScaleDelta_=this.lastMagnitude_/a);this.lastMagnitude_=a};ol.interaction.DragRotateAndZoom.prototype.handleDragEnd=function(a){a=a.map;var b=a.getView();b.setHint(ol.ViewHint.INTERACTING,-1);var b=b.getView2D(),c=b.getView2DState(),d=this.lastScaleDelta_-1;ol.interaction.Interaction.rotate(a,b,c.rotation);ol.interaction.Interaction.zoom(a,b,c.resolution,void 0,ol.interaction.DRAGROTATEANDZOOM_ANIMATION_DURATION,d);this.lastScaleDelta_=0;return!0};
|
|
ol.interaction.DragRotateAndZoom.prototype.handleDragStart=function(a){return this.condition_(a)?(a.map.getView().setHint(ol.ViewHint.INTERACTING,1),this.lastMagnitude_=this.lastAngle_=void 0,!0):!1};ol.interaction.Modify=function(a){ol.interaction.Drag.call(this);this.vertexSegments_=this.vertexFeature_=null;this.modifiable_=!1;this.rBush_=this.lastPixel_=null;this.pixelTolerance_=goog.isDef(a.pixelTolerance)?a.pixelTolerance:20;this.dragSegments_=null;this.overlay_=new ol.FeatureOverlay({style:a.style});this.features_=a.features;goog.events.listen(this.features_,ol.CollectionEventType.ADD,this.addFeature_,!1,this);goog.events.listen(this.features_,ol.CollectionEventType.REMOVE,this.removeFeature_,
|
|
!1,this);this.SEGMENT_WRITERS_={Point:this.writePointGeometry_,LineString:this.writeLineStringGeometry_,LinearRing:this.writeLineStringGeometry_,Polygon:this.writePolygonGeometry_,MultiPoint:this.writeMultiPointGeometry_,MultiLineString:this.writeMultiLineStringGeometry_,MultiPolygon:this.writeMultiPolygonGeometry_,GeometryCollection:this.writeGeometryCollectionGeometry_}};goog.inherits(ol.interaction.Modify,ol.interaction.Drag);
|
|
ol.interaction.Modify.prototype.setMap=function(a){goog.isNull(a)?this.rBush_=null:goog.isNull(this.rBush_)&&(this.rBush_=new ol.structs.RBush);this.overlay_.setMap(a);ol.interaction.Modify.superClass_.setMap.call(this,a)};ol.interaction.Modify.prototype.addFeature_=function(a){a=a.element;var b=a.getGeometry();goog.isDef(this.SEGMENT_WRITERS_[b.getType()])&&this.SEGMENT_WRITERS_[b.getType()].call(this,a,b);this.handleMouseAtPixel_(this.lastPixel_,this.getMap())};
|
|
ol.interaction.Modify.prototype.writePointGeometry_=function(a,b){var c=b.getCoordinates(),c={feature:a,geometry:b,segment:[c,c]};this.rBush_.insert(b.getExtent(),c)};ol.interaction.Modify.prototype.writeMultiPointGeometry_=function(a,b){var c=b.getCoordinates(),d,e,f;e=0;for(f=c.length;e<f;++e)d=c[e],d={feature:a,geometry:b,depth:[e],index:e,segment:[d,d]},this.rBush_.insert(b.getExtent(),d)};
|
|
ol.interaction.Modify.prototype.writeLineStringGeometry_=function(a,b){var c=b.getCoordinates(),d,e,f,g;d=0;for(e=c.length-1;d<e;++d)f=c.slice(d,d+2),g={feature:a,geometry:b,index:d,segment:f},this.rBush_.insert(ol.extent.boundingExtent(f),g)};
|
|
ol.interaction.Modify.prototype.writeMultiLineStringGeometry_=function(a,b){var c=b.getCoordinates(),d,e,f,g,h,k,l;g=0;for(h=c.length;g<h;++g)for(d=c[g],e=0,f=d.length-1;e<f;++e)k=d.slice(e,e+2),l={feature:a,geometry:b,depth:[g],index:e,segment:k},this.rBush_.insert(ol.extent.boundingExtent(k),l)};
|
|
ol.interaction.Modify.prototype.writePolygonGeometry_=function(a,b){var c=b.getCoordinates()[0],d,e,f,g;d=0;for(e=c.length-1;d<e;++d)f=c.slice(d,d+2),g={feature:a,geometry:b,index:d,segment:f},this.rBush_.insert(ol.extent.boundingExtent(f),g)};
|
|
ol.interaction.Modify.prototype.writeMultiPolygonGeometry_=function(a,b){var c=b.getCoordinates(),d,e,f,g,h,k,l;g=0;for(h=c.length;g<h;++g)for(d=c[g][0],e=0,f=d.length-1;e<f;++e)k=d.slice(e,e+2),l={feature:a,geometry:b,depth:[g],index:e,segment:k},this.rBush_.insert(ol.extent.boundingExtent(k),l)};ol.interaction.Modify.prototype.writeGeometryCollectionGeometry_=function(a,b){var c,d=b.getGeometriesArray();for(c=0;c<d.length;++c)this.SEGMENT_WRITERS_[d[c].getType()].call(this,a,d[c])};
|
|
ol.interaction.Modify.prototype.removeFeature_=function(a){var b=a.element;a=this.rBush_;var c,d=[];a.forEachInExtent(b.getGeometry().getExtent(),function(a){b===a.feature&&d.push(a)});for(c=d.length-1;0<=c;--c)a.remove(d[c]);goog.isNull(this.vertexFeature_)||0!==this.features_.getLength()||(this.overlay_.removeFeature(this.vertexFeature_),this.vertexFeature_=null)};
|
|
ol.interaction.Modify.prototype.createOrUpdateVertexFeature_=function(a){var b=this.vertexFeature_;goog.isNull(b)?(this.vertexFeature_=b=new ol.Feature(new ol.geom.Point(a)),this.overlay_.addFeature(b)):b.getGeometry().setCoordinates(a);return b};
|
|
ol.interaction.Modify.prototype.handleDragStart=function(a){this.dragSegments_=[];var b=this.vertexFeature_;if(!goog.isNull(b)){a=[];var b=b.getGeometry().getCoordinates(),c=ol.extent.boundingExtent([b]),d=[];this.rBush_.forEachInExtent(c,function(a){d.push(a)});for(var c={},e=0,f=d.length;e<f;++e){var g=d[e],h=g.segment;goog.getUid(g.feature)in c||(c[goog.getUid(g.feature)]=!0);ol.coordinate.equals(h[0],b)?this.dragSegments_.push([g,0]):ol.coordinate.equals(h[1],b)?this.dragSegments_.push([g,1]):
|
|
goog.getUid(h)in this.vertexSegments_&&a.push([g,b])}for(e=a.length-1;0<=e;--e)this.insertVertex_.apply(this,a[e])}return this.modifiable_};
|
|
ol.interaction.Modify.prototype.handleDrag=function(a){a=a.coordinate;for(var b=0,c=this.dragSegments_.length;b<c;++b){var d=this.dragSegments_[b],e=d[0],f=e.depth,g=e.geometry,h=g.getCoordinates(),k=e.segment,d=d[1];switch(g.getType()){case ol.geom.GeometryType.POINT:h=a;k[0]=k[1]=a;break;case ol.geom.GeometryType.MULTI_POINT:h[e.index]=a;k[0]=k[1]=a;break;case ol.geom.GeometryType.LINE_STRING:h[e.index+d]=a;k[d]=a;break;case ol.geom.GeometryType.MULTI_LINE_STRING:h[f[0]][e.index+d]=a;k[d]=a;break;
|
|
case ol.geom.GeometryType.POLYGON:h[0][e.index+d]=a;k[d]=a;break;case ol.geom.GeometryType.MULTI_POLYGON:h[f[0]][0][e.index+d]=a,k[d]=a}g.setCoordinates(h);f=ol.extent.boundingExtent(k);this.createOrUpdateVertexFeature_(a);this.rBush_.remove(e);this.rBush_.insert(f,e)}};ol.interaction.Modify.prototype.handleDragEnd=function(a){for(var b=this.dragSegments_.length-1;0<=b;--b)a=this.dragSegments_[b][0],this.rBush_.update(ol.extent.boundingExtent(a.segment),a)};
|
|
ol.interaction.Modify.prototype.handleMapBrowserEvent=function(a){a.map.getView().getHints()[ol.ViewHint.INTERACTING]||(this.getDragging()||a.type!=ol.MapBrowserEvent.EventType.MOUSEMOVE)||this.handleMouseMove_(a);ol.interaction.Modify.superClass_.handleMapBrowserEvent.call(this,a);return!this.modifiable_};ol.interaction.Modify.prototype.handleMouseMove_=function(a){this.lastPixel_=a.pixel;this.handleMouseAtPixel_(a.pixel,a.map)};
|
|
ol.interaction.Modify.prototype.handleMouseAtPixel_=function(a,b){var c=b.getCoordinateFromPixel(a),d=function(a,b){return ol.coordinate.squaredDistanceToSegment(c,a.segment)-ol.coordinate.squaredDistanceToSegment(c,b.segment)},e=b.getCoordinateFromPixel([a[0]-this.pixelTolerance_,a[1]+this.pixelTolerance_]),f=b.getCoordinateFromPixel([a[0]+this.pixelTolerance_,a[1]-this.pixelTolerance_]),e=ol.extent.boundingExtent([e,f]);this.modifiable_=!1;e=this.rBush_.getInExtent(e);if(0<e.length){e.sort(d);var d=
|
|
e[0].segment,f=ol.coordinate.closestOnSegment(c,d),g=b.getPixelFromCoordinate(f);if(Math.sqrt(ol.coordinate.squaredDistance(a,g))<=this.pixelTolerance_){var h=b.getPixelFromCoordinate(d[0]),k=b.getPixelFromCoordinate(d[1]),h=ol.coordinate.squaredDistance(g,h),g=ol.coordinate.squaredDistance(g,k);10>=Math.sqrt(Math.min(h,g))&&(f=h>g?d[1]:d[0]);this.createOrUpdateVertexFeature_(f);f={};f[goog.getUid(d)]=!0;k=1;for(h=e.length;k<h;++k)if(g=e[k].segment,ol.coordinate.equals(d[0],g[0])&&ol.coordinate.equals(d[1],
|
|
g[1])||ol.coordinate.equals(d[0],g[1])&&ol.coordinate.equals(d[1],g[0]))f[goog.getUid(g)]=!0;else break;this.vertexSegments_=f;this.modifiable_=!0;return}}goog.isNull(this.vertexFeature_)||(this.overlay_.removeFeature(this.vertexFeature_),this.vertexFeature_=null)};
|
|
ol.interaction.Modify.prototype.insertVertex_=function(a,b){var c=a.segment,d=a.feature,e=a.geometry,f=a.depth,g=a.index,h;switch(e.getType()){case ol.geom.GeometryType.MULTI_LINE_STRING:h=e.getCoordinates();h[f[0]].splice(g+1,0,b);break;case ol.geom.GeometryType.POLYGON:h=e.getCoordinates();h[0].splice(g+1,0,b);break;case ol.geom.GeometryType.MULTI_POLYGON:h=e.getCoordinates();h[f[0]][0].splice(g+1,0,b);break;case ol.geom.GeometryType.LINE_STRING:h=e.getCoordinates();h.splice(g+1,0,b);break;default:return}e.setCoordinates(h);
|
|
h=this.rBush_;h.remove(a);var k=goog.getUid(d),l=[];this.rBush_.forEachInExtent(e.getExtent(),function(a){goog.getUid(a.feature)===k&&l.push(a)});for(var m=0,n=l.length;m<n;++m){var p=l[m];p.geometry===e&&p.index>g&&++p.index}m={segment:[c[0],b],feature:d,geometry:e,depth:f,index:g};h.insert(ol.extent.boundingExtent(m.segment),m);this.dragSegments_.push([m,1]);c={segment:[b,c[1]],feature:d,geometry:e,depth:f,index:g+1};h.insert(ol.extent.boundingExtent(c.segment),c);this.dragSegments_.push([c,0])};ol.interaction.Select=function(a){ol.interaction.Interaction.call(this);this.condition_=goog.isDef(a.condition)?a.condition:ol.events.condition.singleClick;this.addCondition_=goog.isDef(a.addCondition)?a.addCondition:ol.events.condition.shiftKeyOnly;var b;if(goog.isDef(a.layerFilter))b=a.layerFilter;else if(goog.isDef(a.layer)){var c=a.layer;b=function(a){return a===c}}else if(goog.isDef(a.layers)){var d=a.layers;b=function(a){return-1!=goog.array.indexOf(d,a)}}else b=goog.functions.TRUE;this.layerFilter_=
|
|
b;this.featureOverlay_=new ol.FeatureOverlay({style:a.style})};goog.inherits(ol.interaction.Select,ol.interaction.Interaction);ol.interaction.Select.prototype.getFeatures=function(){return this.featureOverlay_.getFeatures()};
|
|
ol.interaction.Select.prototype.handleMapBrowserEvent=function(a){if(!this.condition_(a))return!0;var b=this.addCondition_(a),c=a.map,d=this.featureOverlay_.getFeatures();b?c.forEachFeatureAtPixel(a.pixel,function(a,b){-1==goog.array.indexOf(d.getArray(),a)&&d.push(a)},void 0,this.layerFilter_):(a=c.forEachFeatureAtPixel(a.pixel,function(a,b){return a},void 0,this.layerFilter_),goog.isDef(a)?1==d.getLength()?d.getAt(0)!==a&&d.setAt(0,a):(1!=d.getLength()&&d.clear(),d.push(a)):0!==d.getLength()&&d.clear());
|
|
return!1};ol.interaction.Select.prototype.setMap=function(a){ol.interaction.Select.superClass_.setMap.call(this,a);this.featureOverlay_.setMap(a)};ol.layer.HeatmapLayerProperty={GRADIENT:"gradient"};
|
|
ol.layer.Heatmap=function(a){var b=goog.isDef(a)?a:{};ol.layer.Vector.call(this,b);this.gradient_=null;goog.events.listen(this,ol.Object.getChangeEventType(ol.layer.HeatmapLayerProperty.GRADIENT),this.handleGradientChanged_,!1,this);this.setGradient(goog.isDef(b.gradient)?b.gradient:ol.layer.Heatmap.DEFAULT_GRADIENT);a=goog.isDef(b.radius)?b.radius:8;var c=goog.isDef(b.blur)?b.blur:15,b=goog.isDef(b.shadow)?b.shadow:250;a=new ol.style.Style({image:ol.layer.Heatmap.createIcon_(a,c,b)});this.setStyle(a);
|
|
goog.events.listen(this,ol.render.EventType.RENDER,this.handleRender_,!1,this)};goog.inherits(ol.layer.Heatmap,ol.layer.Vector);ol.layer.Heatmap.DEFAULT_GRADIENT=["#00f","#0ff","#0f0","#ff0","#f00"];
|
|
ol.layer.Heatmap.createGradient_=function(a){var b=goog.dom.createElement(goog.dom.TagName.CANVAS),c=b.getContext("2d");b.width=1;b.height=256;for(var b=c.createLinearGradient(0,0,1,256),d=1/a.length,e=0,f=a.length;e<f;++e)b.addColorStop(e*d,a[e]);c.fillStyle=b;c.fillRect(0,0,1,256);return c.getImageData(0,0,1,256).data};
|
|
ol.layer.Heatmap.createIcon_=function(a,b,c){var d=goog.dom.createElement(goog.dom.TagName.CANVAS),e=d.getContext("2d"),f=a+b+1;d.width=d.height=2*f;e.shadowOffsetX=e.shadowOffsetY=c;e.shadowBlur=b;e.shadowColor="#000";e.beginPath();b=f-c;e.arc(b,b,a,0,2*Math.PI,!0);e.fill();return new ol.style.Icon({src:d.toDataURL()})};ol.layer.Heatmap.prototype.getGradient=function(){return this.get(ol.layer.HeatmapLayerProperty.GRADIENT)};goog.exportProperty(ol.layer.Heatmap.prototype,"getGradient",ol.layer.Heatmap.prototype.getGradient);
|
|
ol.layer.Heatmap.prototype.handleGradientChanged_=function(){this.gradient_=ol.layer.Heatmap.createGradient_(this.getGradient())};ol.layer.Heatmap.prototype.handleRender_=function(a){a=a.context;var b=a.canvas,b=a.getImageData(0,0,b.width,b.height),c=b.data,d,e,f;d=0;for(e=c.length;d<e;d+=4)if(f=4*c[d+3])c[d]=this.gradient_[f],c[d+1]=this.gradient_[f+1],c[d+2]=this.gradient_[f+2];a.putImageData(b,0,0)};
|
|
ol.layer.Heatmap.prototype.setGradient=function(a){this.set(ol.layer.HeatmapLayerProperty.GRADIENT,a)};goog.exportProperty(ol.layer.Heatmap.prototype,"setGradient",ol.layer.Heatmap.prototype.setGradient);ol.parser={};ol.parser.Parser=function(){};ol.parser.XML=function(){goog.global.ActiveXObject&&(this.xmldom=new ActiveXObject("Microsoft.XMLDOM"));this.regExes={trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g}};goog.inherits(ol.parser.XML,ol.parser.Parser);ol.parser.XML.prototype.readNode=function(a,b){b||(b={});var c=this.readers[a.namespaceURI]||this.readers[this.defaultNamespaceURI];if(c){var d=a.localName||a.nodeName.split(":").pop();(c=c[d]||c["*"])&&c.apply(this,[a,b])}return b};
|
|
ol.parser.XML.prototype.readChildNodes=function(a,b){b||(b={});for(var c=a.childNodes,d,e=0,f=c.length;e<f;++e)d=c[e],1==d.nodeType&&this.readNode(d,b);return b};ol.parser.XML.prototype.getChildValue=function(a,b){var c=b||"";if(a)for(var d=a.firstChild;d;d=d.nextSibling)switch(d.nodeType){case 3:case 4:c+=d.nodeValue}return c};
|
|
ol.parser.XML.prototype.getAttributeNodeNS=function(a,b,c){var d=null;if(a.getAttributeNodeNS)d=a.getAttributeNodeNS(b,c);else{a=a.attributes;for(var e,f,g=0,h=a.length;g<h;++g)if(e=a[g],e.namespaceURI==b&&(f=e.prefix?e.prefix+":"+c:c,f==e.nodeName)){d=e;break}}return d};ol.parser.XML.prototype.getAttributeNS=function(a,b,c){var d="";if(a.getAttributeNS)d=a.getAttributeNS(b,c)||"";else if(a=this.getAttributeNodeNS(a,b,c))d=a.nodeValue;return d};
|
|
ol.parser.XML.prototype.createElementNS=function(a,b){var c=b?b:this.defaultNamespaceURI;return this.xmldom?this.xmldom.createNode(1,a,c):document.createElementNS(c,a)};ol.parser.XML.prototype.writeNode=function(a,b,c,d){var e=null;goog.isDef(this.writers)&&(e=this.writers[c?c:this.defaultNamespaceURI][a].apply(this,[b]),d&&e&&d.appendChild(e));return e};ol.parser.XML.prototype.createTextNode=function(a){return this.xmldom?this.xmldom.createTextNode(a):document.createTextNode(a)};
|
|
ol.parser.XML.prototype.setAttributeNS=function(a,b,c,d){if(a.setAttributeNS)a.setAttributeNS(b,c,d);else if(this.xmldom)b?(b=a.ownerDocument.createNode(2,c,b),b.nodeValue=d,a.setAttributeNode(b)):a.setAttribute(c,d);else throw Error("setAttributeNS not implemented");};ol.parser.XML.prototype.serialize=function(a){if(this.xmldom)return a.xml;if(1==a.nodeType){var b=document.implementation.createDocument("","",null);b.importNode?b.appendChild(b.importNode(a,!0)):b.appendChild(a);return goog.dom.xml.serialize(b)}return goog.dom.xml.serialize(a)};
|
|
ol.parser.XML.prototype.createDocumentFragment=function(){return this.xmldom?this.xmldom.createDocumentFragment():document.createDocumentFragment()};ol.parser.ogc={};
|
|
ol.parser.ogc.ExceptionReport=function(){var a=function(a,b){var e={code:a.getAttribute("exceptionCode"),locator:a.getAttribute("locator"),texts:[]};b.exceptions.push(e);this.readChildNodes(a,e)},b=function(a,b){var e=this.getChildValue(a);b.texts.push(e)};this.readers={"http://www.opengis.net/ogc":{ServiceExceptionReport:function(a,b){b.exceptionReport={};b.exceptionReport.exceptions=[];this.readChildNodes(a,b.exceptionReport)},ServiceException:function(a,b){var e={};e.code=a.getAttribute("code");e.locator=
|
|
a.getAttribute("locator");e.text=this.getChildValue(a);b.exceptions.push(e)}},"http://www.opengis.net/ows":{ExceptionReport:function(a,b){b.success=!1;b.exceptionReport={version:a.getAttribute("version"),language:a.getAttribute("language"),exceptions:[]};this.readChildNodes(a,b.exceptionReport)},Exception:function(b,d){a.apply(this,arguments)},ExceptionText:function(a,d){b.apply(this,arguments)}},"http://www.opengis.net/ows/1.1":{ExceptionReport:function(a,b){b.exceptionReport={version:a.getAttribute("version"),
|
|
language:a.getAttribute("xml:lang"),exceptions:[]};this.readChildNodes(a,b.exceptionReport)},Exception:function(b,d){a.apply(this,arguments)},ExceptionText:function(a,d){b.apply(this,arguments)}}};ol.parser.XML.call(this)};goog.inherits(ol.parser.ogc.ExceptionReport,ol.parser.XML);ol.parser.ogc.ExceptionReport.prototype.read=function(a){goog.isString(a)&&(a=goog.dom.xml.loadXml(a));var b={exceptionReport:null};a&&this.readChildNodes(a,b);return b};ol.parser.ogc.Versioned=function(a){this.options=a=goog.isDef(a)?a:{};this.defaultVersion=a.defaultVersion||null;this.version=a.version;this.profile=a.profile;goog.isDef(a.allowFallback)?this.allowFallback=a.allowFallback:this.allowFallback=!1;goog.isDef(a.stringifyOutput)?this.stringifyOutput=a.stringifyOutput:this.stringifyOutput=!1};
|
|
ol.parser.ogc.Versioned.prototype.getVersion=function(a,b){var c;a?(c=this.version,c||(c=a.getAttribute("version"),c||(c=this.defaultVersion))):c=b&&b.version||this.version||this.defaultVersion;return c};
|
|
ol.parser.ogc.Versioned.prototype.getParser=function(a){a=a||this.defaultVersion;var b=this.profile?"_"+this.profile:"";if(!this.parser||this.parser.VERSION!=a){var c=this.parsers["v"+a.replace(/\./g,"_")+b];if(!c&&(""!==b&&this.allowFallback&&(b="",c=this.parsers["v"+a.replace(/\./g,"_")+b]),!c))throw"Can't find a parser for version "+a+b;this.parser=new c(this.options)}return this.parser};
|
|
ol.parser.ogc.Versioned.prototype.write=function(a,b){var c=this.getVersion(null,b);this.parser=this.getParser(c);c=this.parser.write(a,b);return!1===this.stringifyOutput?c:goog.dom.xml.serialize(c)};
|
|
ol.parser.ogc.Versioned.prototype.read=function(a,b){goog.isString(a)&&(a=goog.dom.xml.loadXml(a));var c=this.getVersion(a.documentElement);this.parser=this.getParser(c);var d=this.parser.read(a,b),e=this.parser.errorProperty||null;null!==e&&void 0===d[e]&&(e=new ol.parser.ogc.ExceptionReport,d.error=e.read(a));d.version=c;return d};ol.parser.ogc.WMSCapabilities_v1=function(){this.defaultNamespaceURI="http://www.opengis.net/wms";this.errorProperty="service";this.readers={"http://www.opengis.net/wms":{Service:function(a,b){b.service={};this.readChildNodes(a,b.service)},Name:function(a,b){b.name=this.getChildValue(a)},Title:function(a,b){b.title=this.getChildValue(a)},Abstract:function(a,b){b["abstract"]=this.getChildValue(a)},BoundingBox:function(a,b){var c={};c.bbox=[parseFloat(a.getAttribute("minx")),parseFloat(a.getAttribute("miny")),
|
|
parseFloat(a.getAttribute("maxx")),parseFloat(a.getAttribute("maxy"))];var d={x:parseFloat(a.getAttribute("resx")),y:parseFloat(a.getAttribute("resy"))};isNaN(d.x)&&isNaN(d.y)||(c.res=d);return c},OnlineResource:function(a,b){b.href=this.getAttributeNS(a,"http://www.w3.org/1999/xlink","href")},ContactInformation:function(a,b){b.contactInformation={};this.readChildNodes(a,b.contactInformation)},ContactPersonPrimary:function(a,b){b.personPrimary={};this.readChildNodes(a,b.personPrimary)},ContactPerson:function(a,
|
|
b){b.person=this.getChildValue(a)},ContactOrganization:function(a,b){b.organization=this.getChildValue(a)},ContactPosition:function(a,b){b.position=this.getChildValue(a)},ContactAddress:function(a,b){b.contactAddress={};this.readChildNodes(a,b.contactAddress)},AddressType:function(a,b){b.type=this.getChildValue(a)},Address:function(a,b){b.address=this.getChildValue(a)},City:function(a,b){b.city=this.getChildValue(a)},StateOrProvince:function(a,b){b.stateOrProvince=this.getChildValue(a)},PostCode:function(a,
|
|
b){b.postcode=this.getChildValue(a)},Country:function(a,b){b.country=this.getChildValue(a)},ContactVoiceTelephone:function(a,b){b.phone=this.getChildValue(a)},ContactFacsimileTelephone:function(a,b){b.fax=this.getChildValue(a)},ContactElectronicMailAddress:function(a,b){b.email=this.getChildValue(a)},Fees:function(a,b){var c=this.getChildValue(a);c&&"none"!=c.toLowerCase()&&(b.fees=c)},AccessConstraints:function(a,b){var c=this.getChildValue(a);c&&"none"!=c.toLowerCase()&&(b.accessConstraints=c)},
|
|
Capability:function(a,b){b.capability={};b.capability.nestedLayers=[];b.capability.layers=[];this.readChildNodes(a,b.capability)},Request:function(a,b){b.request={};this.readChildNodes(a,b.request)},GetCapabilities:function(a,b){b.getcapabilities={};b.getcapabilities.formats=[];this.readChildNodes(a,b.getcapabilities)},Format:function(a,b){goog.isArray(b.formats)?b.formats.push(this.getChildValue(a)):b.format=this.getChildValue(a)},DCPType:function(a,b){this.readChildNodes(a,b)},HTTP:function(a,b){this.readChildNodes(a,
|
|
b)},Get:function(a,b){b.get={};this.readChildNodes(a,b.get)},Post:function(a,b){b.post={};this.readChildNodes(a,b.post)},GetMap:function(a,b){b.getmap={};b.getmap.formats=[];this.readChildNodes(a,b.getmap)},GetFeatureInfo:function(a,b){b.getfeatureinfo={};b.getfeatureinfo.formats=[];this.readChildNodes(a,b.getfeatureinfo)},Exception:function(a,b){b.exception={};b.exception.formats=[];this.readChildNodes(a,b.exception)},Layer:function(a,b){var c,d;b.capability?(d=b.capability,c=b):d=b;var e=a.getAttributeNode("queryable"),
|
|
f=e&&e.specified?a.getAttribute("queryable"):null,g=(e=a.getAttributeNode("cascaded"))&&e.specified?a.getAttribute("cascaded"):null,h=(e=a.getAttributeNode("opaque"))&&e.specified?a.getAttribute("opaque"):null,k=a.getAttribute("noSubsets"),l=a.getAttribute("fixedWidth"),m=a.getAttribute("fixedHeight"),e=c||{},f={nestedLayers:[],styles:c?[].concat(c.styles):[],srs:{},metadataURLs:[],bbox:{},llbbox:e.llbbox,dimensions:{},authorityURLs:{},identifiers:{},keywords:[],queryable:f&&""!==f?"1"===f||"true"===
|
|
f:e.queryable||!1,cascaded:null!==g?parseInt(g,10):e.cascaded||0,opaque:h?"1"===h||"true"===h:e.opaque||!1,noSubsets:null!==k?"1"===k||"true"===k:e.noSubsets||!1,fixedWidth:null!==l?parseInt(l,10):e.fixedWidth||0,fixedHeight:null!==m?parseInt(m,10):e.fixedHeight||0,minScale:e.minScale,maxScale:e.maxScale,attribution:e.attribution};c&&(goog.object.extend(f.srs,e.srs),goog.object.extend(f.bbox,e.bbox),goog.object.extend(f.dimensions,e.dimensions),goog.object.extend(f.authorityURLs,e.authorityURLs));
|
|
b.nestedLayers.push(f);f.capability=d;this.readChildNodes(a,f);delete f.capability;f.name&&(c=f.name.split(":"),g=d.request,e=g.getfeatureinfo,0<c.length&&(f.prefix=c[0]),d.layers.push(f),goog.isDef(f.formats)||(f.formats=g.getmap.formats),!goog.isDef(f.infoFormats)&&e&&(f.infoFormats=e.formats))},Attribution:function(a,b){b.attribution={};this.readChildNodes(a,b.attribution)},LogoURL:function(a,b){b.logo={width:a.getAttribute("width"),height:a.getAttribute("height")};this.readChildNodes(a,b.logo)},
|
|
Style:function(a,b){var c={};b.styles.push(c);this.readChildNodes(a,c)},LegendURL:function(a,b){var c={width:a.getAttribute("width"),height:a.getAttribute("height")};b.legend=c;this.readChildNodes(a,c)},MetadataURL:function(a,b){var c={type:a.getAttribute("type")};b.metadataURLs.push(c);this.readChildNodes(a,c)},DataURL:function(a,b){b.dataURL={};this.readChildNodes(a,b.dataURL)},FeatureListURL:function(a,b){b.featureListURL={};this.readChildNodes(a,b.featureListURL)},AuthorityURL:function(a,b){var c=
|
|
a.getAttribute("name"),d={};this.readChildNodes(a,d);b.authorityURLs[c]=d.href},Identifier:function(a,b){var c=a.getAttribute("authority");b.identifiers[c]=this.getChildValue(a)},KeywordList:function(a,b){this.readChildNodes(a,b)},SRS:function(a,b){b.srs[this.getChildValue(a)]=!0}}};ol.parser.XML.call(this)};goog.inherits(ol.parser.ogc.WMSCapabilities_v1,ol.parser.XML);
|
|
ol.parser.ogc.WMSCapabilities_v1.prototype.read=function(a){goog.isString(a)&&(a=goog.dom.xml.loadXml(a));a&&9==a.nodeType&&(a=a.documentElement);var b={};this.readNode(a,b);return b};ol.parser.ogc.WMSCapabilities_v1_1=function(){ol.parser.ogc.WMSCapabilities_v1.call(this);var a=this.readers["http://www.opengis.net/wms"].BoundingBox;goog.object.extend(this.readers["http://www.opengis.net/wms"],{WMT_MS_Capabilities:function(a,c){this.readChildNodes(a,c)},Keyword:function(a,c){c.keywords&&c.keywords.push({value:this.getChildValue(a)})},DescribeLayer:function(a,c){c.describelayer={formats:[]};this.readChildNodes(a,c.describelayer)},GetLegendGraphic:function(a,c){c.getlegendgraphic=
|
|
{formats:[]};this.readChildNodes(a,c.getlegendgraphic)},GetStyles:function(a,c){c.getstyles={formats:[]};this.readChildNodes(a,c.getstyles)},PutStyles:function(a,c){c.putstyles={formats:[]};this.readChildNodes(a,c.putstyles)},UserDefinedSymbolization:function(a,c){var d={supportSLD:1==parseInt(a.getAttribute("SupportSLD"),10),userLayer:1==parseInt(a.getAttribute("UserLayer"),10),userStyle:1==parseInt(a.getAttribute("UserStyle"),10),remoteWFS:1==parseInt(a.getAttribute("RemoteWFS"),10)};c.userSymbols=
|
|
d},LatLonBoundingBox:function(a,c){c.llbbox=[parseFloat(a.getAttribute("minx")),parseFloat(a.getAttribute("miny")),parseFloat(a.getAttribute("maxx")),parseFloat(a.getAttribute("maxy"))]},BoundingBox:function(b,c){var d=a.apply(this,arguments);d.srs=b.getAttribute("SRS");c.bbox[d.srs]=d},ScaleHint:function(a,c){var d=parseFloat(a.getAttribute("min")),e=parseFloat(a.getAttribute("max")),f=Math.pow(2,0.5),g=25.4/0.28;0!==d&&(c.maxScale=parseFloat(39.37*(d/f)*g));Infinity!=e&&(c.minScale=parseFloat(39.37*
|
|
(e/f)*g))},Dimension:function(a,c){var d={name:a.getAttribute("name").toLowerCase(),units:a.getAttribute("units"),unitsymbol:a.getAttribute("unitSymbol")};c.dimensions[d.name]=d},Extent:function(a,c){var d=a.getAttribute("name").toLowerCase();if(d in c.dimensions){d=c.dimensions[d];d.nearestVal="1"===a.getAttribute("nearestValue");d.multipleVal="1"===a.getAttribute("multipleValues");d.current="1"===a.getAttribute("current");d["default"]=a.getAttribute("default")||"";var e=this.getChildValue(a);d.values=
|
|
e.split(",")}}})};goog.inherits(ol.parser.ogc.WMSCapabilities_v1_1,ol.parser.ogc.WMSCapabilities_v1);ol.parser.ogc.WMSCapabilities_v1_1_0=function(){ol.parser.ogc.WMSCapabilities_v1_1.call(this);this.version="1.1.0";goog.object.extend(this.readers["http://www.opengis.net/wms"],{SRS:function(a,b){for(var c=this.getChildValue(a).split(/ +/),d=0,e=c.length;d<e;d++)b.srs[c[d]]=!0}})};goog.inherits(ol.parser.ogc.WMSCapabilities_v1_1_0,ol.parser.ogc.WMSCapabilities_v1_1);ol.parser.ogc.WMSCapabilities_v1_0_0=function(){ol.parser.ogc.WMSCapabilities_v1_1_0.call(this);this.version="1.0.0";goog.object.extend(this.readers["http://www.opengis.net/wms"],{Format:function(a,b){for(var c=0,d=a.childNodes.length;c<d;c++){var e=a.childNodes[c],e=e.localName||e.nodeName.split(":").pop();goog.isArray(b.formats)?b.formats.push(e):b.format=e}},Keywords:function(a,b){goog.isDef(b.keywords)||(b.keywords=[]);for(var c=this.getChildValue(a).split(/ +/),d=0,e=c.length;d<e;++d)goog.string.isEmpty(c[d])||
|
|
b.keywords.push({value:c[d]})},OnlineResource:function(a,b){b.href=this.getChildValue(a)},Get:function(a,b){b.get={href:a.getAttribute("onlineResource")}},Post:function(a,b){b.post={href:a.getAttribute("onlineResource")}},Map:function(a,b){this.readers[this.defaultNamespaceURI].GetMap.apply(this,arguments)},Capabilities:function(a,b){this.readers[this.defaultNamespaceURI].GetCapabilities.apply(this,arguments)},FeatureInfo:function(a,b){this.readers[this.defaultNamespaceURI].GetFeatureInfo.apply(this,
|
|
arguments)}})};goog.inherits(ol.parser.ogc.WMSCapabilities_v1_0_0,ol.parser.ogc.WMSCapabilities_v1_1_0);ol.parser.ogc.WMSCapabilities_v1_1_1=function(){ol.parser.ogc.WMSCapabilities_v1_1.call(this);this.version="1.1.1";goog.object.extend(this.readers["http://www.opengis.net/wms"],{SRS:function(a,b){b.srs[this.getChildValue(a)]=!0}})};goog.inherits(ol.parser.ogc.WMSCapabilities_v1_1_1,ol.parser.ogc.WMSCapabilities_v1_1);ol.parser.ogc.WMSCapabilities_v1_1_1_WMSC=function(){ol.parser.ogc.WMSCapabilities_v1_1_1.call(this);this.profile="WMSC";goog.object.extend(this.readers["http://www.opengis.net/wms"],{VendorSpecificCapabilities:function(a,b){b.vendorSpecific={tileSets:[]};this.readChildNodes(a,b.vendorSpecific)},TileSet:function(a,b){var c={srs:{},bbox:{},resolutions:[]};this.readChildNodes(a,c);b.tileSets.push(c)},Resolutions:function(a,b){for(var c=this.getChildValue(a).split(" "),d=0,e=c.length;d<e;d++)""!==c[d]&&
|
|
b.resolutions.push(parseFloat(c[d]))},Width:function(a,b){b.width=parseInt(this.getChildValue(a),10)},Height:function(a,b){b.height=parseInt(this.getChildValue(a),10)},Layers:function(a,b){b.layers=this.getChildValue(a)},Styles:function(a,b){b.styles=this.getChildValue(a)}})};goog.inherits(ol.parser.ogc.WMSCapabilities_v1_1_1_WMSC,ol.parser.ogc.WMSCapabilities_v1_1_1);ol.parser.ogc.WMSCapabilities_v1_3_0=function(){ol.parser.ogc.WMSCapabilities_v1.call(this);var a=this.readers["http://www.opengis.net/wms"].BoundingBox;goog.object.extend(this.readers["http://www.opengis.net/wms"],{WMS_Capabilities:function(a,c){this.readChildNodes(a,c)},LayerLimit:function(a,c){c.layerLimit=parseInt(this.getChildValue(a),10)},MaxWidth:function(a,c){c.maxWidth=parseInt(this.getChildValue(a),10)},MaxHeight:function(a,c){c.maxHeight=parseInt(this.getChildValue(a),10)},BoundingBox:function(b,
|
|
c){var d=a.apply(this,arguments);d.srs=b.getAttribute("CRS");c.bbox[d.srs]=d},CRS:function(a,c){this.readers["http://www.opengis.net/wms"].SRS.apply(this,arguments)},EX_GeographicBoundingBox:function(a,c){c.llbbox=[];this.readChildNodes(a,c.llbbox)},westBoundLongitude:function(a,c){c[0]=this.getChildValue(a)},eastBoundLongitude:function(a,c){c[2]=this.getChildValue(a)},southBoundLatitude:function(a,c){c[1]=this.getChildValue(a)},northBoundLatitude:function(a,c){c[3]=this.getChildValue(a)},MinScaleDenominator:function(a,
|
|
c){c.maxScale=parseFloat(this.getChildValue(a)).toPrecision(16)},MaxScaleDenominator:function(a,c){c.minScale=parseFloat(this.getChildValue(a)).toPrecision(16)},Dimension:function(a,c){var d={name:a.getAttribute("name").toLowerCase(),units:a.getAttribute("units"),unitsymbol:a.getAttribute("unitSymbol"),nearestVal:"1"===a.getAttribute("nearestValue"),multipleVal:"1"===a.getAttribute("multipleValues"),"default":a.getAttribute("default")||"",current:"1"===a.getAttribute("current"),values:this.getChildValue(a).split(",")};
|
|
c.dimensions[d.name]=d},Keyword:function(a,c){var d={value:this.getChildValue(a),vocabulary:a.getAttribute("vocabulary")};c.keywords&&c.keywords.push(d)}});this.readers.sld={UserDefinedSymbolization:function(a,c){this.readers["http://www.opengis.net/wms"].UserDefinedSymbolization.apply(this,arguments);var d=a.getAttribute("InlineFeature");c.userSymbols.inlineFeature=1==parseInt(d,10);d=a.getAttribute("RemoteWCS");c.userSymbols.remoteWCS=1==parseInt(d,10)},DescribeLayer:function(a,c){this.readers["http://www.opengis.net/wms"].DescribeLayer.apply(this,
|
|
arguments)},GetLegendGraphic:function(a,c){this.readers["http://www.opengis.net/wms"].GetLegendGraphic.apply(this,arguments)}}};goog.inherits(ol.parser.ogc.WMSCapabilities_v1_3_0,ol.parser.ogc.WMSCapabilities_v1);ol.ENABLE_WMSCAPS_1_0_0=!1;ol.ENABLE_WMSCAPS_1_1_0=!0;ol.ENABLE_WMSCAPS_1_1_1=!0;ol.ENABLE_WMSCAPS_1_3_0=!0;ol.ENABLE_WMSCAPS_1_1_1_WMSC=!0;
|
|
ol.parser.ogc.WMSCapabilities=function(a){a=a||{};a.defaultVersion="1.1.1";this.parsers={};ol.ENABLE_WMSCAPS_1_0_0&&(this.parsers.v1_0_0=ol.parser.ogc.WMSCapabilities_v1_0_0);ol.ENABLE_WMSCAPS_1_1_0&&(this.parsers.v1_1_0=ol.parser.ogc.WMSCapabilities_v1_1_0);ol.ENABLE_WMSCAPS_1_1_1&&(this.parsers.v1_1_1=ol.parser.ogc.WMSCapabilities_v1_1_1);ol.ENABLE_WMSCAPS_1_1_1_WMSC&&(this.parsers.v1_1_1_WMSC=ol.parser.ogc.WMSCapabilities_v1_1_1_WMSC);ol.ENABLE_WMSCAPS_1_3_0&&(this.parsers.v1_3_0=ol.parser.ogc.WMSCapabilities_v1_3_0);
|
|
ol.parser.ogc.Versioned.call(this,a)};goog.inherits(ol.parser.ogc.WMSCapabilities,ol.parser.ogc.Versioned);ol.proj.CH=function(a){ol.proj.Projection.call(this,{code:a.code,extent:a.extent,global:!1,units:ol.proj.Units.METERS})};goog.inherits(ol.proj.CH,ol.proj.Projection);ol.proj.CH.PHI0=goog.math.toRadians(169028.66/3600);ol.proj.CH.LAMBDA0=goog.math.toRadians(26782.5/3600);ol.proj.CH.ELLIPSOID=ol.ellipsoid.BESSEL1841;ol.proj.CH.COS_PHI0=Math.cos(ol.proj.CH.PHI0);ol.proj.CH.SIN_PHI0=Math.sin(ol.proj.CH.PHI0);
|
|
ol.proj.CH.R=ol.proj.CH.ELLIPSOID.a*Math.sqrt(1-ol.proj.CH.ELLIPSOID.eSquared)/(1-ol.proj.CH.ELLIPSOID.eSquared*ol.proj.CH.SIN_PHI0*ol.proj.CH.SIN_PHI0);ol.proj.CH.ALPHA=Math.sqrt(1+ol.proj.CH.ELLIPSOID.eSquared*Math.pow(ol.proj.CH.COS_PHI0,4)/(1-ol.proj.CH.ELLIPSOID.eSquared));ol.proj.CH.SIN_B0=ol.proj.CH.SIN_PHI0/ol.proj.CH.ALPHA;ol.proj.CH.B0=Math.asin(ol.proj.CH.SIN_B0);ol.proj.CH.COS_B0=Math.cos(ol.proj.CH.B0);
|
|
ol.proj.CH.K=Math.log(Math.tan(Math.PI/4+ol.proj.CH.B0/2))-ol.proj.CH.ALPHA*Math.log(Math.tan(Math.PI/4+ol.proj.CH.PHI0/2))+ol.proj.CH.ALPHA*ol.proj.CH.ELLIPSOID.e*Math.log((1+ol.proj.CH.ELLIPSOID.e*ol.proj.CH.SIN_PHI0)/(1-ol.proj.CH.ELLIPSOID.e*ol.proj.CH.SIN_PHI0))/2;
|
|
ol.proj.CH.add=function(){ol.proj.EPSG2056.add();ol.proj.EPSG21781.add();var a=ol.proj.get("EPSG:2056"),b=ol.proj.get("EPSG:21781");ol.proj.addTransform(a,b,goog.partial(ol.proj.CH.translate_,-2E6,-1E6));ol.proj.addTransform(b,a,goog.partial(ol.proj.CH.translate_,2E6,1E6))};
|
|
ol.proj.CH.fromEPSG4326Approximate_=function(a,b,c,d,e){var f=c.length;e=goog.isDef(e)?e:2;d=goog.isDef(d)?d:2<e?c.slice():Array(f);var g,h,k;for(k=0;k<f;k+=e)g=36*c[k+1]/100-16.902866,h=36*c[k]/100-2.67825,d[k]=a+72.37+211455.93*h-10938.51*h*g-0.36*h*g*g-44.54*h*h*h,d[k+1]=b+147.07+308807.95*g+3745.25*h*h+76.63*g*g-194.56*h*h*g+119.79*g*g*g;return d};
|
|
ol.proj.CH.fromEPSG4326Rigorous_=function(a,b,c,d,e){var f=c.length;e=goog.isDef(e)?e:2;d=goog.isDef(d)?d:2<e?c.slice():Array(f);var g,h,k,l;for(h=0;h<f;h+=e)l=goog.math.toRadians(c[h]),k=goog.math.toRadians(c[h+1]),g=ol.proj.CH.ELLIPSOID.e*Math.sin(k),g=ol.proj.CH.ALPHA*Math.log(Math.tan(Math.PI/4+k/2))-ol.proj.CH.ALPHA*ol.proj.CH.ELLIPSOID.e*Math.log((1+g)/(1-g))/2+ol.proj.CH.K,g=2*(Math.atan(Math.exp(g))-Math.PI/4),k=ol.proj.CH.ALPHA*(l-ol.proj.CH.LAMBDA0),l=Math.atan2(Math.sin(k),ol.proj.CH.SIN_B0*
|
|
Math.tan(g)+ol.proj.CH.COS_B0*Math.cos(k)),g=Math.asin(ol.proj.CH.COS_B0*Math.sin(g)-ol.proj.CH.SIN_B0*Math.cos(g)*Math.cos(k)),d[h]=a+ol.proj.CH.R*l,d[h+1]=b+ol.proj.CH.R*Math.log((1+Math.sin(g))/(1-Math.sin(g)))/2;return d};
|
|
ol.proj.CH.toEPSG4326Approximate_=function(a,b,c,d,e){var f=c.length;e=goog.isDef(e)?e:2;d=goog.isDef(d)?d:2<e?c.slice():Array(f);var g,h,k;for(k=0;k<f;k+=e)h=(c[k]-a)/1E6,g=(c[k+1]-b)/1E6,d[k]=100*(2.6779094+4.728982*h+0.791484*h*g+0.1306*h*g*g-0.0436*h*h*h)/36,d[k+1]=100*(16.9023892+3.238272*g-0.270978*h*h-0.002528*g*g-0.0447*h*h*g-0.014*g*g*g)/36;return d};
|
|
ol.proj.CH.toEPSG4326Rigorous_=function(a,b,c,d,e){var f=c.length;e=goog.isDef(e)?e:2;d=goog.isDef(d)?d:2<e?c.slice():Array(f);var g,h,k,l,m,n;for(k=0;k<f;k+=e){l=c[k]-a;g=c[k+1]-b;l/=ol.proj.CH.R;h=2*(Math.atan(Math.exp(g/ol.proj.CH.R))-Math.PI/4);g=Math.asin(ol.proj.CH.COS_B0*Math.sin(h)+ol.proj.CH.SIN_B0*Math.cos(h)*Math.cos(l));l=Math.atan2(Math.sin(l),ol.proj.CH.COS_B0*Math.cos(l)-ol.proj.CH.SIN_B0*Math.tan(h));h=ol.proj.CH.LAMBDA0+l/ol.proj.CH.ALPHA;m=n=g;for(l=20;0<l;--l){n=(Math.log(Math.tan(Math.PI/
|
|
4+g/2))-ol.proj.CH.K)/ol.proj.CH.ALPHA+ol.proj.CH.ELLIPSOID.e*Math.log(Math.tan(Math.PI/4+Math.asin(ol.proj.CH.ELLIPSOID.e*Math.sin(n))/2));n=2*Math.atan(Math.exp(n))-Math.PI/2;if(1E-7>Math.abs(n-m))break;m=n}d[k]=goog.math.toDegrees(h);d[k+1]=goog.math.toDegrees(n)}return d};ol.proj.CH.translate_=function(a,b,c,d,e){var f=c.length;e=goog.isDef(e)?e:2;d=goog.isDef(d)?d:2<e?c.slice():Array(f);var g;for(g=0;g<f;g+=e)d[g]=c[g]+a,d[g+1]=c[g+1]+b;return d};
|
|
ol.proj.CH.prototype.getPointResolution=function(a,b){return a};ol.proj.EPSG2056=function(){ol.proj.CH.call(this,{code:"EPSG:2056",extent:ol.proj.EPSG2056.EXTENT})};goog.inherits(ol.proj.EPSG2056,ol.proj.CH);ol.proj.EPSG2056.EXTENT=[2485869.5728,1076443.1884,2837076.5648,1299941.7864];
|
|
ol.proj.EPSG2056.add=function(){ol.proj.addEquivalentProjections(ol.proj.EPSG4326.PROJECTIONS);var a=new ol.proj.EPSG2056;ol.proj.addProjection(a);ol.proj.addEquivalentTransforms(ol.proj.EPSG4326.PROJECTIONS,[a],goog.partial(ol.proj.CH.fromEPSG4326Rigorous_,26E5,12E5),goog.partial(ol.proj.CH.toEPSG4326Rigorous_,26E5,12E5))};ol.proj.EPSG21781=function(){ol.proj.CH.call(this,{code:"EPSG:21781",extent:ol.proj.EPSG21781.EXTENT})};goog.inherits(ol.proj.EPSG21781,ol.proj.CH);
|
|
ol.proj.EPSG21781.EXTENT=[485869.5728,76443.1884,837076.5648,299941.7864];ol.proj.EPSG21781.add=function(){ol.proj.addEquivalentProjections(ol.proj.EPSG4326.PROJECTIONS);var a=new ol.proj.EPSG21781;ol.proj.addProjection(a);ol.proj.addEquivalentTransforms(ol.proj.EPSG4326.PROJECTIONS,[a],goog.partial(ol.proj.CH.fromEPSG4326Rigorous_,6E5,2E5),goog.partial(ol.proj.CH.toEPSG4326Rigorous_,6E5,2E5))};goog.net={};goog.net.jsloader={};goog.net.jsloader.GLOBAL_VERIFY_OBJS_="closure_verification";goog.net.jsloader.DEFAULT_TIMEOUT=5E3;goog.net.jsloader.scriptsToLoad_=[];goog.net.jsloader.loadMany=function(a,b){if(a.length){var c=goog.net.jsloader.scriptsToLoad_.length;goog.array.extend(goog.net.jsloader.scriptsToLoad_,a);if(!c){a=goog.net.jsloader.scriptsToLoad_;var d=function(){var c=a.shift(),c=goog.net.jsloader.load(c,b);a.length&&c.addBoth(d)};d()}}};
|
|
goog.net.jsloader.load=function(a,b){var c=b||{},d=c.document||document,e=goog.dom.createElement(goog.dom.TagName.SCRIPT),f={script_:e,timeout_:void 0},g=new goog.async.Deferred(goog.net.jsloader.cancel_,f),h=null,k=goog.isDefAndNotNull(c.timeout)?c.timeout:goog.net.jsloader.DEFAULT_TIMEOUT;0<k&&(h=window.setTimeout(function(){goog.net.jsloader.cleanup_(e,!0);g.errback(new goog.net.jsloader.Error(goog.net.jsloader.ErrorCode.TIMEOUT,"Timeout reached for loading script "+a))},k),f.timeout_=h);e.onload=
|
|
e.onreadystatechange=function(){e.readyState&&"loaded"!=e.readyState&&"complete"!=e.readyState||(goog.net.jsloader.cleanup_(e,c.cleanupWhenDone||!1,h),g.callback(null))};e.onerror=function(){goog.net.jsloader.cleanup_(e,!0,h);g.errback(new goog.net.jsloader.Error(goog.net.jsloader.ErrorCode.LOAD_ERROR,"Error while loading script "+a))};goog.dom.setProperties(e,{type:"text/javascript",charset:"UTF-8",src:a});goog.net.jsloader.getScriptParentElement_(d).appendChild(e);return g};
|
|
goog.net.jsloader.loadAndVerify=function(a,b,c){goog.global[goog.net.jsloader.GLOBAL_VERIFY_OBJS_]||(goog.global[goog.net.jsloader.GLOBAL_VERIFY_OBJS_]={});var d=goog.global[goog.net.jsloader.GLOBAL_VERIFY_OBJS_];if(goog.isDef(d[b]))return goog.async.Deferred.fail(new goog.net.jsloader.Error(goog.net.jsloader.ErrorCode.VERIFY_OBJECT_ALREADY_EXISTS,"Verification object "+b+" already defined."));c=goog.net.jsloader.load(a,c);var e=new goog.async.Deferred(goog.bind(c.cancel,c));c.addCallback(function(){var c=
|
|
d[b];goog.isDef(c)?(e.callback(c),delete d[b]):e.errback(new goog.net.jsloader.Error(goog.net.jsloader.ErrorCode.VERIFY_ERROR,"Script "+a+" loaded, but verification object "+b+" was not defined."))});c.addErrback(function(a){goog.isDef(d[b])&&delete d[b];e.errback(a)});return e};goog.net.jsloader.getScriptParentElement_=function(a){var b=a.getElementsByTagName(goog.dom.TagName.HEAD);return!b||goog.array.isEmpty(b)?a.documentElement:b[0]};
|
|
goog.net.jsloader.cancel_=function(){if(this&&this.script_){var a=this.script_;a&&"SCRIPT"==a.tagName&&goog.net.jsloader.cleanup_(a,!0,this.timeout_)}};goog.net.jsloader.cleanup_=function(a,b,c){goog.isDefAndNotNull(c)&&goog.global.clearTimeout(c);a.onload=goog.nullFunction;a.onerror=goog.nullFunction;a.onreadystatechange=goog.nullFunction;b&&window.setTimeout(function(){goog.dom.removeNode(a)},0)};goog.net.jsloader.ErrorCode={LOAD_ERROR:0,TIMEOUT:1,VERIFY_ERROR:2,VERIFY_OBJECT_ALREADY_EXISTS:3};
|
|
goog.net.jsloader.Error=function(a,b){var c="Jsloader error (code #"+a+")";b&&(c+=": "+b);goog.debug.Error.call(this,c);this.code=a};goog.inherits(goog.net.jsloader.Error,goog.debug.Error);goog.net.Jsonp=function(a,b){this.uri_=new goog.Uri(a);this.callbackParamName_=b?b:"callback";this.timeout_=5E3};goog.net.Jsonp.CALLBACKS="_callbacks_";goog.net.Jsonp.scriptCounter_=0;goog.net.Jsonp.prototype.setRequestTimeout=function(a){this.timeout_=a};goog.net.Jsonp.prototype.getRequestTimeout=function(){return this.timeout_};
|
|
goog.net.Jsonp.prototype.send=function(a,b,c,d){a=a||null;d=d||"_"+(goog.net.Jsonp.scriptCounter_++).toString(36)+goog.now().toString(36);goog.global[goog.net.Jsonp.CALLBACKS]||(goog.global[goog.net.Jsonp.CALLBACKS]={});var e=this.uri_.clone();a&&goog.net.Jsonp.addPayloadToUri_(a,e);b&&(b=goog.net.Jsonp.newReplyHandler_(d,b),goog.global[goog.net.Jsonp.CALLBACKS][d]=b,e.setParameterValues(this.callbackParamName_,goog.net.Jsonp.CALLBACKS+"."+d));b=goog.net.jsloader.load(e.toString(),{timeout:this.timeout_,
|
|
cleanupWhenDone:!0});c=goog.net.Jsonp.newErrorHandler_(d,a,c);b.addErrback(c);return{id_:d,deferred_:b}};goog.net.Jsonp.prototype.cancel=function(a){a&&(a.deferred_&&a.deferred_.cancel(),a.id_&&goog.net.Jsonp.cleanup_(a.id_,!1))};goog.net.Jsonp.newErrorHandler_=function(a,b,c){return function(){goog.net.Jsonp.cleanup_(a,!1);c&&c(b)}};goog.net.Jsonp.newReplyHandler_=function(a,b){return function(c){goog.net.Jsonp.cleanup_(a,!0);b.apply(void 0,arguments)}};
|
|
goog.net.Jsonp.cleanup_=function(a,b){goog.global[goog.net.Jsonp.CALLBACKS][a]&&(b?delete goog.global[goog.net.Jsonp.CALLBACKS][a]:goog.global[goog.net.Jsonp.CALLBACKS][a]=goog.nullFunction)};goog.net.Jsonp.addPayloadToUri_=function(a,b){for(var c in a)a.hasOwnProperty&&!a.hasOwnProperty(c)||b.setParameterValues(c,a[c]);return b};ol.source.TileImage=function(a){ol.source.Tile.call(this,{attributions:a.attributions,extent:a.extent,logo:a.logo,opaque:a.opaque,projection:a.projection,tileGrid:a.tileGrid});this.tileUrlFunction=goog.isDef(a.tileUrlFunction)?a.tileUrlFunction:ol.TileUrlFunction.nullTileUrlFunction;this.crossOrigin=goog.isDef(a.crossOrigin)?a.crossOrigin:null;this.tileCache=new ol.TileCache;this.tileLoadFunction=goog.isDef(a.tileLoadFunction)?a.tileLoadFunction:ol.source.TileImage.defaultTileLoadFunction;this.tileClass=
|
|
goog.isDef(a.tileClass)?a.tileClass:ol.ImageTile};goog.inherits(ol.source.TileImage,ol.source.Tile);ol.source.TileImage.defaultTileLoadFunction=function(a,b){a.getImage().src=b};ol.source.TileImage.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()};ol.source.TileImage.prototype.expireCache=function(a){this.tileCache.expireCache(a)};
|
|
ol.source.TileImage.prototype.getTile=function(a,b,c,d,e){var f=this.getKeyZXY(a,b,c);if(this.tileCache.containsKey(f))return this.tileCache.get(f);a=new ol.TileCoord(a,b,c);d=this.tileUrlFunction(a,d,e);d=new this.tileClass(a,goog.isDef(d)?ol.TileState.IDLE:ol.TileState.EMPTY,goog.isDef(d)?d:"",this.crossOrigin,this.tileLoadFunction);this.tileCache.set(f,d);return d};ol.source.TileImage.prototype.setTileUrlFunction=function(a){this.tileCache.clear();this.tileUrlFunction=a;this.dispatchChangeEvent()};
|
|
ol.source.TileImage.prototype.useTile=function(a,b,c){a=this.getKeyZXY(a,b,c);this.tileCache.containsKey(a)&&this.tileCache.get(a)};ol.tilegrid.XYZ=function(a){var b=Array(a.maxZoom+1),c,d=2*ol.proj.EPSG3857.HALF_SIZE/ol.DEFAULT_TILE_SIZE;for(c=0;c<=a.maxZoom;++c)b[c]=d/Math.pow(2,c);ol.tilegrid.TileGrid.call(this,{minZoom:a.minZoom,origin:[-ol.proj.EPSG3857.HALF_SIZE,ol.proj.EPSG3857.HALF_SIZE],resolutions:b,tileSize:ol.DEFAULT_TILE_SIZE})};goog.inherits(ol.tilegrid.XYZ,ol.tilegrid.TileGrid);
|
|
ol.tilegrid.XYZ.prototype.createTileCoordTransform=function(a){a=goog.isDef(a)?a:{};var b=this.minZoom,c=this.maxZoom,d=goog.isDef(a.wrapX)?a.wrapX:!0,e=new ol.TileCoord(0,0,0),f=null;if(goog.isDef(a.extent)){var f=Array(c+1),g;for(g=0;g<=c;++g)f[g]=g<b?null:this.getTileRangeForExtentAndZ(a.extent,g)}return function(a,g,l){g=a.z;if(g<b||c<g)return null;var m=Math.pow(2,g),n=a.x;if(d)n=goog.math.modulo(n,m);else if(0>n||m<=n)return null;a=a.y;return a<-m||-1<a||!goog.isNull(f)&&(e.z=g,e.x=n,e.y=a,
|
|
!f[g].contains(e))?null:ol.TileCoord.createOrUpdate(g,n,-a-1,l)}};ol.tilegrid.XYZ.prototype.getTileCoordChildTileRange=function(a,b){return a.z<this.maxZoom?ol.TileRange.createOrUpdate(2*a.x,2*(a.x+1),2*a.y,2*(a.y+1),b):null};ol.tilegrid.XYZ.prototype.forEachTileCoordParentTileRange=function(a,b,c,d){d=ol.TileRange.createOrUpdate(0,a.x,0,a.y,d);for(a=a.z-1;a>=this.minZoom;--a)if(d.minX=d.maxX>>=1,d.minY=d.maxY>>=1,b.call(c,a,d))return!0;return!1};ol.source.BingMaps=function(a){ol.source.TileImage.call(this,{crossOrigin:"anonymous",opaque:!0,projection:ol.proj.get("EPSG:3857"),state:ol.source.State.LOADING,tileLoadFunction:a.tileLoadFunction});this.culture_=goog.isDef(a.culture)?a.culture:"en-us";var b=new goog.Uri("//dev.virtualearth.net/REST/v1/Imagery/Metadata/"+a.imagerySet);(new goog.net.Jsonp(b,"jsonp")).send({include:"ImageryProviders",key:a.key},goog.bind(this.handleImageryMetadataResponse,this))};goog.inherits(ol.source.BingMaps,ol.source.TileImage);
|
|
ol.source.BingMaps.TOS_ATTRIBUTION=new ol.Attribution({html:'\x3ca class\x3d"ol-attribution-bing-tos" target\x3d"_blank" href\x3d"http://www.microsoft.com/maps/product/terms.html"\x3eTerms of Use\x3c/a\x3e'});
|
|
ol.source.BingMaps.prototype.handleImageryMetadataResponse=function(a){if(200!=a.statusCode||"OK"!=a.statusDescription||"ValidCredentials"!=a.authenticationResultCode||1!=a.resourceSets.length||1!=a.resourceSets[0].resources.length)this.setState(ol.source.State.ERROR);else{var b=a.brandLogoUri,c=a.resourceSets[0].resources[0],d=new ol.tilegrid.XYZ({minZoom:c.zoomMin,maxZoom:c.zoomMax,tileSize:c.imageWidth});this.tileGrid=d;var e=this.culture_;this.tileUrlFunction=ol.TileUrlFunction.withTileCoordTransform(d.createTileCoordTransform(),
|
|
ol.TileUrlFunction.createFromTileUrlFunctions(goog.array.map(c.imageUrlSubdomains,function(a){var b=c.imageUrl.replace("{subdomain}",a).replace("{culture}",e);return function(a,c,d){return goog.isNull(a)?void 0:b.replace("{quadkey}",a.quadKey())}})));if(c.imageryProviders){var f=ol.proj.getTransformFromProjections(ol.proj.get("EPSG:4326"),this.getProjection());a=goog.array.map(c.imageryProviders,function(a){var b=a.attribution,c={};goog.array.forEach(a.coverageAreas,function(a){var b=a.zoomMin,e=
|
|
a.zoomMax;a=a.bbox;a=ol.extent.transform([a[1],a[0],a[3],a[2]],f);var g,h;for(g=b;g<=e;++g)h=g.toString(),b=d.getTileRangeForExtentAndZ(a,g),h in c?c[h].push(b):c[h]=[b]});return new ol.Attribution({html:b,tileRanges:c})});a.push(ol.source.BingMaps.TOS_ATTRIBUTION);this.setAttributions(a)}this.setLogo(b);this.setState(ol.source.State.READY)}};goog.net.EventType={COMPLETE:"complete",SUCCESS:"success",ERROR:"error",ABORT:"abort",READY:"ready",READY_STATE_CHANGE:"readystatechange",TIMEOUT:"timeout",INCREMENTAL_DATA:"incrementaldata",PROGRESS:"progress"};goog.Timer=function(a,b){goog.events.EventTarget.call(this);this.interval_=a||1;this.timerObject_=b||goog.Timer.defaultTimerObject;this.boundTick_=goog.bind(this.tick_,this);this.last_=goog.now()};goog.inherits(goog.Timer,goog.events.EventTarget);goog.Timer.MAX_TIMEOUT_=2147483647;goog.Timer.prototype.enabled=!1;goog.Timer.defaultTimerObject=goog.global;goog.Timer.intervalScale=0.8;goog.Timer.prototype.timer_=null;goog.Timer.prototype.getInterval=function(){return this.interval_};
|
|
goog.Timer.prototype.setInterval=function(a){this.interval_=a;this.timer_&&this.enabled?(this.stop(),this.start()):this.timer_&&this.stop()};
|
|
goog.Timer.prototype.tick_=function(){if(this.enabled){var a=goog.now()-this.last_;0<a&&a<this.interval_*goog.Timer.intervalScale?this.timer_=this.timerObject_.setTimeout(this.boundTick_,this.interval_-a):(this.timer_&&(this.timerObject_.clearTimeout(this.timer_),this.timer_=null),this.dispatchTick(),this.enabled&&(this.timer_=this.timerObject_.setTimeout(this.boundTick_,this.interval_),this.last_=goog.now()))}};goog.Timer.prototype.dispatchTick=function(){this.dispatchEvent(goog.Timer.TICK)};
|
|
goog.Timer.prototype.start=function(){this.enabled=!0;this.timer_||(this.timer_=this.timerObject_.setTimeout(this.boundTick_,this.interval_),this.last_=goog.now())};goog.Timer.prototype.stop=function(){this.enabled=!1;this.timer_&&(this.timerObject_.clearTimeout(this.timer_),this.timer_=null)};goog.Timer.prototype.disposeInternal=function(){goog.Timer.superClass_.disposeInternal.call(this);this.stop();delete this.timerObject_};goog.Timer.TICK="tick";
|
|
goog.Timer.callOnce=function(a,b,c){if(goog.isFunction(a))c&&(a=goog.bind(a,c));else if(a&&"function"==typeof a.handleEvent)a=goog.bind(a.handleEvent,a);else throw Error("Invalid listener argument");return b>goog.Timer.MAX_TIMEOUT_?-1:goog.Timer.defaultTimerObject.setTimeout(a,b||0)};goog.Timer.clear=function(a){goog.Timer.defaultTimerObject.clearTimeout(a)};goog.net.ErrorCode={NO_ERROR:0,ACCESS_DENIED:1,FILE_NOT_FOUND:2,FF_SILENT_ERROR:3,CUSTOM_ERROR:4,EXCEPTION:5,HTTP_ERROR:6,ABORT:7,TIMEOUT:8,OFFLINE:9};
|
|
goog.net.ErrorCode.getDebugMessage=function(a){switch(a){case goog.net.ErrorCode.NO_ERROR:return"No Error";case goog.net.ErrorCode.ACCESS_DENIED:return"Access denied to content document";case goog.net.ErrorCode.FILE_NOT_FOUND:return"File not found";case goog.net.ErrorCode.FF_SILENT_ERROR:return"Firefox silently errored";case goog.net.ErrorCode.CUSTOM_ERROR:return"Application custom error";case goog.net.ErrorCode.EXCEPTION:return"An exception occurred";case goog.net.ErrorCode.HTTP_ERROR:return"Http response at 400 or 500 level";
|
|
case goog.net.ErrorCode.ABORT:return"Request was aborted";case goog.net.ErrorCode.TIMEOUT:return"Request timed out";case goog.net.ErrorCode.OFFLINE:return"The resource is not available offline";default:return"Unrecognized error code"}};goog.net.HttpStatus={CONTINUE:100,SWITCHING_PROTOCOLS:101,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,
|
|
PRECONDITION_FAILED:412,REQUEST_ENTITY_TOO_LARGE:413,REQUEST_URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,REQUEST_RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,QUIRK_IE_NO_CONTENT:1223};
|
|
goog.net.HttpStatus.isSuccess=function(a){switch(a){case goog.net.HttpStatus.OK:case goog.net.HttpStatus.CREATED:case goog.net.HttpStatus.ACCEPTED:case goog.net.HttpStatus.NO_CONTENT:case goog.net.HttpStatus.PARTIAL_CONTENT:case goog.net.HttpStatus.NOT_MODIFIED:case goog.net.HttpStatus.QUIRK_IE_NO_CONTENT:return!0;default:return!1}};goog.net.XmlHttpFactory=function(){};goog.net.XmlHttpFactory.prototype.cachedOptions_=null;goog.net.XmlHttpFactory.prototype.getOptions=function(){return this.cachedOptions_||(this.cachedOptions_=this.internalGetOptions())};goog.net.WrapperXmlHttpFactory=function(a,b){goog.net.XmlHttpFactory.call(this);this.xhrFactory_=a;this.optionsFactory_=b};goog.inherits(goog.net.WrapperXmlHttpFactory,goog.net.XmlHttpFactory);goog.net.WrapperXmlHttpFactory.prototype.createInstance=function(){return this.xhrFactory_()};goog.net.WrapperXmlHttpFactory.prototype.getOptions=function(){return this.optionsFactory_()};goog.net.XmlHttp=function(){return goog.net.XmlHttp.factory_.createInstance()};goog.net.XmlHttp.ASSUME_NATIVE_XHR=!1;goog.net.XmlHttp.getOptions=function(){return goog.net.XmlHttp.factory_.getOptions()};goog.net.XmlHttp.OptionType={USE_NULL_FUNCTION:0,LOCAL_REQUEST_ERROR:1};goog.net.XmlHttp.ReadyState={UNINITIALIZED:0,LOADING:1,LOADED:2,INTERACTIVE:3,COMPLETE:4};goog.net.XmlHttp.setFactory=function(a,b){goog.net.XmlHttp.setGlobalFactory(new goog.net.WrapperXmlHttpFactory(a,b))};
|
|
goog.net.XmlHttp.setGlobalFactory=function(a){goog.net.XmlHttp.factory_=a};goog.net.DefaultXmlHttpFactory=function(){goog.net.XmlHttpFactory.call(this)};goog.inherits(goog.net.DefaultXmlHttpFactory,goog.net.XmlHttpFactory);goog.net.DefaultXmlHttpFactory.prototype.createInstance=function(){var a=this.getProgId_();return a?new ActiveXObject(a):new XMLHttpRequest};
|
|
goog.net.DefaultXmlHttpFactory.prototype.internalGetOptions=function(){var a={};this.getProgId_()&&(a[goog.net.XmlHttp.OptionType.USE_NULL_FUNCTION]=!0,a[goog.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR]=!0);return a};
|
|
goog.net.DefaultXmlHttpFactory.prototype.getProgId_=function(){if(goog.net.XmlHttp.ASSUME_NATIVE_XHR)return"";if(!this.ieProgId_&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var a=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],b=0;b<a.length;b++){var c=a[b];try{return new ActiveXObject(c),this.ieProgId_=c}catch(d){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return this.ieProgId_};
|
|
goog.net.XmlHttp.setGlobalFactory(new goog.net.DefaultXmlHttpFactory);goog.net.XhrIo=function(a){goog.events.EventTarget.call(this);this.headers=new goog.structs.Map;this.xmlHttpFactory_=a||null;this.active_=!1;this.xhrOptions_=this.xhr_=null;this.lastMethod_=this.lastUri_="";this.lastErrorCode_=goog.net.ErrorCode.NO_ERROR;this.lastError_="";this.inAbort_=this.inOpen_=this.inSend_=this.errorDispatched_=!1;this.timeoutInterval_=0;this.timeoutId_=null;this.responseType_=goog.net.XhrIo.ResponseType.DEFAULT;this.useXhr2Timeout_=this.withCredentials_=!1};
|
|
goog.inherits(goog.net.XhrIo,goog.events.EventTarget);goog.net.XhrIo.ResponseType={DEFAULT:"",TEXT:"text",DOCUMENT:"document",BLOB:"blob",ARRAY_BUFFER:"arraybuffer"};goog.net.XhrIo.CONTENT_TYPE_HEADER="Content-Type";goog.net.XhrIo.HTTP_SCHEME_PATTERN=/^https?$/i;goog.net.XhrIo.METHODS_WITH_FORM_DATA=["POST","PUT"];goog.net.XhrIo.FORM_CONTENT_TYPE="application/x-www-form-urlencoded;charset\x3dutf-8";goog.net.XhrIo.XHR2_TIMEOUT_="timeout";goog.net.XhrIo.XHR2_ON_TIMEOUT_="ontimeout";
|
|
goog.net.XhrIo.sendInstances_=[];goog.net.XhrIo.send=function(a,b,c,d,e,f,g){var h=new goog.net.XhrIo;goog.net.XhrIo.sendInstances_.push(h);b&&h.listen(goog.net.EventType.COMPLETE,b);h.listenOnce(goog.net.EventType.READY,h.cleanupSend_);f&&h.setTimeoutInterval(f);g&&h.setWithCredentials(g);h.send(a,c,d,e)};goog.net.XhrIo.cleanup=function(){for(var a=goog.net.XhrIo.sendInstances_;a.length;)a.pop().dispose()};
|
|
goog.net.XhrIo.protectEntryPoints=function(a){goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_=a.protectEntryPoint(goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_)};goog.net.XhrIo.prototype.cleanupSend_=function(){this.dispose();goog.array.remove(goog.net.XhrIo.sendInstances_,this)};goog.net.XhrIo.prototype.getTimeoutInterval=function(){return this.timeoutInterval_};goog.net.XhrIo.prototype.setTimeoutInterval=function(a){this.timeoutInterval_=Math.max(0,a)};
|
|
goog.net.XhrIo.prototype.setResponseType=function(a){this.responseType_=a};goog.net.XhrIo.prototype.getResponseType=function(){return this.responseType_};goog.net.XhrIo.prototype.setWithCredentials=function(a){this.withCredentials_=a};goog.net.XhrIo.prototype.getWithCredentials=function(){return this.withCredentials_};
|
|
goog.net.XhrIo.prototype.send=function(a,b,c,d){if(this.xhr_)throw Error("[goog.net.XhrIo] Object is active with another request\x3d"+this.lastUri_+"; newUri\x3d"+a);b=b?b.toUpperCase():"GET";this.lastUri_=a;this.lastError_="";this.lastErrorCode_=goog.net.ErrorCode.NO_ERROR;this.lastMethod_=b;this.errorDispatched_=!1;this.active_=!0;this.xhr_=this.createXhr();this.xhrOptions_=this.xmlHttpFactory_?this.xmlHttpFactory_.getOptions():goog.net.XmlHttp.getOptions();this.xhr_.onreadystatechange=goog.bind(this.onReadyStateChange_,
|
|
this);try{this.inOpen_=!0,this.xhr_.open(b,a,!0),this.inOpen_=!1}catch(e){this.error_(goog.net.ErrorCode.EXCEPTION,e);return}a=c||"";var f=this.headers.clone();d&&goog.structs.forEach(d,function(a,b){f.set(b,a)});d=goog.array.find(f.getKeys(),goog.net.XhrIo.isContentTypeHeader_);c=goog.global.FormData&&a instanceof goog.global.FormData;!goog.array.contains(goog.net.XhrIo.METHODS_WITH_FORM_DATA,b)||(d||c)||f.set(goog.net.XhrIo.CONTENT_TYPE_HEADER,goog.net.XhrIo.FORM_CONTENT_TYPE);goog.structs.forEach(f,
|
|
function(a,b){this.xhr_.setRequestHeader(b,a)},this);this.responseType_&&(this.xhr_.responseType=this.responseType_);goog.object.containsKey(this.xhr_,"withCredentials")&&(this.xhr_.withCredentials=this.withCredentials_);try{this.cleanUpTimeoutTimer_(),0<this.timeoutInterval_&&((this.useXhr2Timeout_=goog.net.XhrIo.shouldUseXhr2Timeout_(this.xhr_))?(this.xhr_[goog.net.XhrIo.XHR2_TIMEOUT_]=this.timeoutInterval_,this.xhr_[goog.net.XhrIo.XHR2_ON_TIMEOUT_]=goog.bind(this.timeout_,this)):this.timeoutId_=
|
|
goog.Timer.callOnce(this.timeout_,this.timeoutInterval_,this)),this.inSend_=!0,this.xhr_.send(a),this.inSend_=!1}catch(g){this.error_(goog.net.ErrorCode.EXCEPTION,g)}};goog.net.XhrIo.shouldUseXhr2Timeout_=function(a){return goog.userAgent.IE&&goog.userAgent.isVersionOrHigher(9)&&goog.isNumber(a[goog.net.XhrIo.XHR2_TIMEOUT_])&&goog.isDef(a[goog.net.XhrIo.XHR2_ON_TIMEOUT_])};goog.net.XhrIo.isContentTypeHeader_=function(a){return goog.string.caseInsensitiveEquals(goog.net.XhrIo.CONTENT_TYPE_HEADER,a)};
|
|
goog.net.XhrIo.prototype.createXhr=function(){return this.xmlHttpFactory_?this.xmlHttpFactory_.createInstance():goog.net.XmlHttp()};goog.net.XhrIo.prototype.timeout_=function(){"undefined"!=typeof goog&&this.xhr_&&(this.lastError_="Timed out after "+this.timeoutInterval_+"ms, aborting",this.lastErrorCode_=goog.net.ErrorCode.TIMEOUT,this.dispatchEvent(goog.net.EventType.TIMEOUT),this.abort(goog.net.ErrorCode.TIMEOUT))};
|
|
goog.net.XhrIo.prototype.error_=function(a,b){this.active_=!1;this.xhr_&&(this.inAbort_=!0,this.xhr_.abort(),this.inAbort_=!1);this.lastError_=b;this.lastErrorCode_=a;this.dispatchErrors_();this.cleanUpXhr_()};goog.net.XhrIo.prototype.dispatchErrors_=function(){this.errorDispatched_||(this.errorDispatched_=!0,this.dispatchEvent(goog.net.EventType.COMPLETE),this.dispatchEvent(goog.net.EventType.ERROR))};
|
|
goog.net.XhrIo.prototype.abort=function(a){this.xhr_&&this.active_&&(this.active_=!1,this.inAbort_=!0,this.xhr_.abort(),this.inAbort_=!1,this.lastErrorCode_=a||goog.net.ErrorCode.ABORT,this.dispatchEvent(goog.net.EventType.COMPLETE),this.dispatchEvent(goog.net.EventType.ABORT),this.cleanUpXhr_())};goog.net.XhrIo.prototype.disposeInternal=function(){this.xhr_&&(this.active_&&(this.active_=!1,this.inAbort_=!0,this.xhr_.abort(),this.inAbort_=!1),this.cleanUpXhr_(!0));goog.net.XhrIo.superClass_.disposeInternal.call(this)};
|
|
goog.net.XhrIo.prototype.onReadyStateChange_=function(){if(!this.isDisposed())if(this.inOpen_||this.inSend_||this.inAbort_)this.onReadyStateChangeHelper_();else this.onReadyStateChangeEntryPoint_()};goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_=function(){this.onReadyStateChangeHelper_()};
|
|
goog.net.XhrIo.prototype.onReadyStateChangeHelper_=function(){if(this.active_&&"undefined"!=typeof goog&&(!this.xhrOptions_[goog.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR]||this.getReadyState()!=goog.net.XmlHttp.ReadyState.COMPLETE||2!=this.getStatus()))if(this.inSend_&&this.getReadyState()==goog.net.XmlHttp.ReadyState.COMPLETE)goog.Timer.callOnce(this.onReadyStateChange_,0,this);else if(this.dispatchEvent(goog.net.EventType.READY_STATE_CHANGE),this.isComplete()){this.active_=!1;try{this.isSuccess()?
|
|
(this.dispatchEvent(goog.net.EventType.COMPLETE),this.dispatchEvent(goog.net.EventType.SUCCESS)):(this.lastErrorCode_=goog.net.ErrorCode.HTTP_ERROR,this.lastError_=this.getStatusText()+" ["+this.getStatus()+"]",this.dispatchErrors_())}finally{this.cleanUpXhr_()}}};
|
|
goog.net.XhrIo.prototype.cleanUpXhr_=function(a){if(this.xhr_){this.cleanUpTimeoutTimer_();var b=this.xhr_,c=this.xhrOptions_[goog.net.XmlHttp.OptionType.USE_NULL_FUNCTION]?goog.nullFunction:null;this.xhrOptions_=this.xhr_=null;a||this.dispatchEvent(goog.net.EventType.READY);try{b.onreadystatechange=c}catch(d){}}};
|
|
goog.net.XhrIo.prototype.cleanUpTimeoutTimer_=function(){this.xhr_&&this.useXhr2Timeout_&&(this.xhr_[goog.net.XhrIo.XHR2_ON_TIMEOUT_]=null);goog.isNumber(this.timeoutId_)&&(goog.Timer.clear(this.timeoutId_),this.timeoutId_=null)};goog.net.XhrIo.prototype.isActive=function(){return!!this.xhr_};goog.net.XhrIo.prototype.isComplete=function(){return this.getReadyState()==goog.net.XmlHttp.ReadyState.COMPLETE};
|
|
goog.net.XhrIo.prototype.isSuccess=function(){var a=this.getStatus();return goog.net.HttpStatus.isSuccess(a)||0===a&&!this.isLastUriEffectiveSchemeHttp_()};goog.net.XhrIo.prototype.isLastUriEffectiveSchemeHttp_=function(){var a=goog.uri.utils.getEffectiveScheme(String(this.lastUri_));return goog.net.XhrIo.HTTP_SCHEME_PATTERN.test(a)};goog.net.XhrIo.prototype.getReadyState=function(){return this.xhr_?this.xhr_.readyState:goog.net.XmlHttp.ReadyState.UNINITIALIZED};
|
|
goog.net.XhrIo.prototype.getStatus=function(){try{return this.getReadyState()>goog.net.XmlHttp.ReadyState.LOADED?this.xhr_.status:-1}catch(a){return-1}};goog.net.XhrIo.prototype.getStatusText=function(){try{return this.getReadyState()>goog.net.XmlHttp.ReadyState.LOADED?this.xhr_.statusText:""}catch(a){return""}};goog.net.XhrIo.prototype.getLastUri=function(){return String(this.lastUri_)};goog.net.XhrIo.prototype.getResponseText=function(){try{return this.xhr_?this.xhr_.responseText:""}catch(a){return""}};
|
|
goog.net.XhrIo.prototype.getResponseBody=function(){try{if(this.xhr_&&"responseBody"in this.xhr_)return this.xhr_.responseBody}catch(a){}return null};goog.net.XhrIo.prototype.getResponseXml=function(){try{return this.xhr_?this.xhr_.responseXML:null}catch(a){return null}};goog.net.XhrIo.prototype.getResponseJson=function(a){if(this.xhr_){var b=this.xhr_.responseText;a&&0==b.indexOf(a)&&(b=b.substring(a.length));return goog.json.parse(b)}};
|
|
goog.net.XhrIo.prototype.getResponse=function(){try{if(!this.xhr_)return null;if("response"in this.xhr_)return this.xhr_.response;switch(this.responseType_){case goog.net.XhrIo.ResponseType.DEFAULT:case goog.net.XhrIo.ResponseType.TEXT:return this.xhr_.responseText;case goog.net.XhrIo.ResponseType.ARRAY_BUFFER:if("mozResponseArrayBuffer"in this.xhr_)return this.xhr_.mozResponseArrayBuffer}return null}catch(a){return null}};
|
|
goog.net.XhrIo.prototype.getResponseHeader=function(a){return this.xhr_&&this.isComplete()?this.xhr_.getResponseHeader(a):void 0};goog.net.XhrIo.prototype.getAllResponseHeaders=function(){return this.xhr_&&this.isComplete()?this.xhr_.getAllResponseHeaders():""};goog.net.XhrIo.prototype.getLastErrorCode=function(){return this.lastErrorCode_};goog.net.XhrIo.prototype.getLastError=function(){return goog.isString(this.lastError_)?this.lastError_:String(this.lastError_)};
|
|
goog.net.XhrIo.prototype.formatMsg_=function(a){return a+" ["+this.lastMethod_+" "+this.lastUri_+" "+this.getStatus()+"]"};ol.source.VectorFile=function(a){var b=goog.isDef(a)?a:{};ol.source.Vector.call(this,{attributions:b.attributions,extent:b.extent,logo:b.logo,projection:b.projection});this.format=b.format;goog.isDef(b.doc)&&this.readFeatures_(b.doc);goog.isDef(b.node)&&this.readFeatures_(b.node);goog.isDef(b.object)&&this.readFeatures_(b.object);goog.isDef(b.text)&&this.readFeatures_(b.text);goog.isDef(b.arrayBuffer)&&this.readFeatures_(b.arrayBuffer);if(goog.isDef(b.url)||goog.isDef(b.urls)){this.setState(ol.source.State.LOADING);
|
|
a=this.format.getType()==ol.format.FormatType.BINARY&&ol.BrowserFeature.HAS_ARRAY_BUFFER?goog.net.XhrIo.ResponseType.ARRAY_BUFFER:goog.net.XhrIo.ResponseType.TEXT;var c;goog.isDef(b.url)&&(c=new goog.net.XhrIo,c.setResponseType(a),goog.events.listen(c,goog.net.EventType.COMPLETE,goog.bind(this.handleXhrIo_,this)),c.send(b.url));if(goog.isDef(b.urls)){var b=b.urls,d,e;d=0;for(e=b.length;d<e;++d)c=new goog.net.XhrIo,c.setResponseType(a),goog.events.listen(c,goog.net.EventType.COMPLETE,goog.bind(this.handleXhrIo_,
|
|
this)),c.send(b[d])}}};goog.inherits(ol.source.VectorFile,ol.source.Vector);
|
|
ol.source.VectorFile.prototype.handleXhrIo_=function(a){a=a.target;if(a.isSuccess()){var b=this.format.getType(),c;b==ol.format.FormatType.BINARY&&ol.BrowserFeature.HAS_ARRAY_BUFFER?c=a.getResponse():b==ol.format.FormatType.JSON?c=a.getResponseJson():b==ol.format.FormatType.TEXT?c=a.getResponseText():b==ol.format.FormatType.XML&&(goog.userAgent.IE||(c=a.getResponseXml()),goog.isDefAndNotNull(c)||(c=ol.xml.load(a.getResponseText())));goog.dispose(a);goog.isDefAndNotNull(c)?this.readFeatures_(c):this.setState(ol.source.State.ERROR)}else this.setState(ol.source.State.ERROR)};
|
|
ol.source.VectorFile.prototype.readFeatures_=function(a){var b=this.format,c=b.readFeatures(a);a=b.readProjection(a);b=this.getProjection();if(!goog.isNull(b)&&!ol.proj.equivalent(a,b)){a=ol.proj.getTransform(a,b);var d,b=0;for(d=c.length;b<d;++b){var e=c[b].getGeometry();goog.isNull(e)||e.transform(a)}}this.addFeaturesInternal(c);this.setState(ol.source.State.READY)};ol.source.GPX=function(a){a=goog.isDef(a)?a:{};ol.source.VectorFile.call(this,{attributions:a.attributions,doc:a.doc,extent:a.extent,format:new ol.format.GPX,logo:a.logo,node:a.node,projection:a.projection,text:a.text,url:a.url,urls:a.urls})};goog.inherits(ol.source.GPX,ol.source.VectorFile);ol.source.GeoJSON=function(a){a=goog.isDef(a)?a:{};ol.source.VectorFile.call(this,{attributions:a.attributions,extent:a.extent,format:new ol.format.GeoJSON({defaultProjection:a.defaultProjection}),logo:a.logo,object:a.object,projection:a.projection,text:a.text,url:a.url,urls:a.urls})};goog.inherits(ol.source.GeoJSON,ol.source.VectorFile);ol.source.IGC=function(a){a=goog.isDef(a)?a:{};ol.source.VectorFile.call(this,{format:new ol.format.IGC({altitudeMode:a.altitudeMode}),projection:a.projection,text:a.text,url:a.url,urls:a.urls})};goog.inherits(ol.source.IGC,ol.source.VectorFile);ol.source.ImageCanvas=function(a){ol.source.Image.call(this,{attributions:a.attributions,extent:a.extent,logo:a.logo,projection:a.projection,resolutions:a.resolutions,state:a.state});this.canvasFunction_=a.canvasFunction;this.canvas_=null;this.renderedRevision_=0;this.ratio_=goog.isDef(a.ratio)?a.ratio:1.5};goog.inherits(ol.source.ImageCanvas,ol.source.Image);
|
|
ol.source.ImageCanvas.prototype.getImage=function(a,b,c,d){b=this.findNearestResolution(b);var e=this.canvas_;if(!goog.isNull(e)&&this.renderedRevision_==this.getRevision()&&e.getResolution()==b&&e.getPixelRatio()==c&&ol.extent.containsExtent(e.getExtent(),a))return e;a=a.slice();ol.extent.scaleFromCenter(a,this.ratio_);d=this.canvasFunction_(a,b,c,[(a[2]-a[0])/b*c,(a[3]-a[1])/b*c],d);goog.isNull(d)||(e=new ol.ImageCanvas(a,b,c,this.getAttributions(),d));this.canvas_=e;this.renderedRevision_=this.getRevision();
|
|
return e};ol.source.ImageStatic=function(a){var b=goog.isDef(a.attributions)?a.attributions:null,c=goog.isDef(a.crossOrigin)?a.crossOrigin:null,d=a.imageExtent,e=(d[3]-d[1])/a.imageSize[1],f=a.url,g=ol.proj.get(a.projection);ol.source.Image.call(this,{attributions:b,extent:a.extent,logo:a.logo,projection:g,resolutions:[e]});this.image_=new ol.Image(d,e,1,b,f,c)};goog.inherits(ol.source.ImageStatic,ol.source.Image);
|
|
ol.source.ImageStatic.prototype.getImage=function(a,b,c,d){return ol.extent.intersects(a,this.image_.getExtent())?this.image_:null};ol.source.ImageVector=function(a){this.source_=a.source;this.styleFunction_=goog.isDef(a.style)?ol.feature.createStyleFunction(a.style):ol.feature.defaultStyleFunction;this.transform_=goog.vec.Mat4.createNumber();this.canvasElement_=goog.dom.createElement(goog.dom.TagName.CANVAS);this.canvasContext_=this.canvasElement_.getContext("2d");this.canvasSize_=[0,0];this.replayGroup_=null;ol.source.ImageCanvas.call(this,{attributions:a.attributions,canvasFunction:goog.bind(this.canvasFunctionInternal_,this),
|
|
extent:a.extent,logo:a.logo,projection:a.projection,ratio:a.ratio,resolutions:a.resolutions,state:this.source_.getState()});goog.events.listen(this.source_,goog.events.EventType.CHANGE,this.handleSourceChange_,void 0,this)};goog.inherits(ol.source.ImageVector,ol.source.ImageCanvas);
|
|
ol.source.ImageVector.prototype.canvasFunctionInternal_=function(a,b,c,d,e){var f=new ol.render.canvas.ReplayGroup(b/(2*c),a),g=!1;this.source_.forEachFeatureInExtent(a,function(a){g=g||this.renderFeature_(a,b,c,f)},this);f.finish();if(g)return null;this.canvasSize_[0]!=d[0]||this.canvasSize_[1]!=d[1]?(this.canvasElement_.width=d[0],this.canvasElement_.height=d[1],this.canvasSize_[0]=d[0],this.canvasSize_[1]=d[1]):this.canvasContext_.clearRect(0,0,d[0],d[1]);d=this.getTransform_(ol.extent.getCenter(a),
|
|
b,c,d);f.replay(this.canvasContext_,a,c,d,0,goog.functions.TRUE);this.replayGroup_=f;return this.canvasElement_};ol.source.ImageVector.prototype.forEachFeatureAtPixel=function(a,b,c,d,e){return goog.isNull(this.replayGroup_)?void 0:this.replayGroup_.forEachGeometryAtPixel(a,b,0,d,goog.functions.TRUE,function(a,b){return e(b)})};ol.source.ImageVector.prototype.getTransform_=function(a,b,c,d){return ol.vec.Mat4.makeTransform2D(this.transform_,d[0]/2,d[1]/2,c/b,-c/b,0,-a[0],-a[1])};
|
|
ol.source.ImageVector.prototype.handleImageChange_=function(a){this.dispatchChangeEvent()};ol.source.ImageVector.prototype.handleSourceChange_=function(){this.setState(this.source_.getState())};ol.source.ImageVector.prototype.renderFeature_=function(a,b,c,d){var e=this.styleFunction_(a,b);if(!goog.isDefAndNotNull(e))return!1;b=b*b/(4*c*c);var f,g=!1;c=0;for(f=e.length;c<f;++c)g=ol.renderer.vector.renderFeature(d,a,e[c],b,a,this.handleImageChange_,this)||g;return g};ol.source.wms={};ol.source.wms.DEFAULT_VERSION="1.3.0";ol.source.wms.ServerType={CARMENTA_SERVER:"carmentaserver",GEOSERVER:"geoserver",MAPSERVER:"mapserver",QGIS:"qgis"};ol.source.ImageWMS=function(a){a=goog.isDef(a)?a:{};ol.source.Image.call(this,{attributions:a.attributions,extent:a.extent,logo:a.logo,projection:a.projection,resolutions:a.resolutions});this.crossOrigin_=goog.isDef(a.crossOrigin)?a.crossOrigin:null;this.url_=a.url;this.params_=a.params;this.v13_=!0;this.updateV13_();this.serverType_=a.serverType;this.hidpi_=goog.isDef(a.hidpi)?a.hidpi:!0;this.image_=null;this.imageSize_=[0,0];this.renderedProjection_=null;this.renderedResolution_=NaN;this.renderedRevision_=
|
|
0;this.ratio_=goog.isDef(a.ratio)?a.ratio:1.5};goog.inherits(ol.source.ImageWMS,ol.source.Image);
|
|
ol.source.ImageWMS.prototype.getGetFeatureInfoUrl=function(a,b,c,d){if(goog.isDef(this.url_)&&!goog.isNull(this.image_)&&b==this.renderedResolution_&&ol.proj.equivalent(c,this.renderedProjection_)){var e=this.image_.getExtent(),f=this.image_.getPixelRatio(),g={SERVICE:"WMS",VERSION:ol.source.wms.DEFAULT_VERSION,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:goog.object.get(this.params_,"LAYERS")};goog.object.extend(g,this.params_,d);b/=f;d=Math.floor((e[3]-a[1])/b);goog.object.set(g,
|
|
this.v13_?"I":"X",Math.floor((a[0]-e[0])/b));goog.object.set(g,this.v13_?"J":"Y",d);return this.getRequestUrl_(e,this.imageSize_,f,c,g)}};ol.source.ImageWMS.prototype.getParams=function(){return this.params_};
|
|
ol.source.ImageWMS.prototype.getImage=function(a,b,c,d){if(!goog.isDef(this.url_))return null;b=this.findNearestResolution(b);1==c||this.hidpi_&&goog.isDef(this.serverType_)||(c=1);var e=this.image_;if(!goog.isNull(e)&&this.renderedRevision_==this.getRevision()&&e.getResolution()==b&&e.getPixelRatio()==c&&ol.extent.containsExtent(e.getExtent(),a))return e;e={SERVICE:"WMS",VERSION:ol.source.wms.DEFAULT_VERSION,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};goog.object.extend(e,this.params_);a=
|
|
a.slice();var f=(a[0]+a[2])/2,g=(a[1]+a[3])/2;if(1!=this.ratio_){var h=this.ratio_*(a[2]-a[0])/2,k=this.ratio_*(a[3]-a[1])/2;a[0]=f-h;a[1]=g-k;a[2]=f+h;a[3]=g+k}var h=b/c,k=Math.ceil((a[2]-a[0])/h),l=Math.ceil((a[3]-a[1])/h);a[0]=f-h*k/2;a[2]=f+h*k/2;a[1]=g-h*l/2;a[3]=g+h*l/2;this.imageSize_[0]=k;this.imageSize_[1]=l;e=this.getRequestUrl_(a,this.imageSize_,c,d,e);this.image_=new ol.Image(a,b,c,this.getAttributions(),e,this.crossOrigin_);this.renderedProjection_=d;this.renderedResolution_=b;this.renderedRevision_=
|
|
this.getRevision();return this.image_};
|
|
ol.source.ImageWMS.prototype.getRequestUrl_=function(a,b,c,d,e){e[this.v13_?"CRS":"SRS"]=d.getCode();"STYLES"in this.params_||goog.object.set(e,"STYLES",new String(""));if(1!=c)switch(this.serverType_){case ol.source.wms.ServerType.GEOSERVER:goog.object.set(e,"FORMAT_OPTIONS","dpi:"+(90*c+0.5|0));break;case ol.source.wms.ServerType.MAPSERVER:goog.object.set(e,"MAP_RESOLUTION",90*c);break;case ol.source.wms.ServerType.CARMENTA_SERVER:case ol.source.wms.ServerType.QGIS:goog.object.set(e,"DPI",90*c)}goog.object.set(e,
|
|
"WIDTH",b[0]);goog.object.set(e,"HEIGHT",b[1]);b=d.getAxisOrientation();a=this.v13_&&"ne"==b.substr(0,2)?[a[1],a[0],a[3],a[2]]:a;goog.object.set(e,"BBOX",a.join(","));return goog.uri.utils.appendParamsFromMap(this.url_,e)};ol.source.ImageWMS.prototype.setUrl=function(a){a!=this.url_&&(this.url_=a,this.image_=null,this.dispatchChangeEvent())};ol.source.ImageWMS.prototype.updateParams=function(a){goog.object.extend(this.params_,a);this.updateV13_();this.image_=null;this.dispatchChangeEvent()};
|
|
ol.source.ImageWMS.prototype.updateV13_=function(){var a=goog.object.get(this.params_,"VERSION",ol.source.wms.DEFAULT_VERSION);this.v13_=0<=goog.string.compareVersions(a,"1.3")};ol.source.KML=function(a){a=goog.isDef(a)?a:{};ol.source.VectorFile.call(this,{attributions:a.attributions,doc:a.doc,extent:a.extent,format:new ol.format.KML({defaultStyle:a.defaultStyle}),logo:a.logo,node:a.node,projection:a.projection,text:a.text,url:a.url,urls:a.urls})};goog.inherits(ol.source.KML,ol.source.VectorFile);ol.source.MapGuide=function(a){ol.source.Image.call(this,{extent:a.extent,projection:a.projection,resolutions:a.resolutions});this.crossOrigin_=goog.isDef(a.crossOrigin)?a.crossOrigin:null;this.displayDpi_=goog.isDef(a.displayDpi)?a.displayDpi:96;var b;goog.isDef(a.url)?(b=goog.isDef(a.params)?a.params:{},b=ol.ImageUrlFunction.createFromParamsFunction(a.url,b,goog.bind(this.getUrl,this))):b=ol.ImageUrlFunction.nullImageUrlFunction;this.imageUrlFunction_=b;this.hidpi_=goog.isDef(a.hidpi)?a.hidpi:!0;
|
|
this.metersPerUnit_=goog.isDef(a.metersPerUnit)?a.metersPerUnit:1;this.ratio_=goog.isDef(a.ratio)?a.ratio:1;this.useOverlay_=goog.isDef(a.useOverlay)?a.useOverlay:!1;this.image_=null};goog.inherits(ol.source.MapGuide,ol.source.Image);
|
|
ol.source.MapGuide.prototype.getImage=function(a,b,c,d){b=this.findNearestResolution(b);c=this.hidpi_?c:1;var e=this.image_;if(!goog.isNull(e)&&e.getResolution()==b&&e.getPixelRatio()==c&&ol.extent.containsExtent(e.getExtent(),a))return e;1!=this.ratio_&&(a=a.slice(),ol.extent.scaleFromCenter(a,this.ratio_));d=this.imageUrlFunction_(a,[(a[2]-a[0])/b*c,(a[3]-a[1])/b*c],d);return this.image_=e=goog.isDef(d)?new ol.Image(a,b,c,this.getAttributions(),d,this.crossOrigin_):null};
|
|
ol.source.MapGuide.getScale=function(a,b,c,d){var e=ol.extent.getWidth(a);a=ol.extent.getHeight(a);var f=b[0];b=b[1];d=0.0254/d;return b*e>f*a?e*c/(f*d):a*c/(b*d)};
|
|
ol.source.MapGuide.prototype.getUrl=function(a,b,c,d,e){e=ol.source.MapGuide.getScale(c,d,this.metersPerUnit_,this.displayDpi_);c=ol.extent.getCenter(c);d={OPERATION:this.useOverlay_?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol.source.MapGuide source",CLIP:"1",SETDISPLAYDPI:this.displayDpi_,SETDISPLAYWIDTH:Math.round(d[0]),SETDISPLAYHEIGHT:Math.round(d[1]),SETVIEWSCALE:e,SETVIEWCENTERX:c[0],SETVIEWCENTERY:c[1]};goog.object.extend(d,b);return goog.uri.utils.appendParamsFromMap(a,
|
|
d)};ol.source.XYZ=function(a){var b=a.projection||ol.proj.get("EPSG:3857"),c=goog.isDef(a.maxZoom)?a.maxZoom:18,c=new ol.tilegrid.XYZ({maxZoom:c});ol.source.TileImage.call(this,{attributions:a.attributions,crossOrigin:a.crossOrigin,extent:a.extent,logo:a.logo,projection:b,tileGrid:c,tileLoadFunction:a.tileLoadFunction,tileUrlFunction:ol.TileUrlFunction.nullTileUrlFunction});this.tileCoordTransform_=c.createTileCoordTransform({extent:a.extent});goog.isDef(a.tileUrlFunction)?this.setTileUrlFunction(a.tileUrlFunction):
|
|
goog.isDef(a.urls)?this.setUrls(a.urls):goog.isDef(a.url)&&this.setUrl(a.url)};goog.inherits(ol.source.XYZ,ol.source.TileImage);ol.source.XYZ.prototype.setTileUrlFunction=function(a){ol.source.XYZ.superClass_.setTileUrlFunction.call(this,ol.TileUrlFunction.withTileCoordTransform(this.tileCoordTransform_,a))};ol.source.XYZ.prototype.setUrl=function(a){this.setTileUrlFunction(ol.TileUrlFunction.createFromTemplates(ol.TileUrlFunction.expandUrl(a)))};ol.source.XYZ.prototype.setUrls=function(a){this.setTileUrlFunction(ol.TileUrlFunction.createFromTemplates(a))};ol.source.OSM=function(a){a=goog.isDef(a)?a:{};var b;b=goog.isDef(a.attributions)?a.attributions:ol.source.OSM.ATTRIBUTIONS;var c=goog.isDef(a.crossOrigin)?a.crossOrigin:"anonymous",d=goog.isDef(a.url)?a.url:"//{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";ol.source.XYZ.call(this,{attributions:b,crossOrigin:c,opaque:!0,maxZoom:a.maxZoom,tileLoadFunction:a.tileLoadFunction,url:d})};goog.inherits(ol.source.OSM,ol.source.XYZ);ol.source.OSM.DATA_ATTRIBUTION=new ol.Attribution({html:'Data \x26copy; \x3ca href\x3d"http://www.openstreetmap.org/"\x3eOpenStreetMap\x3c/a\x3e contributors, \x3ca href\x3d"http://www.openstreetmap.org/copyright"\x3eODbL\x3c/a\x3e'});
|
|
ol.source.OSM.TILE_ATTRIBUTION=new ol.Attribution({html:'Tiles \x26copy; \x3ca href\x3d"http://www.openstreetmap.org/"\x3eOpenStreetMap\x3c/a\x3e contributors, \x3ca href\x3d"http://creativecommons.org/licenses/by-sa/2.0/"\x3eCC BY-SA\x3c/a\x3e'});ol.source.OSM.ATTRIBUTIONS=[ol.source.OSM.TILE_ATTRIBUTION,ol.source.OSM.DATA_ATTRIBUTION];ol.source.MapQuest=function(a){a=goog.isDef(a)?a:{};var b=ol.source.MapQuestConfig[a.layer];ol.source.XYZ.call(this,{attributions:b.attributions,crossOrigin:"anonymous",logo:"//developer.mapquest.com/content/osm/mq_logo.png",maxZoom:b.maxZoom,opaque:!0,tileLoadFunction:a.tileLoadFunction,url:"//otile{1-4}.mqcdn.com/tiles/1.0.0/"+a.layer+"/{z}/{x}/{y}.jpg"})};goog.inherits(ol.source.MapQuest,ol.source.XYZ);ol.source.MapQuest.TILE_ATTRIBUTION=new ol.Attribution({html:'Tiles Courtesy of \x3ca href\x3d"http://www.mapquest.com/" target\x3d"_blank"\x3eMapQuest\x3c/a\x3e'});
|
|
ol.source.MapQuestConfig={osm:{maxZoom:28,attributions:[ol.source.MapQuest.TILE_ATTRIBUTION,ol.source.OSM.DATA_ATTRIBUTION]},sat:{maxZoom:18,attributions:[ol.source.MapQuest.TILE_ATTRIBUTION,new ol.Attribution({html:"Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency"})]},hyb:{maxZoom:18,attributions:[ol.source.MapQuest.TILE_ATTRIBUTION,ol.source.OSM.DATA_ATTRIBUTION]}};ol.source.OSMXML=function(a){a=goog.isDef(a)?a:{};ol.source.VectorFile.call(this,{attributions:a.attributions,doc:a.doc,extent:a.extent,format:new ol.format.OSMXML,logo:a.logo,node:a.node,projection:a.projection,reprojectTo:a.reprojectTo,text:a.text,url:a.url})};goog.inherits(ol.source.OSMXML,ol.source.VectorFile);ol.source.StamenLayerConfig={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}};
|
|
ol.source.StamenProviderConfig={terrain:{minZoom:4,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:3,maxZoom:16}};
|
|
ol.source.Stamen=function(a){var b=a.layer.indexOf("-"),b=-1==b?a.layer:a.layer.slice(0,b),b=ol.source.StamenProviderConfig[b],c=ol.source.StamenLayerConfig[a.layer],d=goog.isDef(a.url)?a.url:"//{a-d}.tile.stamen.com/"+a.layer+"/{z}/{x}/{y}."+c.extension;ol.source.XYZ.call(this,{attributions:ol.source.Stamen.ATTRIBUTIONS,crossOrigin:"anonymous",maxZoom:b.maxZoom,opaque:c.opaque,tileLoadFunction:a.tileLoadFunction,url:d})};goog.inherits(ol.source.Stamen,ol.source.XYZ);
|
|
ol.source.Stamen.ATTRIBUTIONS=[new ol.Attribution({html:'Map tiles by \x3ca href\x3d"http://stamen.com/"\x3eStamen Design\x3c/a\x3e, under \x3ca href\x3d"http://creativecommons.org/licenses/by/3.0/"\x3eCC BY 3.0\x3c/a\x3e.'}),ol.source.OSM.DATA_ATTRIBUTION];ol.DebugTile_=function(a,b){ol.Tile.call(this,a,ol.TileState.LOADED);this.tileCoord_=a;this.tileSize_=b.getTileSize(a.z);this.canvasByContext_={}};goog.inherits(ol.DebugTile_,ol.Tile);
|
|
ol.DebugTile_.prototype.getImage=function(a){a=goog.isDef(a)?goog.getUid(a):-1;if(a in this.canvasByContext_)return this.canvasByContext_[a];var b=this.tileSize_,c=goog.dom.createElement(goog.dom.TagName.CANVAS);c.width=b;c.height=b;var d=c.getContext("2d");d.strokeStyle="black";d.strokeRect(0.5,0.5,b+0.5,b+0.5);d.fillStyle="black";d.textAlign="center";d.textBaseline="middle";d.font="24px sans-serif";d.fillText(this.tileCoord_.toString(),b/2,b/2);return this.canvasByContext_[a]=c};
|
|
ol.source.TileDebug=function(a){ol.source.Tile.call(this,{extent:a.extent,opaque:!1,projection:a.projection,tileGrid:a.tileGrid});this.tileCache_=new ol.TileCache};goog.inherits(ol.source.TileDebug,ol.source.Tile);ol.source.TileDebug.prototype.canExpireCache=function(){return this.tileCache_.canExpireCache()};ol.source.TileDebug.prototype.expireCache=function(a){this.tileCache_.expireCache(a)};
|
|
ol.source.TileDebug.prototype.getTile=function(a,b,c){var d=this.getKeyZXY(a,b,c);if(this.tileCache_.containsKey(d))return this.tileCache_.get(d);a=new ol.DebugTile_(new ol.TileCoord(a,b,c),this.tileGrid);this.tileCache_.set(d,a);return a};ol.tilejson={};ol.tilejson.grids_=[];var grid=function(a){ol.tilejson.grids_.push(a)};goog.exportSymbol("grid",grid);ol.source.TileJSON=function(a){ol.source.TileImage.call(this,{crossOrigin:a.crossOrigin,projection:ol.proj.get("EPSG:3857"),state:ol.source.State.LOADING,tileLoadFunction:a.tileLoadFunction});this.deferred_=goog.net.jsloader.load(a.url,{cleanupWhenDone:!0});this.deferred_.addCallback(this.handleTileJSONResponse,this)};goog.inherits(ol.source.TileJSON,ol.source.TileImage);
|
|
ol.source.TileJSON.prototype.handleTileJSONResponse=function(){var a=ol.tilejson.grids_.pop(),b=ol.proj.get("EPSG:4326"),c;if(goog.isDef(a.bounds)){var d=ol.proj.getTransformFromProjections(b,this.getProjection());c=ol.extent.transform(a.bounds,d);this.setExtent(c)}goog.isDef(a.scheme);var e=a.minzoom||0,d=a.maxzoom||22,f=new ol.tilegrid.XYZ({maxZoom:d,minZoom:e});this.tileGrid=f;this.tileUrlFunction=ol.TileUrlFunction.withTileCoordTransform(f.createTileCoordTransform({extent:c}),ol.TileUrlFunction.createFromTemplates(a.tiles));
|
|
if(goog.isDef(a.attribution)){b=goog.isDef(c)?c:b.getExtent();c={};for(var g;e<=d;++e)g=e.toString(),c[g]=[f.getTileRangeForExtentAndZ(b,e)];this.setAttributions([new ol.Attribution({html:a.attribution,tileRanges:c})])}this.setState(ol.source.State.READY)};ol.source.TileWMS=function(a){a=goog.isDef(a)?a:{};var b=goog.isDef(a.params)?a.params:{},c=goog.object.get(b,"TRANSPARENT",!0);ol.source.TileImage.call(this,{attributions:a.attributions,crossOrigin:a.crossOrigin,extent:a.extent,logo:a.logo,opaque:!c,projection:a.projection,tileGrid:a.tileGrid,tileLoadFunction:a.tileLoadFunction,tileUrlFunction:goog.bind(this.tileUrlFunction_,this)});c=a.urls;!goog.isDef(c)&&goog.isDef(a.url)&&(c=ol.TileUrlFunction.expandUrl(a.url));this.urls_=c;this.gutter_=goog.isDef(a.gutter)?
|
|
a.gutter:0;this.params_=b;this.pixelRatio_=NaN;this.v13_=!0;this.serverType_=a.serverType;this.hidpi_=goog.isDef(a.hidpi)?a.hidpi:!0;this.coordKeyPrefix_="";this.resetCoordKeyPrefix_();this.tmpExtent_=ol.extent.createEmpty();this.updateV13_()};goog.inherits(ol.source.TileWMS,ol.source.TileImage);
|
|
ol.source.TileWMS.prototype.getGetFeatureInfoUrl=function(a,b,c,d){var e=this.pixelRatio_;if(!isNaN(this.pixelRatio_)){var f=this.getTileGrid();goog.isNull(f)&&(f=this.getTileGridForProjection(c));b=f.getTileCoordForCoordAndResolution(a,b);if(!(f.getResolutions().length<=b.z)){var g=f.getResolution(b.z),h=f.getTileCoordExtent(b,this.tmpExtent_),f=f.getTileSize(b.z),k=this.gutter_;0!==k&&(f+=2*k,h=ol.extent.buffer(h,g*k,h));1!=e&&(f=f*e+0.5|0);k={SERVICE:"WMS",VERSION:ol.source.wms.DEFAULT_VERSION,
|
|
REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:goog.object.get(this.params_,"LAYERS")};goog.object.extend(k,this.params_,d);d=Math.floor((h[3]-a[1])/(g/e));goog.object.set(k,this.v13_?"I":"X",Math.floor((a[0]-h[0])/(g/e)));goog.object.set(k,this.v13_?"J":"Y",d);return this.getRequestUrl_(b,f,h,e,c,k)}}};ol.source.TileWMS.prototype.getGutter=function(){return this.gutter_};
|
|
ol.source.TileWMS.prototype.getKeyZXY=function(a,b,c){return this.coordKeyPrefix_+ol.source.TileWMS.superClass_.getKeyZXY.call(this,a,b,c)};ol.source.TileWMS.prototype.getParams=function(){return this.params_};
|
|
ol.source.TileWMS.prototype.getRequestUrl_=function(a,b,c,d,e,f){var g=this.urls_;if(goog.isDef(g)&&!goog.array.isEmpty(g)){goog.object.set(f,"WIDTH",b);goog.object.set(f,"HEIGHT",b);f[this.v13_?"CRS":"SRS"]=e.getCode();"STYLES"in this.params_||goog.object.set(f,"STYLES",new String(""));if(1!=d)switch(this.serverType_){case ol.source.wms.ServerType.GEOSERVER:goog.object.set(f,"FORMAT_OPTIONS","dpi:"+(90*d+0.5|0));break;case ol.source.wms.ServerType.MAPSERVER:goog.object.set(f,"MAP_RESOLUTION",90*
|
|
d);break;case ol.source.wms.ServerType.CARMENTA_SERVER:case ol.source.wms.ServerType.QGIS:goog.object.set(f,"DPI",90*d)}b=e.getAxisOrientation();this.v13_&&"ne"==b.substr(0,2)&&(b=c[0],c[0]=c[1],c[1]=b,b=c[2],c[2]=c[3],c[3]=b);goog.object.set(f,"BBOX",c.join(","));1==g.length?g=g[0]:(a=goog.math.modulo(a.hash(),this.urls_.length),g=g[a]);return goog.uri.utils.appendParamsFromMap(g,f)}};
|
|
ol.source.TileWMS.prototype.getTilePixelSize=function(a,b,c){a=ol.source.TileWMS.superClass_.getTilePixelSize.call(this,a,b,c);return 1!=b&&this.hidpi_&&goog.isDef(this.serverType_)?a*b+0.5|0:a};ol.source.TileWMS.prototype.resetCoordKeyPrefix_=function(){var a=0,b=[],c;for(c in this.params_)b[a++]=c+"-"+this.params_[c];this.coordKeyPrefix_=b.join("/")};
|
|
ol.source.TileWMS.prototype.tileUrlFunction_=function(a,b,c){var d=this.getTileGrid();goog.isNull(d)&&(d=this.getTileGridForProjection(c));if(!(d.getResolutions().length<=a.z)){1==b||this.hidpi_&&goog.isDef(this.serverType_)||(b=1);var e=d.getResolution(a.z),f=d.getTileCoordExtent(a,this.tmpExtent_),d=d.getTileSize(a.z),g=this.gutter_;0!==g&&(d+=2*g,f=ol.extent.buffer(f,e*g,f));e=this.getExtent();if(goog.isNull(e)||ol.extent.intersects(f,e)&&!ol.extent.touches(f,e))return 1!=b&&(d=d*b+0.5|0),e={SERVICE:"WMS",
|
|
VERSION:ol.source.wms.DEFAULT_VERSION,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0},goog.object.extend(e,this.params_),this.pixelRatio_=b,this.getRequestUrl_(a,d,f,b,c,e)}};ol.source.TileWMS.prototype.updateParams=function(a){goog.object.extend(this.params_,a);this.resetCoordKeyPrefix_();this.updateV13_();this.dispatchChangeEvent()};
|
|
ol.source.TileWMS.prototype.updateV13_=function(){var a=goog.object.get(this.params_,"VERSION",ol.source.wms.DEFAULT_VERSION);this.v13_=0<=goog.string.compareVersions(a,"1.3")};ol.source.TopoJSON=function(a){a=goog.isDef(a)?a:{};ol.source.VectorFile.call(this,{attributions:a.attributions,extent:a.extent,format:new ol.format.TopoJSON({defaultProjection:a.defaultProjection}),logo:a.logo,object:a.object,projection:a.projection,text:a.text,url:a.url})};goog.inherits(ol.source.TopoJSON,ol.source.VectorFile);ol.tilegrid.WMTS=function(a){this.matrixIds_=a.matrixIds;ol.tilegrid.TileGrid.call(this,{origin:a.origin,origins:a.origins,resolutions:a.resolutions,tileSize:a.tileSize,tileSizes:a.tileSizes})};goog.inherits(ol.tilegrid.WMTS,ol.tilegrid.TileGrid);ol.tilegrid.WMTS.prototype.getMatrixId=function(a){return this.matrixIds_[a]};ol.tilegrid.WMTS.prototype.getMatrixIds=function(){return this.matrixIds_};
|
|
ol.tilegrid.WMTS.createFromCapabilitiesMatrixSet=function(a){var b=[],c=[],d=[],e=[],f=ol.proj.get(a.supportedCRS).getMetersPerUnit();goog.array.sort(a.matrixIds,function(a,b){return b.scaleDenominator-a.scaleDenominator});goog.array.forEach(a.matrixIds,function(a,h,k){c.push(a.identifier);d.push(a.topLeftCorner);b.push(2.8E-4*a.scaleDenominator/f);e.push(a.tileWidth)});return new ol.tilegrid.WMTS({origins:d,resolutions:b,matrixIds:c,tileSizes:e})};ol.source.WMTSRequestEncoding={KVP:"KVP",REST:"REST"};
|
|
ol.source.WMTS=function(a){function b(a){a=e==ol.source.WMTSRequestEncoding.KVP?goog.uri.utils.appendParamsFromMap(a,g):a.replace(/\{(\w+?)\}/g,function(a,b){return b in g?g[b]:a});return function(b,c,d){if(!goog.isNull(b)){var g={TileMatrix:f.getMatrixId(b.z),TileCol:b.x,TileRow:b.y};goog.object.extend(g,this.dimensions_);b=a;return b=e==ol.source.WMTSRequestEncoding.KVP?goog.uri.utils.appendParamsFromMap(b,g):b.replace(/\{(\w+?)\}/g,function(a,b){return g[b]})}}}var c=goog.isDef(a.version)?a.version:
|
|
"1.0.0",d=goog.isDef(a.format)?a.format:"image/jpeg";this.dimensions_=a.dimensions||{};this.coordKeyPrefix_="";this.resetCoordKeyPrefix_();var e=goog.isDef(a.requestEncoding)?a.requestEncoding:ol.source.WMTSRequestEncoding.KVP,f=a.tileGrid,g={Layer:a.layer,style:a.style,Style:a.style,TileMatrixSet:a.matrixSet};e==ol.source.WMTSRequestEncoding.KVP&&goog.object.extend(g,{Service:"WMTS",Request:"GetTile",Version:c,Format:d});c=ol.TileUrlFunction.nullTileUrlFunction;d=a.urls;!goog.isDef(d)&&goog.isDef(a.url)&&
|
|
(d=ol.TileUrlFunction.expandUrl(a.url));goog.isDef(d)&&(c=ol.TileUrlFunction.createFromTileUrlFunctions(goog.array.map(d,b)));var h=ol.extent.createEmpty(),k=new ol.TileCoord(0,0,0),c=ol.TileUrlFunction.withTileCoordTransform(function(b,c,d){d=this.getTileGrid();if(d.getResolutions().length<=b.z)return null;var e=b.x,f=-b.y-1,g=d.getTileCoordExtent(b),u=c.getExtent(),s=goog.isDef(a.extent)?a.extent:u;!goog.isNull(s)&&(c.isGlobal()&&s[0]===u[0]&&s[2]===u[2])&&(c=Math.ceil((s[2]-s[0])/(g[2]-g[0])),
|
|
e=goog.math.modulo(e,c),k.z=b.z,k.x=e,k.y=b.y,g=d.getTileCoordExtent(k,h));return!ol.extent.intersects(g,s)||ol.extent.touches(g,s)?null:new ol.TileCoord(b.z,e,f)},c);ol.source.TileImage.call(this,{attributions:a.attributions,crossOrigin:a.crossOrigin,extent:a.extent,logo:a.logo,projection:a.projection,tileGrid:f,tileLoadFunction:a.tileLoadFunction,tileUrlFunction:c})};goog.inherits(ol.source.WMTS,ol.source.TileImage);ol.source.WMTS.prototype.getDimensions=function(){return this.dimensions_};
|
|
ol.source.WMTS.prototype.getKeyZXY=function(a,b,c){return this.coordKeyPrefix_+ol.source.WMTS.superClass_.getKeyZXY.call(this,a,b,c)};ol.source.WMTS.prototype.resetCoordKeyPrefix_=function(){var a=0,b=[],c;for(c in this.dimensions_)b[a++]=c+"-"+this.dimensions_[c];this.coordKeyPrefix_=b.join("/")};ol.source.WMTS.prototype.updateDimensions=function(a){goog.object.extend(this.dimensions_,a);this.resetCoordKeyPrefix_();this.dispatchChangeEvent()};
|
|
ol.source.WMTS.optionsFromCapabilities=function(a,b){var c=goog.array.find(a.contents.layers,function(a,c,d){return a.identifier==b}),d=c.tileMatrixSetLinks[0].tileMatrixSet,e=c.formats[0],f=goog.array.findIndex(c.styles,function(a,b,c){return a.isDefault});0>f&&(f=0);var f=c.styles[f].identifier,g={};goog.array.forEach(c.dimensions,function(a,b,c){b=a.identifier;c=a["default"];goog.isDef(c)||(c=a.values[0]);g[b]=c});var h=a.contents.tileMatrixSets[d],k=ol.tilegrid.WMTS.createFromCapabilitiesMatrixSet(h),
|
|
h=ol.proj.get(h.supportedCRS),l=a.operationsMetadata.GetTile.dcp.http.get,m,n;switch(goog.object.getKeys(l[0].constraints.GetEncoding.allowedValues)[0]){case "REST":case "RESTful":n=ol.source.WMTSRequestEncoding.REST;m=c.resourceUrls.tile[e];break;case "KVP":n=ol.source.WMTSRequestEncoding.KVP,m=[],goog.array.forEach(l,function(a,b,c){a.constraints.GetEncoding.allowedValues.hasOwnProperty(ol.source.WMTSRequestEncoding.KVP)&&m.push(a.url)})}return{urls:m,layer:b,matrixSet:d,format:e,projection:h,requestEncoding:n,
|
|
tileGrid:k,style:f,dimensions:g}};ol.tilegrid.Zoomify=function(a){var b=goog.isDef(a)?a:b;ol.tilegrid.TileGrid.call(this,{origin:[0,0],resolutions:b.resolutions})};goog.inherits(ol.tilegrid.Zoomify,ol.tilegrid.TileGrid);
|
|
ol.tilegrid.Zoomify.prototype.createTileCoordTransform=function(a){a=goog.isDef(a)?a:{};var b=this.minZoom,c=this.maxZoom,d=new ol.TileCoord(0,0,0),e=null;if(goog.isDef(a.extent)){var e=Array(c+1),f;for(f=0;f<=c;++f)e[f]=f<b?null:this.getTileRangeForExtentAndZ(a.extent,f)}return function(a,f,k){f=a.z;if(f<b||c<f)return null;var l=Math.pow(2,f),m=a.x;if(0>m||l<=m)return null;a=a.y;return a<-l||-1<a||!goog.isNull(e)&&(d.z=f,d.x=m,d.y=-a-1,!e[f].contains(d))?null:ol.TileCoord.createOrUpdate(f,m,-a-1,
|
|
k)}};ol.source.ZoomifyTierSizeCalculation={DEFAULT:"default",TRUNCATED:"truncated"};
|
|
ol.source.Zoomify=function(a){a=goog.isDef(a)?a:{};var b=a.size,c=goog.isDef(a.tierSizeCalculation)?a.tierSizeCalculation:ol.source.ZoomifyTierSizeCalculation.DEFAULT,d=b[0],e=b[1],f=[],g=ol.DEFAULT_TILE_SIZE;switch(c){case ol.source.ZoomifyTierSizeCalculation.DEFAULT:for(;d>g||e>g;)f.push([Math.ceil(d/g),Math.ceil(e/g)]),g+=g;break;case ol.source.ZoomifyTierSizeCalculation.TRUNCATED:for(c=d;c>g||e>g;)f.push([Math.ceil(c/g),Math.ceil(e/g)]),c>>=1,e>>=1}f.push([1,1]);f.reverse();for(var g=[1],h=[0],
|
|
e=1,c=f.length;e<c;e++)g.push(1<<e),h.push(f[e-1][0]*f[e-1][1]+h[e-1]);g.reverse();var g=new ol.tilegrid.Zoomify({resolutions:g}),k=a.url,b=ol.TileUrlFunction.withTileCoordTransform(g.createTileCoordTransform({extent:[0,0,b[0],b[1]]}),function(a,b,c){return goog.isNull(a)?void 0:k+"TileGroup"+((a.x+a.y*f[a.z][0]+h[a.z])/ol.DEFAULT_TILE_SIZE|0)+"/"+a.z+"-"+a.x+"-"+a.y+".jpg"});ol.source.TileImage.call(this,{attributions:a.attributions,crossOrigin:a.crossOrigin,logo:a.logo,tileClass:ol.source.ZoomifyTile_,
|
|
tileGrid:g,tileUrlFunction:b})};goog.inherits(ol.source.Zoomify,ol.source.TileImage);ol.source.ZoomifyTile_=function(a,b,c,d,e){ol.ImageTile.call(this,a,b,c,d,e);this.zoomifyImageByContext_={}};goog.inherits(ol.source.ZoomifyTile_,ol.ImageTile);
|
|
ol.source.ZoomifyTile_.prototype.getImage=function(a){var b=goog.isDef(a)?goog.getUid(a).toString():"";if(b in this.zoomifyImageByContext_)return this.zoomifyImageByContext_[b];a=ol.source.ZoomifyTile_.superClass_.getImage.call(this,a);if(this.state==ol.TileState.LOADED){if(a.width==ol.DEFAULT_TILE_SIZE&&a.height==ol.DEFAULT_TILE_SIZE)return this.zoomifyImageByContext_[b]=a;var c=goog.dom.createElement(goog.dom.TagName.CANVAS);c.width=ol.DEFAULT_TILE_SIZE;c.height=ol.DEFAULT_TILE_SIZE;c.getContext("2d").drawImage(a,
|
|
0,0);return this.zoomifyImageByContext_[b]=c}return a};ol.sphere.WGS84=new ol.Sphere(6378137);ol.style.Text=function(a){a=goog.isDef(a)?a:{};this.font_=a.font;this.rotation_=a.rotation;this.scale_=a.scale;this.text_=a.text;this.textAlign_=a.textAlign;this.textBaseline_=a.textBaseline;this.fill_=goog.isDef(a.fill)?a.fill:null;this.stroke_=goog.isDef(a.stroke)?a.stroke:null};ol.style.Text.prototype.getFont=function(){return this.font_};ol.style.Text.prototype.getFill=function(){return this.fill_};ol.style.Text.prototype.getRotation=function(){return this.rotation_};
|
|
ol.style.Text.prototype.getScale=function(){return this.scale_};ol.style.Text.prototype.getStroke=function(){return this.stroke_};ol.style.Text.prototype.getText=function(){return this.text_};ol.style.Text.prototype.getTextAlign=function(){return this.textAlign_};ol.style.Text.prototype.getTextBaseline=function(){return this.textBaseline_};goog.exportSymbol("ol.Attribution",ol.Attribution);goog.exportSymbol("ol.BrowserFeature",ol.BrowserFeature);goog.exportProperty(ol.BrowserFeature,"DEVICE_PIXEL_RATIO",ol.BrowserFeature.DEVICE_PIXEL_RATIO);goog.exportProperty(ol.BrowserFeature,"HAS_CANVAS",ol.BrowserFeature.HAS_CANVAS);goog.exportProperty(ol.BrowserFeature,"HAS_DEVICE_ORIENTATION",ol.BrowserFeature.HAS_DEVICE_ORIENTATION);goog.exportProperty(ol.BrowserFeature,"HAS_GEOLOCATION",ol.BrowserFeature.HAS_GEOLOCATION);
|
|
goog.exportProperty(ol.BrowserFeature,"HAS_TOUCH",ol.BrowserFeature.HAS_TOUCH);goog.exportProperty(ol.BrowserFeature,"HAS_WEBGL",ol.BrowserFeature.HAS_WEBGL);goog.exportSymbol("ol.Collection",ol.Collection);goog.exportProperty(ol.Collection.prototype,"clear",ol.Collection.prototype.clear);goog.exportProperty(ol.Collection.prototype,"extend",ol.Collection.prototype.extend);goog.exportProperty(ol.Collection.prototype,"forEach",ol.Collection.prototype.forEach);
|
|
goog.exportProperty(ol.Collection.prototype,"getArray",ol.Collection.prototype.getArray);goog.exportProperty(ol.Collection.prototype,"getAt",ol.Collection.prototype.getAt);goog.exportProperty(ol.Collection.prototype,"getLength",ol.Collection.prototype.getLength);goog.exportProperty(ol.Collection.prototype,"insertAt",ol.Collection.prototype.insertAt);goog.exportProperty(ol.Collection.prototype,"pop",ol.Collection.prototype.pop);goog.exportProperty(ol.Collection.prototype,"push",ol.Collection.prototype.push);
|
|
goog.exportProperty(ol.Collection.prototype,"remove",ol.Collection.prototype.remove);goog.exportProperty(ol.Collection.prototype,"removeAt",ol.Collection.prototype.removeAt);goog.exportProperty(ol.Collection.prototype,"setAt",ol.Collection.prototype.setAt);goog.exportSymbol("ol.DeviceOrientation",ol.DeviceOrientation);goog.exportSymbol("ol.Feature",ol.Feature);goog.exportProperty(ol.Feature.prototype,"getGeometryName",ol.Feature.prototype.getGeometryName);
|
|
goog.exportProperty(ol.Feature.prototype,"getId",ol.Feature.prototype.getId);goog.exportProperty(ol.Feature.prototype,"getStyle",ol.Feature.prototype.getStyle);goog.exportProperty(ol.Feature.prototype,"getStyleFunction",ol.Feature.prototype.getStyleFunction);goog.exportProperty(ol.Feature.prototype,"setGeometryName",ol.Feature.prototype.setGeometryName);goog.exportProperty(ol.Feature.prototype,"setId",ol.Feature.prototype.setId);goog.exportProperty(ol.Feature.prototype,"setStyle",ol.Feature.prototype.setStyle);
|
|
goog.exportSymbol("ol.FeatureOverlay",ol.FeatureOverlay);goog.exportProperty(ol.FeatureOverlay.prototype,"addFeature",ol.FeatureOverlay.prototype.addFeature);goog.exportProperty(ol.FeatureOverlay.prototype,"getFeatures",ol.FeatureOverlay.prototype.getFeatures);goog.exportProperty(ol.FeatureOverlay.prototype,"getStyle",ol.FeatureOverlay.prototype.getStyle);goog.exportProperty(ol.FeatureOverlay.prototype,"getStyleFunction",ol.FeatureOverlay.prototype.getStyleFunction);
|
|
goog.exportProperty(ol.FeatureOverlay.prototype,"removeFeature",ol.FeatureOverlay.prototype.removeFeature);goog.exportProperty(ol.FeatureOverlay.prototype,"setFeatures",ol.FeatureOverlay.prototype.setFeatures);goog.exportProperty(ol.FeatureOverlay.prototype,"setMap",ol.FeatureOverlay.prototype.setMap);goog.exportProperty(ol.FeatureOverlay.prototype,"setStyle",ol.FeatureOverlay.prototype.setStyle);goog.exportSymbol("ol.Geolocation",ol.Geolocation);
|
|
goog.exportProperty(ol.ImageTile.prototype,"getImage",ol.ImageTile.prototype.getImage);goog.exportSymbol("ol.Kinetic",ol.Kinetic);goog.exportSymbol("ol.Map",ol.Map);goog.exportProperty(ol.Map.prototype,"addControl",ol.Map.prototype.addControl);goog.exportProperty(ol.Map.prototype,"addInteraction",ol.Map.prototype.addInteraction);goog.exportProperty(ol.Map.prototype,"addLayer",ol.Map.prototype.addLayer);goog.exportProperty(ol.Map.prototype,"addOverlay",ol.Map.prototype.addOverlay);
|
|
goog.exportProperty(ol.Map.prototype,"beforeRender",ol.Map.prototype.beforeRender);goog.exportProperty(ol.Map.prototype,"forEachFeatureAtPixel",ol.Map.prototype.forEachFeatureAtPixel);goog.exportProperty(ol.Map.prototype,"getControls",ol.Map.prototype.getControls);goog.exportProperty(ol.Map.prototype,"getCoordinateFromPixel",ol.Map.prototype.getCoordinateFromPixel);goog.exportProperty(ol.Map.prototype,"getEventCoordinate",ol.Map.prototype.getEventCoordinate);
|
|
goog.exportProperty(ol.Map.prototype,"getEventPixel",ol.Map.prototype.getEventPixel);goog.exportProperty(ol.Map.prototype,"getInteractions",ol.Map.prototype.getInteractions);goog.exportProperty(ol.Map.prototype,"getLayers",ol.Map.prototype.getLayers);goog.exportProperty(ol.Map.prototype,"getOverlays",ol.Map.prototype.getOverlays);goog.exportProperty(ol.Map.prototype,"getPixelFromCoordinate",ol.Map.prototype.getPixelFromCoordinate);goog.exportProperty(ol.Map.prototype,"getViewport",ol.Map.prototype.getViewport);
|
|
goog.exportProperty(ol.Map.prototype,"removeControl",ol.Map.prototype.removeControl);goog.exportProperty(ol.Map.prototype,"removeInteraction",ol.Map.prototype.removeInteraction);goog.exportProperty(ol.Map.prototype,"removeLayer",ol.Map.prototype.removeLayer);goog.exportProperty(ol.Map.prototype,"removeOverlay",ol.Map.prototype.removeOverlay);goog.exportProperty(ol.Map.prototype,"render",ol.Map.prototype.render);goog.exportProperty(ol.Map.prototype,"renderSync",ol.Map.prototype.renderSync);
|
|
goog.exportProperty(ol.Map.prototype,"updateSize",ol.Map.prototype.updateSize);goog.exportProperty(ol.MapBrowserEvent.prototype,"preventDefault",ol.MapBrowserEvent.prototype.preventDefault);goog.exportProperty(ol.MapBrowserEvent.prototype,"stopPropagation",ol.MapBrowserEvent.prototype.stopPropagation);goog.exportSymbol("ol.Object",ol.Object);goog.exportProperty(ol.Object.prototype,"bindTo",ol.Object.prototype.bindTo);goog.exportProperty(ol.Object.prototype,"get",ol.Object.prototype.get);
|
|
goog.exportProperty(ol.Object.prototype,"getProperties",ol.Object.prototype.getProperties);goog.exportProperty(ol.Object.prototype,"notify",ol.Object.prototype.notify);goog.exportProperty(ol.Object.prototype,"set",ol.Object.prototype.set);goog.exportProperty(ol.Object.prototype,"setValues",ol.Object.prototype.setValues);goog.exportProperty(ol.Object.prototype,"unbind",ol.Object.prototype.unbind);goog.exportProperty(ol.Object.prototype,"unbindAll",ol.Object.prototype.unbindAll);
|
|
goog.exportSymbol("ol.Observable",ol.Observable);goog.exportProperty(ol.Observable.prototype,"dispatchChangeEvent",ol.Observable.prototype.dispatchChangeEvent);goog.exportProperty(ol.Observable.prototype,"on",ol.Observable.prototype.on);goog.exportProperty(ol.Observable.prototype,"once",ol.Observable.prototype.once);goog.exportProperty(ol.Observable.prototype,"un",ol.Observable.prototype.un);goog.exportProperty(ol.Observable.prototype,"unByKey",ol.Observable.prototype.unByKey);
|
|
goog.exportSymbol("ol.Overlay",ol.Overlay);goog.exportProperty(ol.Tile.prototype,"getTileCoord",ol.Tile.prototype.getTileCoord);goog.exportProperty(ol.TileCoord.prototype,"getZXY",ol.TileCoord.prototype.getZXY);goog.exportSymbol("ol.View2D",ol.View2D);goog.exportProperty(ol.View2D.prototype,"calculateExtent",ol.View2D.prototype.calculateExtent);goog.exportProperty(ol.View2D.prototype,"constrainResolution",ol.View2D.prototype.constrainResolution);
|
|
goog.exportProperty(ol.View2D.prototype,"constrainRotation",ol.View2D.prototype.constrainRotation);goog.exportProperty(ol.View2D.prototype,"fitExtent",ol.View2D.prototype.fitExtent);goog.exportProperty(ol.View2D.prototype,"getView2D",ol.View2D.prototype.getView2D);goog.exportProperty(ol.View2D.prototype,"getZoom",ol.View2D.prototype.getZoom);goog.exportProperty(ol.View2D.prototype,"setZoom",ol.View2D.prototype.setZoom);goog.exportSymbol("ol.animation.bounce",ol.animation.bounce);
|
|
goog.exportSymbol("ol.animation.pan",ol.animation.pan);goog.exportSymbol("ol.animation.rotate",ol.animation.rotate);goog.exportSymbol("ol.animation.zoom",ol.animation.zoom);goog.exportSymbol("ol.color.asArray",ol.color.asArray);goog.exportSymbol("ol.color.asString",ol.color.asString);goog.exportSymbol("ol.control.Attribution",ol.control.Attribution);goog.exportProperty(ol.control.Attribution.prototype,"setMap",ol.control.Attribution.prototype.setMap);goog.exportSymbol("ol.control.Control",ol.control.Control);
|
|
goog.exportProperty(ol.control.Control.prototype,"getMap",ol.control.Control.prototype.getMap);goog.exportProperty(ol.control.Control.prototype,"setMap",ol.control.Control.prototype.setMap);goog.exportSymbol("ol.control.FullScreen",ol.control.FullScreen);goog.exportSymbol("ol.control.Logo",ol.control.Logo);goog.exportProperty(ol.control.Logo.prototype,"setMap",ol.control.Logo.prototype.setMap);goog.exportSymbol("ol.control.MousePosition",ol.control.MousePosition);
|
|
goog.exportProperty(ol.control.MousePosition.prototype,"setMap",ol.control.MousePosition.prototype.setMap);goog.exportSymbol("ol.control.ScaleLine",ol.control.ScaleLine);goog.exportProperty(ol.control.ScaleLine.prototype,"setMap",ol.control.ScaleLine.prototype.setMap);goog.exportSymbol("ol.control.Zoom",ol.control.Zoom);goog.exportProperty(ol.control.Zoom.prototype,"setMap",ol.control.Zoom.prototype.setMap);goog.exportSymbol("ol.control.ZoomSlider",ol.control.ZoomSlider);
|
|
goog.exportSymbol("ol.control.ZoomToExtent",ol.control.ZoomToExtent);goog.exportSymbol("ol.control.defaults",ol.control.defaults);goog.exportSymbol("ol.coordinate.createStringXY",ol.coordinate.createStringXY);goog.exportSymbol("ol.coordinate.format",ol.coordinate.format);goog.exportSymbol("ol.coordinate.fromProjectedArray",ol.coordinate.fromProjectedArray);goog.exportSymbol("ol.coordinate.rotate",ol.coordinate.rotate);goog.exportSymbol("ol.coordinate.toStringHDMS",ol.coordinate.toStringHDMS);
|
|
goog.exportSymbol("ol.coordinate.toStringXY",ol.coordinate.toStringXY);goog.exportSymbol("ol.dom.Input",ol.dom.Input);goog.exportSymbol("ol.easing.bounce",ol.easing.bounce);goog.exportSymbol("ol.easing.easeIn",ol.easing.easeIn);goog.exportSymbol("ol.easing.easeOut",ol.easing.easeOut);goog.exportSymbol("ol.easing.elastic",ol.easing.elastic);goog.exportSymbol("ol.easing.inAndOut",ol.easing.inAndOut);goog.exportSymbol("ol.easing.linear",ol.easing.linear);goog.exportSymbol("ol.easing.upAndDown",ol.easing.upAndDown);
|
|
goog.exportSymbol("ol.events.condition.altKeyOnly",ol.events.condition.altKeyOnly);goog.exportSymbol("ol.events.condition.altShiftKeysOnly",ol.events.condition.altShiftKeysOnly);goog.exportSymbol("ol.events.condition.always",ol.events.condition.always);goog.exportSymbol("ol.events.condition.noModifierKeys",ol.events.condition.noModifierKeys);goog.exportSymbol("ol.events.condition.platformModifierKeyOnly",ol.events.condition.platformModifierKeyOnly);
|
|
goog.exportSymbol("ol.events.condition.shiftKeyOnly",ol.events.condition.shiftKeyOnly);goog.exportSymbol("ol.events.condition.targetNotEditable",ol.events.condition.targetNotEditable);goog.exportSymbol("ol.extent.boundingExtent",ol.extent.boundingExtent);goog.exportSymbol("ol.extent.buffer",ol.extent.buffer);goog.exportSymbol("ol.extent.containsCoordinate",ol.extent.containsCoordinate);goog.exportSymbol("ol.extent.containsExtent",ol.extent.containsExtent);
|
|
goog.exportSymbol("ol.extent.createEmpty",ol.extent.createEmpty);goog.exportSymbol("ol.extent.equals",ol.extent.equals);goog.exportSymbol("ol.extent.extend",ol.extent.extend);goog.exportSymbol("ol.extent.getBottomLeft",ol.extent.getBottomLeft);goog.exportSymbol("ol.extent.getBottomRight",ol.extent.getBottomRight);goog.exportSymbol("ol.extent.getCenter",ol.extent.getCenter);goog.exportSymbol("ol.extent.getHeight",ol.extent.getHeight);goog.exportSymbol("ol.extent.getSize",ol.extent.getSize);
|
|
goog.exportSymbol("ol.extent.getTopLeft",ol.extent.getTopLeft);goog.exportSymbol("ol.extent.getTopRight",ol.extent.getTopRight);goog.exportSymbol("ol.extent.getWidth",ol.extent.getWidth);goog.exportSymbol("ol.extent.intersects",ol.extent.intersects);goog.exportSymbol("ol.extent.isEmpty",ol.extent.isEmpty);goog.exportSymbol("ol.extent.transform",ol.extent.transform);goog.exportSymbol("ol.format.GPX",ol.format.GPX);goog.exportProperty(ol.format.GPX.prototype,"readFeature",ol.format.GPX.prototype.readFeature);
|
|
goog.exportProperty(ol.format.GPX.prototype,"readFeatures",ol.format.GPX.prototype.readFeatures);goog.exportSymbol("ol.format.GeoJSON",ol.format.GeoJSON);goog.exportProperty(ol.format.GeoJSON.prototype,"readFeature",ol.format.GeoJSON.prototype.readFeature);goog.exportProperty(ol.format.GeoJSON.prototype,"readFeatures",ol.format.GeoJSON.prototype.readFeatures);goog.exportProperty(ol.format.GeoJSON.prototype,"readGeometry",ol.format.GeoJSON.prototype.readGeometry);
|
|
goog.exportProperty(ol.format.GeoJSON.prototype,"readProjection",ol.format.GeoJSON.prototype.readProjection);goog.exportProperty(ol.format.GeoJSON.prototype,"writeFeature",ol.format.GeoJSON.prototype.writeFeature);goog.exportProperty(ol.format.GeoJSON.prototype,"writeFeatures",ol.format.GeoJSON.prototype.writeFeatures);goog.exportProperty(ol.format.GeoJSON.prototype,"writeGeometry",ol.format.GeoJSON.prototype.writeGeometry);goog.exportSymbol("ol.format.IGC",ol.format.IGC);
|
|
goog.exportProperty(ol.format.IGC.prototype,"readFeature",ol.format.IGC.prototype.readFeature);goog.exportProperty(ol.format.IGC.prototype,"readFeatures",ol.format.IGC.prototype.readFeatures);goog.exportSymbol("ol.format.KML",ol.format.KML);goog.exportProperty(ol.format.KML.prototype,"readFeature",ol.format.KML.prototype.readFeature);goog.exportProperty(ol.format.KML.prototype,"readFeatures",ol.format.KML.prototype.readFeatures);goog.exportProperty(ol.format.KML.prototype,"readGeometry",ol.format.KML.prototype.readGeometry);
|
|
goog.exportProperty(ol.format.KML.prototype,"readName",ol.format.KML.prototype.readName);goog.exportProperty(ol.format.KML.prototype,"readProjection",ol.format.KML.prototype.readProjection);goog.exportSymbol("ol.format.TopoJSON",ol.format.TopoJSON);goog.exportProperty(ol.format.TopoJSON.prototype,"readFeatures",ol.format.TopoJSON.prototype.readFeatures);goog.exportProperty(ol.format.TopoJSON.prototype,"readProjection",ol.format.TopoJSON.prototype.readProjection);
|
|
goog.exportSymbol("ol.geom.Circle",ol.geom.Circle);goog.exportProperty(ol.geom.Circle.prototype,"clone",ol.geom.Circle.prototype.clone);goog.exportProperty(ol.geom.Circle.prototype,"getCenter",ol.geom.Circle.prototype.getCenter);goog.exportProperty(ol.geom.Circle.prototype,"getExtent",ol.geom.Circle.prototype.getExtent);goog.exportProperty(ol.geom.Circle.prototype,"getRadius",ol.geom.Circle.prototype.getRadius);goog.exportProperty(ol.geom.Circle.prototype,"getSimplifiedGeometry",ol.geom.Circle.prototype.getSimplifiedGeometry);
|
|
goog.exportProperty(ol.geom.Circle.prototype,"getType",ol.geom.Circle.prototype.getType);goog.exportProperty(ol.geom.Circle.prototype,"setCenter",ol.geom.Circle.prototype.setCenter);goog.exportProperty(ol.geom.Circle.prototype,"setCenterAndRadius",ol.geom.Circle.prototype.setCenterAndRadius);goog.exportProperty(ol.geom.Circle.prototype,"setRadius",ol.geom.Circle.prototype.setRadius);goog.exportProperty(ol.geom.Circle.prototype,"transform",ol.geom.Circle.prototype.transform);
|
|
goog.exportSymbol("ol.geom.Geometry",ol.geom.Geometry);goog.exportProperty(ol.geom.Geometry.prototype,"getClosestPoint",ol.geom.Geometry.prototype.getClosestPoint);goog.exportProperty(ol.geom.Geometry.prototype,"getType",ol.geom.Geometry.prototype.getType);goog.exportSymbol("ol.geom.GeometryCollection",ol.geom.GeometryCollection);goog.exportProperty(ol.geom.GeometryCollection.prototype,"clone",ol.geom.GeometryCollection.prototype.clone);
|
|
goog.exportProperty(ol.geom.GeometryCollection.prototype,"getExtent",ol.geom.GeometryCollection.prototype.getExtent);goog.exportProperty(ol.geom.GeometryCollection.prototype,"getGeometries",ol.geom.GeometryCollection.prototype.getGeometries);goog.exportProperty(ol.geom.GeometryCollection.prototype,"getSimplifiedGeometry",ol.geom.GeometryCollection.prototype.getSimplifiedGeometry);goog.exportProperty(ol.geom.GeometryCollection.prototype,"getType",ol.geom.GeometryCollection.prototype.getType);
|
|
goog.exportProperty(ol.geom.GeometryCollection.prototype,"setGeometries",ol.geom.GeometryCollection.prototype.setGeometries);goog.exportSymbol("ol.geom.LineString",ol.geom.LineString);goog.exportProperty(ol.geom.LineString.prototype,"clone",ol.geom.LineString.prototype.clone);goog.exportProperty(ol.geom.LineString.prototype,"getCoordinateAtM",ol.geom.LineString.prototype.getCoordinateAtM);goog.exportProperty(ol.geom.LineString.prototype,"getCoordinates",ol.geom.LineString.prototype.getCoordinates);
|
|
goog.exportProperty(ol.geom.LineString.prototype,"getLength",ol.geom.LineString.prototype.getLength);goog.exportProperty(ol.geom.LineString.prototype,"getType",ol.geom.LineString.prototype.getType);goog.exportProperty(ol.geom.LineString.prototype,"setCoordinates",ol.geom.LineString.prototype.setCoordinates);goog.exportSymbol("ol.geom.LinearRing",ol.geom.LinearRing);goog.exportProperty(ol.geom.LinearRing.prototype,"clone",ol.geom.LinearRing.prototype.clone);
|
|
goog.exportProperty(ol.geom.LinearRing.prototype,"getArea",ol.geom.LinearRing.prototype.getArea);goog.exportProperty(ol.geom.LinearRing.prototype,"getCoordinates",ol.geom.LinearRing.prototype.getCoordinates);goog.exportProperty(ol.geom.LinearRing.prototype,"getType",ol.geom.LinearRing.prototype.getType);goog.exportProperty(ol.geom.LinearRing.prototype,"setCoordinates",ol.geom.LinearRing.prototype.setCoordinates);goog.exportSymbol("ol.geom.MultiLineString",ol.geom.MultiLineString);
|
|
goog.exportProperty(ol.geom.MultiLineString.prototype,"clone",ol.geom.MultiLineString.prototype.clone);goog.exportProperty(ol.geom.MultiLineString.prototype,"getCoordinateAtM",ol.geom.MultiLineString.prototype.getCoordinateAtM);goog.exportProperty(ol.geom.MultiLineString.prototype,"getCoordinates",ol.geom.MultiLineString.prototype.getCoordinates);goog.exportProperty(ol.geom.MultiLineString.prototype,"getLineStrings",ol.geom.MultiLineString.prototype.getLineStrings);
|
|
goog.exportProperty(ol.geom.MultiLineString.prototype,"getType",ol.geom.MultiLineString.prototype.getType);goog.exportProperty(ol.geom.MultiLineString.prototype,"setCoordinates",ol.geom.MultiLineString.prototype.setCoordinates);goog.exportSymbol("ol.geom.MultiPoint",ol.geom.MultiPoint);goog.exportProperty(ol.geom.MultiPoint.prototype,"clone",ol.geom.MultiPoint.prototype.clone);goog.exportProperty(ol.geom.MultiPoint.prototype,"getCoordinates",ol.geom.MultiPoint.prototype.getCoordinates);
|
|
goog.exportProperty(ol.geom.MultiPoint.prototype,"getPoints",ol.geom.MultiPoint.prototype.getPoints);goog.exportProperty(ol.geom.MultiPoint.prototype,"getType",ol.geom.MultiPoint.prototype.getType);goog.exportProperty(ol.geom.MultiPoint.prototype,"setCoordinates",ol.geom.MultiPoint.prototype.setCoordinates);goog.exportSymbol("ol.geom.MultiPolygon",ol.geom.MultiPolygon);goog.exportProperty(ol.geom.MultiPolygon.prototype,"clone",ol.geom.MultiPolygon.prototype.clone);
|
|
goog.exportProperty(ol.geom.MultiPolygon.prototype,"getArea",ol.geom.MultiPolygon.prototype.getArea);goog.exportProperty(ol.geom.MultiPolygon.prototype,"getCoordinates",ol.geom.MultiPolygon.prototype.getCoordinates);goog.exportProperty(ol.geom.MultiPolygon.prototype,"getInteriorPoints",ol.geom.MultiPolygon.prototype.getInteriorPoints);goog.exportProperty(ol.geom.MultiPolygon.prototype,"getPolygons",ol.geom.MultiPolygon.prototype.getPolygons);
|
|
goog.exportProperty(ol.geom.MultiPolygon.prototype,"getType",ol.geom.MultiPolygon.prototype.getType);goog.exportProperty(ol.geom.MultiPolygon.prototype,"setCoordinates",ol.geom.MultiPolygon.prototype.setCoordinates);goog.exportSymbol("ol.geom.Point",ol.geom.Point);goog.exportProperty(ol.geom.Point.prototype,"clone",ol.geom.Point.prototype.clone);goog.exportProperty(ol.geom.Point.prototype,"getCoordinates",ol.geom.Point.prototype.getCoordinates);
|
|
goog.exportProperty(ol.geom.Point.prototype,"getType",ol.geom.Point.prototype.getType);goog.exportProperty(ol.geom.Point.prototype,"setCoordinates",ol.geom.Point.prototype.setCoordinates);goog.exportSymbol("ol.geom.Polygon",ol.geom.Polygon);goog.exportProperty(ol.geom.Polygon.prototype,"clone",ol.geom.Polygon.prototype.clone);goog.exportProperty(ol.geom.Polygon.prototype,"getArea",ol.geom.Polygon.prototype.getArea);goog.exportProperty(ol.geom.Polygon.prototype,"getCoordinates",ol.geom.Polygon.prototype.getCoordinates);
|
|
goog.exportProperty(ol.geom.Polygon.prototype,"getInteriorPoint",ol.geom.Polygon.prototype.getInteriorPoint);goog.exportProperty(ol.geom.Polygon.prototype,"getLinearRings",ol.geom.Polygon.prototype.getLinearRings);goog.exportProperty(ol.geom.Polygon.prototype,"getType",ol.geom.Polygon.prototype.getType);goog.exportProperty(ol.geom.Polygon.prototype,"setCoordinates",ol.geom.Polygon.prototype.setCoordinates);goog.exportSymbol("ol.geom.SimpleGeometry",ol.geom.SimpleGeometry);
|
|
goog.exportProperty(ol.geom.SimpleGeometry.prototype,"getExtent",ol.geom.SimpleGeometry.prototype.getExtent);goog.exportProperty(ol.geom.SimpleGeometry.prototype,"getFirstCoordinate",ol.geom.SimpleGeometry.prototype.getFirstCoordinate);goog.exportProperty(ol.geom.SimpleGeometry.prototype,"getLastCoordinate",ol.geom.SimpleGeometry.prototype.getLastCoordinate);goog.exportProperty(ol.geom.SimpleGeometry.prototype,"getLayout",ol.geom.SimpleGeometry.prototype.getLayout);
|
|
goog.exportProperty(ol.geom.SimpleGeometry.prototype,"getSimplifiedGeometry",ol.geom.SimpleGeometry.prototype.getSimplifiedGeometry);goog.exportProperty(ol.geom.SimpleGeometry.prototype,"transform",ol.geom.SimpleGeometry.prototype.transform);goog.exportSymbol("ol.inherits",ol.inherits);goog.exportSymbol("ol.interaction.DoubleClickZoom",ol.interaction.DoubleClickZoom);goog.exportSymbol("ol.interaction.DragAndDrop",ol.interaction.DragAndDrop);goog.exportSymbol("ol.interaction.DragBox",ol.interaction.DragBox);
|
|
goog.exportProperty(ol.interaction.DragBox.prototype,"getGeometry",ol.interaction.DragBox.prototype.getGeometry);goog.exportSymbol("ol.interaction.DragPan",ol.interaction.DragPan);goog.exportSymbol("ol.interaction.DragRotate",ol.interaction.DragRotate);goog.exportSymbol("ol.interaction.DragRotateAndZoom",ol.interaction.DragRotateAndZoom);goog.exportSymbol("ol.interaction.DragZoom",ol.interaction.DragZoom);goog.exportSymbol("ol.interaction.Draw",ol.interaction.Draw);
|
|
goog.exportSymbol("ol.interaction.KeyboardPan",ol.interaction.KeyboardPan);goog.exportSymbol("ol.interaction.KeyboardZoom",ol.interaction.KeyboardZoom);goog.exportSymbol("ol.interaction.Modify",ol.interaction.Modify);goog.exportSymbol("ol.interaction.MouseWheelZoom",ol.interaction.MouseWheelZoom);goog.exportSymbol("ol.interaction.Select",ol.interaction.Select);goog.exportProperty(ol.interaction.Select.prototype,"getFeatures",ol.interaction.Select.prototype.getFeatures);
|
|
goog.exportProperty(ol.interaction.Select.prototype,"setMap",ol.interaction.Select.prototype.setMap);goog.exportSymbol("ol.interaction.TouchPan",ol.interaction.TouchPan);goog.exportSymbol("ol.interaction.TouchRotate",ol.interaction.TouchRotate);goog.exportSymbol("ol.interaction.TouchZoom",ol.interaction.TouchZoom);goog.exportSymbol("ol.interaction.defaults",ol.interaction.defaults);goog.exportSymbol("ol.layer.Group",ol.layer.Group);goog.exportSymbol("ol.layer.Heatmap",ol.layer.Heatmap);
|
|
goog.exportSymbol("ol.layer.Image",ol.layer.Image);goog.exportSymbol("ol.layer.Layer",ol.layer.Layer);goog.exportProperty(ol.layer.Layer.prototype,"getSource",ol.layer.Layer.prototype.getSource);goog.exportSymbol("ol.layer.Tile",ol.layer.Tile);goog.exportSymbol("ol.layer.Vector",ol.layer.Vector);goog.exportProperty(ol.layer.Vector.prototype,"getStyle",ol.layer.Vector.prototype.getStyle);goog.exportProperty(ol.layer.Vector.prototype,"getStyleFunction",ol.layer.Vector.prototype.getStyleFunction);
|
|
goog.exportProperty(ol.layer.Vector.prototype,"setStyle",ol.layer.Vector.prototype.setStyle);goog.exportSymbol("ol.parser.ogc.WMSCapabilities",ol.parser.ogc.WMSCapabilities);goog.exportProperty(ol.parser.ogc.WMSCapabilities.prototype,"read",ol.parser.ogc.WMSCapabilities.prototype.read);goog.exportSymbol("ol.proj.METERS_PER_UNIT",ol.proj.METERS_PER_UNIT);goog.exportSymbol("ol.proj.Projection",ol.proj.Projection);goog.exportProperty(ol.proj.Projection.prototype,"getCode",ol.proj.Projection.prototype.getCode);
|
|
goog.exportProperty(ol.proj.Projection.prototype,"getExtent",ol.proj.Projection.prototype.getExtent);goog.exportProperty(ol.proj.Projection.prototype,"getUnits",ol.proj.Projection.prototype.getUnits);goog.exportSymbol("ol.proj.addProjection",ol.proj.addProjection);goog.exportSymbol("ol.proj.common.add",ol.proj.common.add);goog.exportSymbol("ol.proj.configureProj4jsProjection",ol.proj.configureProj4jsProjection);goog.exportSymbol("ol.proj.get",ol.proj.get);
|
|
goog.exportSymbol("ol.proj.getTransform",ol.proj.getTransform);goog.exportSymbol("ol.proj.getTransformFromProjections",ol.proj.getTransformFromProjections);goog.exportSymbol("ol.proj.transform",ol.proj.transform);goog.exportSymbol("ol.proj.transformWithProjections",ol.proj.transformWithProjections);goog.exportProperty(ol.render.canvas.Immediate.prototype,"drawAsync",ol.render.canvas.Immediate.prototype.drawAsync);goog.exportProperty(ol.render.canvas.Immediate.prototype,"drawCircleGeometry",ol.render.canvas.Immediate.prototype.drawCircleGeometry);
|
|
goog.exportProperty(ol.render.canvas.Immediate.prototype,"drawFeature",ol.render.canvas.Immediate.prototype.drawFeature);goog.exportProperty(ol.render.canvas.Immediate.prototype,"drawLineStringGeometry",ol.render.canvas.Immediate.prototype.drawLineStringGeometry);goog.exportProperty(ol.render.canvas.Immediate.prototype,"drawMultiLineStringGeometry",ol.render.canvas.Immediate.prototype.drawMultiLineStringGeometry);goog.exportProperty(ol.render.canvas.Immediate.prototype,"drawMultiPointGeometry",ol.render.canvas.Immediate.prototype.drawMultiPointGeometry);
|
|
goog.exportProperty(ol.render.canvas.Immediate.prototype,"drawPointGeometry",ol.render.canvas.Immediate.prototype.drawPointGeometry);goog.exportProperty(ol.render.canvas.Immediate.prototype,"drawPolygonGeometry",ol.render.canvas.Immediate.prototype.drawPolygonGeometry);goog.exportProperty(ol.render.canvas.Immediate.prototype,"setFillStrokeStyle",ol.render.canvas.Immediate.prototype.setFillStrokeStyle);goog.exportProperty(ol.render.canvas.Immediate.prototype,"setImageStyle",ol.render.canvas.Immediate.prototype.setImageStyle);
|
|
goog.exportProperty(ol.render.canvas.Immediate.prototype,"setTextStyle",ol.render.canvas.Immediate.prototype.setTextStyle);goog.exportSymbol("ol.source.BingMaps",ol.source.BingMaps);goog.exportProperty(ol.source.BingMaps,"TOS_ATTRIBUTION",ol.source.BingMaps.TOS_ATTRIBUTION);goog.exportSymbol("ol.source.GPX",ol.source.GPX);goog.exportSymbol("ol.source.GeoJSON",ol.source.GeoJSON);goog.exportSymbol("ol.source.IGC",ol.source.IGC);goog.exportSymbol("ol.source.ImageCanvas",ol.source.ImageCanvas);
|
|
goog.exportSymbol("ol.source.ImageStatic",ol.source.ImageStatic);goog.exportSymbol("ol.source.ImageVector",ol.source.ImageVector);goog.exportSymbol("ol.source.ImageWMS",ol.source.ImageWMS);goog.exportProperty(ol.source.ImageWMS.prototype,"getGetFeatureInfoUrl",ol.source.ImageWMS.prototype.getGetFeatureInfoUrl);goog.exportProperty(ol.source.ImageWMS.prototype,"getParams",ol.source.ImageWMS.prototype.getParams);goog.exportProperty(ol.source.ImageWMS.prototype,"setUrl",ol.source.ImageWMS.prototype.setUrl);
|
|
goog.exportProperty(ol.source.ImageWMS.prototype,"updateParams",ol.source.ImageWMS.prototype.updateParams);goog.exportSymbol("ol.source.KML",ol.source.KML);goog.exportSymbol("ol.source.MapGuide",ol.source.MapGuide);goog.exportSymbol("ol.source.MapQuest",ol.source.MapQuest);goog.exportSymbol("ol.source.OSM",ol.source.OSM);goog.exportProperty(ol.source.OSM,"DATA_ATTRIBUTION",ol.source.OSM.DATA_ATTRIBUTION);goog.exportProperty(ol.source.OSM,"TILE_ATTRIBUTION",ol.source.OSM.TILE_ATTRIBUTION);
|
|
goog.exportSymbol("ol.source.OSMXML",ol.source.OSMXML);goog.exportProperty(ol.source.Source.prototype,"getExtent",ol.source.Source.prototype.getExtent);goog.exportProperty(ol.source.Source.prototype,"getState",ol.source.Source.prototype.getState);goog.exportSymbol("ol.source.Stamen",ol.source.Stamen);goog.exportSymbol("ol.source.Tile",ol.source.Tile);goog.exportProperty(ol.source.Tile.prototype,"getTileGrid",ol.source.Tile.prototype.getTileGrid);goog.exportSymbol("ol.source.TileDebug",ol.source.TileDebug);
|
|
goog.exportSymbol("ol.source.TileJSON",ol.source.TileJSON);goog.exportSymbol("ol.source.TileWMS",ol.source.TileWMS);goog.exportProperty(ol.source.TileWMS.prototype,"getGetFeatureInfoUrl",ol.source.TileWMS.prototype.getGetFeatureInfoUrl);goog.exportProperty(ol.source.TileWMS.prototype,"getParams",ol.source.TileWMS.prototype.getParams);goog.exportProperty(ol.source.TileWMS.prototype,"updateParams",ol.source.TileWMS.prototype.updateParams);goog.exportSymbol("ol.source.TopoJSON",ol.source.TopoJSON);
|
|
goog.exportSymbol("ol.source.Vector",ol.source.Vector);goog.exportProperty(ol.source.Vector.prototype,"addFeature",ol.source.Vector.prototype.addFeature);goog.exportProperty(ol.source.Vector.prototype,"addFeatures",ol.source.Vector.prototype.addFeatures);goog.exportProperty(ol.source.Vector.prototype,"forEachFeature",ol.source.Vector.prototype.forEachFeature);goog.exportProperty(ol.source.Vector.prototype,"forEachFeatureInExtent",ol.source.Vector.prototype.forEachFeatureInExtent);
|
|
goog.exportProperty(ol.source.Vector.prototype,"getClosestFeatureToCoordinate",ol.source.Vector.prototype.getClosestFeatureToCoordinate);goog.exportProperty(ol.source.Vector.prototype,"getExtent",ol.source.Vector.prototype.getExtent);goog.exportProperty(ol.source.Vector.prototype,"getFeatures",ol.source.Vector.prototype.getFeatures);goog.exportProperty(ol.source.Vector.prototype,"getFeaturesAtCoordinate",ol.source.Vector.prototype.getFeaturesAtCoordinate);
|
|
goog.exportProperty(ol.source.Vector.prototype,"removeFeature",ol.source.Vector.prototype.removeFeature);goog.exportSymbol("ol.source.VectorFile",ol.source.VectorFile);goog.exportSymbol("ol.source.WMTS",ol.source.WMTS);goog.exportSymbol("ol.source.WMTS.optionsFromCapabilities",ol.source.WMTS.optionsFromCapabilities);goog.exportProperty(ol.source.WMTS.prototype,"getDimensions",ol.source.WMTS.prototype.getDimensions);goog.exportProperty(ol.source.WMTS.prototype,"updateDimensions",ol.source.WMTS.prototype.updateDimensions);
|
|
goog.exportSymbol("ol.source.XYZ",ol.source.XYZ);goog.exportProperty(ol.source.XYZ.prototype,"setUrl",ol.source.XYZ.prototype.setUrl);goog.exportSymbol("ol.source.Zoomify",ol.source.Zoomify);goog.exportSymbol("ol.style.Circle",ol.style.Circle);goog.exportProperty(ol.style.Circle.prototype,"getAnchor",ol.style.Circle.prototype.getAnchor);goog.exportProperty(ol.style.Circle.prototype,"getFill",ol.style.Circle.prototype.getFill);goog.exportProperty(ol.style.Circle.prototype,"getImage",ol.style.Circle.prototype.getImage);
|
|
goog.exportProperty(ol.style.Circle.prototype,"getRadius",ol.style.Circle.prototype.getRadius);goog.exportProperty(ol.style.Circle.prototype,"getSize",ol.style.Circle.prototype.getSize);goog.exportProperty(ol.style.Circle.prototype,"getStroke",ol.style.Circle.prototype.getStroke);goog.exportSymbol("ol.style.Fill",ol.style.Fill);goog.exportProperty(ol.style.Fill.prototype,"getColor",ol.style.Fill.prototype.getColor);goog.exportSymbol("ol.style.Icon",ol.style.Icon);
|
|
goog.exportProperty(ol.style.Icon.prototype,"getAnchor",ol.style.Icon.prototype.getAnchor);goog.exportProperty(ol.style.Icon.prototype,"getImage",ol.style.Icon.prototype.getImage);goog.exportProperty(ol.style.Icon.prototype,"getSize",ol.style.Icon.prototype.getSize);goog.exportProperty(ol.style.Icon.prototype,"getSrc",ol.style.Icon.prototype.getSrc);goog.exportSymbol("ol.style.Image",ol.style.Image);goog.exportProperty(ol.style.Image.prototype,"getRotation",ol.style.Image.prototype.getRotation);
|
|
goog.exportProperty(ol.style.Image.prototype,"getScale",ol.style.Image.prototype.getScale);goog.exportSymbol("ol.style.Stroke",ol.style.Stroke);goog.exportProperty(ol.style.Stroke.prototype,"getColor",ol.style.Stroke.prototype.getColor);goog.exportProperty(ol.style.Stroke.prototype,"getLineCap",ol.style.Stroke.prototype.getLineCap);goog.exportProperty(ol.style.Stroke.prototype,"getLineDash",ol.style.Stroke.prototype.getLineDash);goog.exportProperty(ol.style.Stroke.prototype,"getLineJoin",ol.style.Stroke.prototype.getLineJoin);
|
|
goog.exportProperty(ol.style.Stroke.prototype,"getMiterLimit",ol.style.Stroke.prototype.getMiterLimit);goog.exportProperty(ol.style.Stroke.prototype,"getWidth",ol.style.Stroke.prototype.getWidth);goog.exportSymbol("ol.style.Style",ol.style.Style);goog.exportProperty(ol.style.Style.prototype,"getFill",ol.style.Style.prototype.getFill);goog.exportProperty(ol.style.Style.prototype,"getImage",ol.style.Style.prototype.getImage);goog.exportProperty(ol.style.Style.prototype,"getStroke",ol.style.Style.prototype.getStroke);
|
|
goog.exportProperty(ol.style.Style.prototype,"getText",ol.style.Style.prototype.getText);goog.exportProperty(ol.style.Style.prototype,"getZIndex",ol.style.Style.prototype.getZIndex);goog.exportSymbol("ol.style.Text",ol.style.Text);goog.exportProperty(ol.style.Text.prototype,"getFill",ol.style.Text.prototype.getFill);goog.exportProperty(ol.style.Text.prototype,"getFont",ol.style.Text.prototype.getFont);goog.exportProperty(ol.style.Text.prototype,"getRotation",ol.style.Text.prototype.getRotation);
|
|
goog.exportProperty(ol.style.Text.prototype,"getScale",ol.style.Text.prototype.getScale);goog.exportProperty(ol.style.Text.prototype,"getStroke",ol.style.Text.prototype.getStroke);goog.exportProperty(ol.style.Text.prototype,"getText",ol.style.Text.prototype.getText);goog.exportProperty(ol.style.Text.prototype,"getTextAlign",ol.style.Text.prototype.getTextAlign);goog.exportProperty(ol.style.Text.prototype,"getTextBaseline",ol.style.Text.prototype.getTextBaseline);
|
|
goog.exportSymbol("ol.tilegrid.TileGrid",ol.tilegrid.TileGrid);goog.exportProperty(ol.tilegrid.TileGrid.prototype,"getMinZoom",ol.tilegrid.TileGrid.prototype.getMinZoom);goog.exportProperty(ol.tilegrid.TileGrid.prototype,"getOrigin",ol.tilegrid.TileGrid.prototype.getOrigin);goog.exportProperty(ol.tilegrid.TileGrid.prototype,"getResolutions",ol.tilegrid.TileGrid.prototype.getResolutions);goog.exportProperty(ol.tilegrid.TileGrid.prototype,"getTileSize",ol.tilegrid.TileGrid.prototype.getTileSize);
|
|
goog.exportSymbol("ol.tilegrid.WMTS",ol.tilegrid.WMTS);goog.exportProperty(ol.tilegrid.WMTS.prototype,"getMatrixIds",ol.tilegrid.WMTS.prototype.getMatrixIds);goog.exportSymbol("ol.tilegrid.XYZ",ol.tilegrid.XYZ);goog.exportSymbol("ol.tilegrid.Zoomify",ol.tilegrid.Zoomify);goog.exportSymbol("ol.webgl.Context",ol.webgl.Context);goog.exportProperty(ol.webgl.Context.prototype,"getGL",ol.webgl.Context.prototype.getGL);goog.exportProperty(ol.webgl.Context.prototype,"useProgram",ol.webgl.Context.prototype.useProgram);
|