/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
<=q;w++)h=a.readUnsignedShort()-j,l=a.readUnsignedShort()-j,n+=h*k,s+=l*k,null!==b?(r=b.transformXY(n,s,r),h=r.x,l=r.y):(h=n,l=s),he&&(e=h),l< f?f=l:l>g&&(g=l),B[w]=h,u[w]=l}n=Array(t);for(s=0;s<--g);c.lng=a;c.lat=f}else c.lng=a/this._R+this._lng0,c.lat=0.5*Math.PI-2*Math.atan(Math.exp(-b/this._R));c.lat*=this._RAD2DEG;c.lng*=this._RAD2DEG;return c};oa.prototype.setBaseZoom=function(a){this.baseZoom=a};oa.prototype.setBaseScale=function(a){this.baseScale=a};oa.prototype.getTileBounds=function(a,b,c){var d=this.convZoomToScale(c), e=this.tileHeightInPixels*d,d=this.tileWidthInPixels*d,c=1<<c,a=a*d-0.5*c*d,b=0.5*c*e-b*e;return(new v).setBounds(a,b,a+d,b-e)};oa.prototype.getLevelOneScale=function(){var a=156543.03515625;this.baseScale&&(a=this.baseScale*(1<<this.baseZoom));return a};oa.prototype.getCustomScaleRatio=function(){return this.baseScale?256*this.getLevelOneScale()/40075017:1};oa.prototype.convScaleToZoom=function(a,b){var c=Math.log(this.getLevelOneScale()/a)/Math.log(2),d=Math.round(c),e=Math.abs(c-d);if(b||void 0=== b||1E-6>e)c=d;return c};oa.prototype.convZoomToScale=function(a){return this.getLevelOneScale()/Math.pow(2,a)};var jc=/#?([0-9a-f]{1,2})([0-9a-f]{1,2})([0-9a-f]{1,2})$/i;Qb.prototype={hasStroke:function(){return 0this.strokeAlpha?ua(this.strokeColor,this.strokeAlpha):ua(this.strokeColor),a.lineWidth=this.strokeWeight);this.specialFill?a.fillStyle=this.specialFill:this.fillAlpha&&(1>this.fillAlpha?a.fillStyle=ua(this.fillColor,this.fillAlpha):null!=this.fillColor&&(a.fillStyle=ua(this.fillColor)))}};p.inherit(xa,Qb);xa.prototype.hasFill=function(){return!(!this.fillAlpha&&!this.fillAlphas||!(null!=this.fillColor||this.fillColors))}; xa.prototype.hasStroke=function(){return!(!this.strokeWeight&&!this.strokeWeights||!this.strokeAlpha&&!this.strokeAlphas||!(null!=this.strokeColor||this.strokeColors))};xa.prototype.setId=function(a){var b=this.fillColors,c=this.fillAlphas;c&&(this.fillAlpha=c[a],String.fromCharCode(255*this.fillAlpha|0));this.strokeAlphas&&(this.strokeAlpha=this.strokeAlphas[a]);this.strokeWeights&&(this.strokeWeight=this.strokeWeights[a]);this.strokeColors&&(this.strokeColor=this.strokeColors[a]);c="";b&&(b=b[a], c+=String.fromCharCode(b&255)+String.fromCharCode(b>>16&15),this.fillColor=b);this.fillStyler&&(c+=this.fillStyler.getSortCode(a),this.fillStyler.updateStyle(a,this));if(this.strokeWeight||this.strokeWeights)c="";this.sortKey=c};xa.prototype.updateStyle=function(a){this.sortKey="";a.strokeWeight?(this.strokeAlphas=j.isArray(a.strokeAlpha)?a.strokeAlpha:null,this.strokeWeights=j.isArray(a.strokeWeight)?a.strokeWeight:null,this.strokeColors=j.isArray(a.strokeColor)?a.strokeColor:null,this.setStroke(a.strokeWeight, a.strokeColor,a.strokeAlpha)):this.strokeWeight=0;if(a.fillAlpha){var b=a.fillAlpha;j.isArray(b)?this.fillAlphas=b:(this.fillAlpha=b,this.fillAlphas=null);b=a.fillColor;j.isArray(b)?this.fillColors=b:(this.fillColor=b,this.fillColors=null)}else this.fillColors=this.fillColor=this.fillAlpha=this.fillAlphas=null;a.hatchColor&&(this.fillStyler||(this.fillStyler=new Fa(a)),this.fillStyler.update(a));this.compositing=a.compositing||""};Fa.prototype.update=function(a){a=a.hatchColor;j.isArray(a)?this.hatchColors= a:this.hatchColor=a||void 0};Fa.prototype.getSortCode=function(a){var b=this.hatchColors;return b?String(b[a]||""):"xx"};Fa.prototype.updateStyle=function(a,b){var c=this.hatchColor||this.hatchColors[a]||null;if(c&&b.fillAlpha){var d=ua(b.fillColor,b.fillAlpha),c=ua(c,b.fillAlpha);b.specialFill=this.getDiagonalFill(d,c)}else b.specialFill=null};Fa.prototype.getEmptyCanvas=function(a,b){var c=document.createElement("canvas");c.setAttribute("width",a);c.setAttribute("height",b);return c};Fa.prototype.getDiagonalFill= function(a,b){var c=a+b,d=this._fills;if(!d[c]){var e=this.getEmptyCanvas(4,4),f=e.getContext("2d");f.lineWidth=1.36;f.fillStyle=a;f.fillRect(0,0,4,4);f.strokeStyle=b;f.moveTo(0,5);f.lineTo(5,0);f.moveTo(-1,2);f.lineTo(2,-1);f.stroke();d[c]=f.createPattern(e,"repeat")}return d[c]};p.inherit(T,N);T.prototype.setPreFunction=function(a,b){if(b)var c=a,a=function(a){c.call(b,a)};this._pre=a};T.prototype.getAttributeStyler=function(a){return this._stylers[a]||null};T.prototype.styleAttributeByZoom=function(a, b,c){this._stylers[a]=new tb(b,c)};T.prototype.getStyle=function(){return this._defaultStyle||{}};T.prototype.invalidate=function(){for(var a in this._stylers)this._stylers[a].invalidate()};T.prototype.setDefaultStyle=function(a){var b=this._defaultStyle||{};p.copyAllParams(b,a);this._defaultStyle=b};T.prototype.setAttributeStyle=function(a,b){this._stylers[a]=new Rb(b)};T.prototype.getAttributeDataAtZoom=function(a,b){var c=this._stylers[a];return c?(c.setZoom(b),c.getValue()):null};T.getClassId= j.getClassId;p.inherit(R,T);R.prototype.handleDataChange=function(){k("[DataStyler.handleDataChange()] invalidating style");this.invalidate()};R.prototype.getDataTable=function(){return this._data};R.prototype.attr=R.prototype.setAttributeStyler=function(a,b,c){var d=typeof b;if("string"==d)b=new sb(this._data,b);else if("function"==d)b=new Ra(this._data,b,c);else{k("[DataStyler.setAttributeStyler()] invalid filter:",b);return}this._stylers[a]=b};R.prototype.calcCircleSizes=function(a,b){this.setAttributeStyler("bubbleSizes", function(c){c=c.getNumber(a);return Math.sqrt(c*b)})};R.prototype.calcFillsByRange=function(a,b,c){this.setAttributeStyler("fillColor",R.getChoroplethStyler(a,b,c))};R.prototype.calcIndexedFills=function(a,b){this.setAttributeStyler("fillColor",function(c){return b[c.get(a)]})};R.prototype.setLinkedAttributeStyler=function(a,b,c,d){this.waitFor(c);this._stylers[a]=new Ra(c,b,d)};R.getRandomStyler=function(a){return function(){var b=Math.floor(Math.random()*a.length);return a[b]}};R.getChoroplethStyler= function(a,b,c){var d=T.getClassId;return function(e){e=e.getNumber(a);e=d(e,b);return c[e]}};T.prototype.getStyleAtZoom=function(a){var b={};p.copyAllParams(b,this._defaultStyle);this._pre&&this._pre(b);var c=this._stylers,d;for(d in c){var e=c[d];e.setZoom(a);b[d]=e.getValue()}return b};Ga.prototype.setZoom=function(a){this._zoom=a};Ga.prototype.invalidate=function(){this._needsUpdate=!0};p.extendPrototype(Rb,Ga);p.extendPrototype(sb,Ga);sb.prototype.getValue=function(){return this._data.getFieldData(this._field)}; p.extendPrototype(Ra,Ga);Ra.prototype.invalidate=function(){this._cached=null;this._needsUpdate=!0};Ra.prototype.getValue=function(){if(!1===this._needsUpdate&&this._useCaching)return this._cached;for(var a=this._func,b=this._data,c=[],d=0,e=b.size();db/a&&(f=1E3*a/g)}this.getCRS().setBaseScale(f)}c&& this.dispatchEvent("resize")};m.prototype.getContainer=function(){return this.div};m.prototype.getLayers=function(){return this._layers};m.prototype.convViewPixelsToLatLng=function(a,b){var c=this.convViewPixelsToMeters(a,b);return this.projection.unprojectXY(c.x,c.y)};m.prototype.convViewPixelsToMeters=function(a,b){var c=this.getCenterAsLatLng(),c=this.projection.projectLatLng(c.lat,c.lng),d=this.getScale(),e=this.getWidthInPixels(),f=this.getHeightInPixels();return new I(c.x- -(a-0.5*e)*d,c.y- (b-0.5*f)*d)};m.prototype.convMetersToViewPixels=function(a,b){return this.getVisibleExtent().transformXY(a,b)};m.prototype.setFallbackImage=function(){};m.prototype.getSpacing=function(){if(!this._spacing){var a=this._opts,b=a.spacing||0;this._spacing={left:isNaN(a.spacingLeft)?b:a.spacingLeft+0,top:isNaN(a.spacingTop)?b:a.spacingTop+0,right:isNaN(a.spacingRight)?b:a.spacingRight+0,bottom:isNaN(a.spacingBottom)?b:a.spacingBottom+0}}return this._spacing};m.prototype.getCenterAsLatLng=function(){k("[Map.getCenterAsLatLng()] stub")}; m.prototype.getInitialCenterAsLatLng=function(){var a=this._opts.center,b=this.getSpacing();if(b.left==b.right&&b.top==b.bottom)return a;var c=this.getInitialScale(),d=0.5*(b.right-b.left)*c,b=0.5*(b.top-b.bottom)*c,a=this.projection.projectLatLng(a.lat,a.lng);return this.projection.unprojectXY(a.x+d,a.y+b).clone()};m.prototype.getZoom=function(){};m.prototype.addLayer=function(a){var b=this._layers;if("shape"==a.type||"bubble"==a.type)a._opts.hitPriority=p.readParam(a._opts.hitPriority,0.01*b.length); for(var c=0,d=b.length;c<=g;g--){var h=f[g];h.size>e&&(e=h.size)}e=0.5*(e+2)*a;f=this._boxes[c];f.setBounds(f.left-e,f.top+e,f.right+e,f.bottom-e)}};fa.prototype.getSymbolsInBoundingBox= function(a,b){for(var c=this._boxes,d=this._bins,e=[],f=[],g=!!b,h=0,l=c.length;hn.left&&a.top>n.bottom&&a.bottom=a.left&&i.left<=a.right&&i.top>=a.bottom&&i.bottom<=a.top)&&e.push(i)}}}return e.concat(f)};fa.prototype.initCellBounds=function(){for(var a=this._bounds,b=a.width()/this.COLS,c=a.height()/this.ROWS,d=a.left,a=a.bottom, e=this._boxes,f=0,g=this.ROWS*this.COLS;fs||s>=e||isNaN(s)?k("[SymbolIndex.init()] index id out-of-range; id:",s,"CELLS:",e,"c:",l,"r:",n,"sym.x:",h.x,"sym.y:",h.y,"symid:",h.id):d[s].push(h)}else k("[SymbolIndex.init()] Null symbol; id:",f)}this._boxes=c;this._bins=d};p.inherit(Sa,fa);Sa.prototype.getSymbolCol=function(a){return(0.5* (a.left+a.right)-this._bx)/this._cellWidth|0};Sa.prototype.getSymbolRow=function(a){return(0.5*(a.top+a.bottom)-this._by)/this._cellHeight|0};Sa.prototype.init=function(a,b){fa.prototype.init.call(this,a,b);for(var c=this._bins,d=0,e=c.length;d<=h;h--)f.mergeBounds(g[h]);this._boxes[d]=f}};Ja.prototype.init=function(){};Ja.prototype.drawTile=function(a,b,c,d){var e=this._style;e.updateStyle(d);d=new W(b.width,b.height);d.updateBounds(c);for(var b=b.getContext("2d"), c=a.length,f=e.hasStroke(),g=e.hasFill(),h=0;hl&&f>r||g>n&&g>i)||(gg&&s++);l=r;n=i}1==s%2&&d++}return 1==d%2};this.getDistanceFromPointToShape=function(a,b,c){if(isNaN(a)||isNaN(b))return Infinity;for(var c=c.parts,d=Infinity,e=0;ep?(i=j,j=p):i=p;r=i-l<=e;e--){var f=d[e];if(a==f.x&&b==f.y&&c==f.z)return f}return null};Ta.prototype.vacuum=function(){for(var a=this._tiles,b=[],c=a.length-1;0<=c;c--){var d=a[c];d.canvas.parentNode&&b.push(d)}this._tiles=b};Ta.prototype.getTilesForRedraw=function(){this.vacuum(); this._redrawCount++;return this._tiles};p.inherit(db,F);La.postpone=function(a,b,c){var d=b;c&&(d=function(){b.call(c)});setTimeout(d,a)};p.inherit(La,V);var vb=(new La).interval(25).start();p.inherit(Ma,V);Ma.prototype.procTween=function(a){var b=1<=a,c=this.__getData(a);c.progress=a;c.done=b;this.dispatchEvent("tick",c);b&&this.dispatchEvent("done")};var ub=Ma;ub.quadraticOut=function(a){return 1-Math.pow(1-a,2)};ub.sineInOut=function(a){return a=0.5-Math.cos(a*Math.PI)/2};m.useHTML5Extensions= function(){var a=function(a,b,c){this.id=a;this.x=b;this.y=c;this.sortKey=""};da.prototype.getBounds=function(){return this._bounds||new v};da.prototype.importFromDataTable=function(a,b,c,g){g=g.getProjectionTransform();return this.importXYFields(a,c,b,g)};da.prototype.importXYFields=function(b,c,f,g){var h=function(a,b,c){this.id=a;this.x=b;this.y=c};h.prototype={size:0,setDefaultSize:function(a){h.prototype.size=a}};p.extendPrototype(h,a);this._data=b;var l=new v,n=[];this._bubbles=n;b.addEventListener("ready", function(){for(var a=b.getFieldData(c),r=b.getFieldData(f),i=b.size(),j=Infinity,k=Infinity,m=-Infinity,p=-Infinity,D=new I,q=0;qm&&(m=x);yp&&(p=y);var t=new h(q,x,y);n.push(t)}l.setBounds(j,p,m,k);this._bounds=l;this._index=new fa;this._index.init(n,l);this.startWaiting()},this);return this};da.prototype.testHitAtXY=function(a,b,c,g){for(var h=15*c,l=h,n,s=Infinity,r=-1,i=!1,h=(new v).setBounds(a-h,b+h,a+h,b-h),g=this.getCirclesInBoundingBox(h, g),h=g.length-1;0<=h;h--){var j=g[h],k=(j.x-a)*(j.x-a)+(j.y-b)*(j.y-b),m=0.5*j.size,p=(3>m?3:m)*c,q=p*p,t=Math.sqrt(k),p=t-p;if(k<=q){if(!i||m=h))){for(var s=eb.canvasPixelRatio||1,i=0,j=n.length;ic&&(c=1);g=this.id%3328;this.sortKey=String.fromCharCode(c)+ String.fromCharCode(g)};a.prototype.getSortKey=function(){return this.sortKey};a.prototype.draw=function(a,b){var c=this.x*b.mx+b.bx,g=this.y*b.my+b.by,h=this.size||0;0t&&(D||u<=b;b--){var c=a[b];c.clear();this.drawTile(c.canvas,c.x,c.y,c.z)}};p.extendPrototype(S,Ua);p.extendPrototype($,Ua);p.extendPrototype(Z,Ua);m.prototype.hideHover=function(){};S.prototype.drawTile=function(a,b,c,g){var h=this._shapes;if(!h||!h._ready)eb.VERBOSE&&k("[ShapeLayer.drawTile()] Missing shape or shape not READY");else if(!this.getTileIndex().addTile(a,b,c,g)&&!this.isHidden()){var b= this._map._crs.getTileBounds(b,c,g),c=h.getShapesInBoundingBox(b,this.getHiddenSymbolList()),g=this.getStyle(),l=new W;l.updateBounds(b);l=l.metersPerPixel;h.updateContentSize(h.getBounds().width()/l,h.getBounds().height()/l);this._renderer.drawTile(c,a,b,g)}};$.prototype.drawTile=function(a,b,c,g){var h=this._map,l=this._symbols;!l||!l._ready?k("[CircleLayer.drawTile()] Missing bubbles or bubble data not READY"):!this.getTileIndex().addTile(a,b,c,g)&&!this.isHidden()&&(b=h._crs.getTileBounds(b,c, g),c=this.getStyle(),k("[CircleLayer.drawTile()] style:",c),this.updateCircleSizes(c),g=this.getHiddenSymbolList(),l=l.getCirclesInBoundingBox(b,g),this._renderer.drawTile(l,a,b,c))};Z.prototype.init=function(){};Z.prototype._getActiveTiles=function(){var a=this._currTiles;a||(a=this._currTiles=[]);return a};Z.prototype.clear=function(){for(var a=this._getActiveTiles(),b=0;b>>> Map.zoomToInitialExtent()",m.prototype.zoomToInitialExtent);m.prototype.zoomIn=function(){this.setZoom(this.getZoom()+1)};m.prototype.zoomOut=function(){this.setZoom(this.getZoom()- 1)};m.prototype.zoom=function(a){if(a&&a.bounds){var b=a.bounds.centerX(),c=a.bounds.centerY(),g=this.getCRS(),b=g.projection.unprojectXY(b,c),a=g.convScaleToZoom(a.bounds.width()/this.getWidthInPixels(),!0);this.zoomToLatLng(b.lat,b.lng,a)}};m.prototype.handleZoomEnd=function(){var a=this.getZoom();this.dispatchEvent("zoom-end",{zoom:a})};m.prototype.getCenterAsLatLng=function(){var a=this._gmap.getCenter();return new la(a.lat(),a.lng())};m.prototype.getZoom=function(){return this._gmap.getZoom()}; F.prototype.hide=function(){this._hidden||(this._hidden=!0,this._glyr&&this._map._gmap.overlayMapTypes.setAt(this._glyrIdx,null))};F.prototype.show=function(){this._hidden&&(this._hidden=!1,this._glyr&&this._map._gmap.overlayMapTypes.setAt(this._glyrIdx,this._glyr))};F.prototype.__initTileLayer=function(){var a=new kc(this,this._map._gmap);this.__addTileLayer(a)};F.prototype.__addTileLayer=function(a){var b=this._map._gmap;this._glyr=a;this._glyrIdx=b.overlayMapTypes.length;b.overlayMapTypes.push(this.isHidden()? null:a)};S.prototype.handleReadyState=function(){this.__initTileLayer()};$.prototype.handleReadyState=function(){this.__initTileLayer()};Z.prototype.handleReadyState=function(){this.__initTileLayer()};db.prototype.init=function(){};db.prototype.handleReadyState=function(){k("[CanvasTestLayer.handleReadyState()]");this.__initTileLayer()};db.prototype.drawTile=function(a,b,c){a=a.getContext("2d");a.fillStyle=1==(b+c)%2?"rgba(255,0,0,0.1)":"rgba(0, 0, 255, 0.1)";a.fillRect(0,0,256,256)}};M.prototype.__initMap= function(a){!this._map&&(a&&a.mouse)&&(a.mouse.ignoreElement(this.container),a.mouse.addEventListener("mousemove",this.moveHandler,this),a.addEventListener("scroll",this.handleScroll,this),this._map=a)};M.prototype.setLayer=function(a){a.addEventListener("rollover",this.displayHandler,this);a.addEventListener("rollout",this.hideHandler,this)};M.getDivHTML=function(a,b){return'
'+a+"
\n"};M.getTitle=function(a){return this.getDivHTML(a,"nytg-popup-title")};M.getSubtitle=function(a){return this.getDivHTML(a, "nytg-popup-subtitle")};M.getText=function(a){return this.getDivHTML(a,"nytg-popup-text")};M.getTail=function(a){return this.getDivHTML(a,"nytg-popup-tail")};M.prototype.getElement=function(){return this.container};M.prototype.displayRecord=function(a){a=this._callback(a);void 0!==a?a?this.showHTML(a):this.hide():this.show()};M.prototype.showHTML=function(a){this.container.innerHTML=a;this.show()};M.prototype.show=function(){var a=this._attachToMap?this._map.div:document.body,b=this.container;b.parentNode!= a&&a.appendChild(b);this.REMOVE||(b.style.visibility="visible");this.containerWidth=b.offsetWidth;this.containerHeight=b.offsetHeight;this.pageWidth=i.getViewportWidth();this.viewportX=i.pageXToViewportX(0);this.updatePopupLocation();this._visible=!0};M.prototype.hide=function(){this._visible=!1;this.container.parentNode?this.REMOVE?this.container.parentNode.removeChild(this.container):this.container.style.visibility="hidden":k("[HTMLPopup.hide()] Not attached to DOM.")};M.prototype.moveHandler=function(a){this.mouseX= a.pageX;this.mouseY=a.pageY;this._visible&&this.updatePopupLocation()};M.prototype.movePopupToXY=function(a,b){this.mouseX=a.pageX||0;this.mouseY=a.pageY||-200;this.updatePopupLocation(b)};M.prototype.updatePopupLocation=function(a){var b=this.mouseX,c=this.mouseY,d=this.containerWidth,e=this.containerHeight,f=c-e-this._opts.offset,c=c+this._opts.offset+8;a&&(this._fitsAbove=0<=i.pageYToViewportY(f),this._fitsBelow=i.pageYToViewportY(c+e)<=i.getViewportHeight());a=b-d*this._opts.peg;f=this._fitsBelow? c:f;0>a?a=0:a+d>this.pageWidth&&(a=this.pageWidth-d);this._fixedPosition&&(a=i.pageXToViewportX(a),f=i.pageYToViewportY(f));this.setXY(a,f)};M.prototype.handleScroll=function(a){this._visible&&(this._fixedPosition?0!=a.deltaViewY&&this.setXY(this._x+a.deltaViewX,this._y+a.deltaViewY):0!=a.deltaPageY&&this.setXY(this._x+a.deltaPageX,this._y+a.deltaPageY))};M.prototype.setXY=function(a,b){a=Math.round(a);b=Math.round(b);this._x=a;this._y=b;var c=this.container;c.style.left=a+"px";c.style.top=b+"px"}; M.prototype.displayHandler=function(a){this.__initMap(a.target._map);var b=a.rec;b?(this.displayRecord(b),this.movePopupToXY(a,!0)):k("[HTMLPopup.displayHandler()] missing record")};M.prototype.hideHandler=function(){this.hide()};var zb={leftPad:function(a,b,c){for(b-=a.length;0a?"-":d?"+":"";if(3d.length)return k("[dashed-shape partitionVertexSet()] Mismatched input:",d,a,b),null;for(var g,h,l,n,i,r=0,m=b.length;r",u,"z:",t,"breaks:",c);if(0==r)i=new P([],[]);else if(n!=u)for(var D=j.getInnerBreaks(l,t,c),v=t-l,w=0;w=m;)i=0c||24==c?this.AM:this.PM,"P"==b&&(c=c.toLowerCase())}d>c.length&&(c=zb.leftPad(c,d,"0"));return c};U.prototype.escape=function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")};aa.MS_PER_HOUR=36E5;aa.MS_PER_DAY=24*aa.MS_PER_HOUR;aa.prototype.addDays=function(a){this.ms+=Math.round(a*aa.MS_PER_DAY);return this};aa.prototype.addHours=function(a){this.ms+= Math.round(a*aa.MS_PER_HOUR);return this};aa.prototype.getTime=function(){return this.ms};aa.prototype.getDate=function(){return new Date(this.ms)};j.addHours=function(a,b){return(new aa(a)).addHours(b).getDate()};j.addDays=function(a,b){return(new aa(a)).addDays(b).getDate()};var z={NAME:"NAME",NOAA_ID:"NOAA_ID",YEAR:"YEAR",TRACK_PATH:"trackPath",TRACK_VECTOR:"trackVector",TRACK_TIMES:"trackTimes",TRACK_INTENSITIES:"trackIntensities",TRACK_WIND_SWATH:"windSwath",TRACK_LATITUDES:"lats",TRACK_LONGITUDES:"lons", FORECAST_PATH:"forecastPath",FORECAST_VECTOR:"forecastVector",FORECAST_INTENSITIES:"forecastIntensities",FORECAST_TIMES:"forecastTimes",FORECAST_CONE:"forecastCone",FORECAST_VECTOR_2:"forecastVector2",FORECAST_CLASS_2:"forecastClasses2",OBS_INTENSITY:"obsIntensity",OBS_TIME:"obsTime",OBS_SHAPE:"obsShape",OBS_CLASS:"obsClass",OBS_X:"obsX",OBS_Y:"obsY",OBS_FORECAST:"obsForecast",projection:new rb,EXTEND_TRACK:!0,COLORS:[6675419,2995637,16760364,16357891,15556608,14697742,13175306],INTENSITY_BREAKS:[34, 64,83,96,114,135],STORM_LABELS:"Tropical depression;Tropical storm;Cat. 1 hurricane;Cat. 2 hurricane;Cat. 3 hurricane;Cat. 4 hurricane;Cat. 5 hurricane".split(";")};z.TIMESTAMP_PARSER=new U("%Y%m%d%H");z.convKnotsToMilesPerHour=function(a){return 1.15077945*a};z.WINDSPEED_BREAKS=j.map(z.INTENSITY_BREAKS,function(a){a=z.convKnotsToMilesPerHour(a);return Math.round(a)});z.getStormLabel=function(a){return this.STORM_LABELS[a]||"Unknown"};z.GOOGLE_MAP_STYLE=[{featureType:"all",elementType:"all",stylers:[{saturation:-90}]}, {featureType:"road",elementType:"geometry",stylers:[{visibility:"simplified"},{color:"#bbbbbb"}]},{featureType:"road",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"geometry",stylers:[{lightness:85}]},{featureType:"landscape",elementType:"geometry",stylers:[{lightness:-10}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"administrative",elementType:"geometry",stylers:[{visibility:"off"}]},{featureType:"administrative.country", elementType:"geometry",stylers:[{visibility:"on"}]},{featureType:"administrative.province",elementType:"geometry",stylers:[{visibility:"on"},{color:"#ffffff"}]},{featureType:"landscape.man_made",elementType:"geometry",stylers:[{visibility:"simplified"},{gamma:0.76}]}];z.__createPathVector=function(a,b){if(!a||!b||!a.length||a.length!=b.length)return k("[Hurricanes.__createPathVector()] Invalid lat/lon arrays"),null;for(var c=z.projection,d=[],e=[],f=new I,g=0,h=a.length;gB,B=String(Math.abs(B))):u&&(m?(B=Math.abs(h)+1E-10,v=parseInt(m.substr(1),10),B=B.toFixed(v),v=0===parseFloat(B),z=!v&&0>h):(B=String(Math.abs(h)),v=0===h,z=0>h));if(w&&!q){if(-1!=i.indexOf("'")){q=B.indexOf(".");q=-1==q?B.length:q;w="";h=0;for(m=q%3||3;mq.wk))Ca(c,!0),d&& (e.success=!0,e.ref=Ab(c),d(e));else if(va[b].expressInstall&&Bb()){e={};e.data=va[b].expressInstall;e.width=f.getAttribute("width")||"0";e.height=f.getAttribute("height")||"0";f.getAttribute("class")&&(e.styleclass=f.getAttribute("class"));f.getAttribute("align")&&(e.align=f.getAttribute("align"));for(var g={},f=f.getElementsByTagName("param"),h=f.length,i=0;iq.wk)},Cb=function(a,b,c,d){jb=!0;Eb=d||null;ac={success:!1,id:c};var e=ka(c);if(e){"OBJECT"==e.nodeName?(Wa=Fb(e),kb=null):(Wa=e,kb=c);a.id=bc;if(typeof a.width==J||!/%$/.test(a.width)&&310>parseInt(a.width, 10))a.width="310";if(typeof a.height==J||!/%$/.test(a.height)&&137>parseInt(a.height,10))a.height="137";w.title=w.title.slice(0,47)+" - Flash Player Installation";d=q.ie&&q.win?"ActiveX":"PlugIn";d="MMredirectURL="+ha.location.toString().replace(/&/g,"%26")+"&MMplayerType="+d+"&MMdoctitle="+w.title;b.flashvars=typeof b.flashvars!=J?b.flashvars+("&"+d):d;q.ie&&(q.win&&4!=e.readyState)&&(d=w.createElement("div"),c+="SWFObjectNew",d.setAttribute("id",c),e.parentNode.insertBefore(d,e),e.style.display= "none",function(){4==e.readyState?e.parentNode.removeChild(e):setTimeout(arguments.callee,10)}());Gb(a,b,c)}},tc=function(a){if(q.ie&&q.win&&4!=a.readyState){var b=w.createElement("div");a.parentNode.insertBefore(b,a);b.parentNode.replaceChild(Fb(a),b);a.style.display="none";(function(){4==a.readyState?a.parentNode.removeChild(a):setTimeout(arguments.callee,10)})()}else a.parentNode.replaceChild(Fb(a),a)},Fb=function(a){var b=w.createElement("div");if(q.win&&q.ie)b.innerHTML=a.innerHTML;else if(a= a.getElementsByTagName(ra)[0])if(a=a.childNodes)for(var c=a.length,d=0;dq.wk)return d;if(e)if(typeof a.id==J&&(a.id=c),q.ie&&q.win){var f="",g;for(g in a)a[g]!=Object.prototype[g]&&("data"==g.toLowerCase()?b.movie=a[g]:"styleclass"==g.toLowerCase()?f+=' class="'+a[g]+'"':"classid"!=g.toLowerCase()&&(f+=" "+g+'="'+a[g]+'"'));g="";for(var h in b)b[h]!= Object.prototype[h]&&(g+='');e.outerHTML='";lb[lb.length]=a.id;d=ka(a.id)}else{h=w.createElement(ra);h.setAttribute("type",mb);for(var i in a)a[i]!=Object.prototype[i]&&("styleclass"==i.toLowerCase()?h.setAttribute("class",a[i]):"classid"!=i.toLowerCase()&&h.setAttribute(i,a[i]));for(f in b)b[f]!=Object.prototype[f]&&"movie"!=f.toLowerCase()&&(a=h,g=f,i=b[f],c=w.createElement("param"), c.setAttribute("name",g),c.setAttribute("value",i),a.appendChild(c));e.parentNode.replaceChild(h,e);d=h}return d},cc=function(a){var b=ka(a);b&&"OBJECT"==b.nodeName&&(q.ie&&q.win?(b.style.display="none",function(){if(4==b.readyState){var c=ka(a);if(c){for(var d in c)"function"==typeof c[d]&&(c[d]=null);c.parentNode.removeChild(c)}}else setTimeout(arguments.callee,10)}()):b.parentNode.removeChild(b))},ka=function(a){var b=null;try{b=w.getElementById(a)}catch(c){}return b},ib=function(a){var b=q.pv, a=a.split(".");a[0]=parseInt(a[0],10);a[1]=parseInt(a[1],10)||0;a[2]=parseInt(a[2],10)||0;return b[0]>a[0]||b[0]==a[0]&&b[1]>a[1]||b[0]==a[0]&&b[1]==a[1]&&b[2]>=a[2]?!0:!1},dc=function(a,b,c,d){if(!q.ie||!q.mac){var e=w.getElementsByTagName("head")[0];if(e){c=c&&"string"==typeof c?c:"screen";d&&(Hb=sa=null);if(!sa||Hb!=c)d=w.createElement("style"),d.setAttribute("type","text/css"),d.setAttribute("media",c),sa=e.appendChild(d),q.ie&&(q.win&&typeof w.styleSheets!=J&&0<>\.;]/.exec(a)&&typeof encodeURIComponent!=J?encodeURIComponent(a):a},J="undefined",ra="object",mb="application/x-shockwave-flash",bc="SWFObjectExprInst",ha=window,w=document,wa=navigator,gc=!1,hb=[function(){if(gc){var a= w.getElementsByTagName("body")[0],b=w.createElement(ra);b.setAttribute("type",mb);var c=a.appendChild(b);if(c){var d=0;(function(){if(typeof c.GetVariable!=J){var e=c.GetVariable("$version");e&&(e=e.split(" ")[1].split(","),q.pv=[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10)])}else if(10>d){d++;setTimeout(arguments.callee,10);return}a.removeChild(b);c=null;Db()})()}else Db()}else Db()}],va=[],lb=[],Pa=[],Wa,kb,Eb,ac,Ba=!1,jb=!1,sa,Hb,ec=!0,q,uc=typeof w.getElementById!=J&&typeof w.getElementsByTagName!= J&&typeof w.createElement!=J,nb=wa.userAgent.toLowerCase(),ob=wa.platform.toLowerCase(),vc=ob?/win/.test(ob):/win/.test(nb),wc=ob?/mac/.test(ob):/mac/.test(nb),xc=/webkit/.test(nb)?parseFloat(nb.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,Ib=!+"\v1",Xa=[0,0,0],ba=null;if(typeof wa.plugins!=J&&typeof wa.plugins["Shockwave Flash"]==ra){if((ba=wa.plugins["Shockwave Flash"].description)&&!(typeof wa.mimeTypes!=J&&wa.mimeTypes[mb]&&!wa.mimeTypes[mb].enabledPlugin))gc=!0,Ib=!1,ba=ba.replace(/^.*\s+(\S+\s+\S+$)/, "$1"),Xa[0]=parseInt(ba.replace(/^(.*)\..*$/,"$1"),10),Xa[1]=parseInt(ba.replace(/^.*\.(.*)\s.*$/,"$1"),10),Xa[2]=/[a-zA-Z]/.test(ba)?parseInt(ba.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}else if(typeof ha.ActiveXObject!=J)try{var hc=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(hc&&(ba=hc.GetVariable("$version")))Ib=!0,ba=ba.split(" ")[1].split(","),Xa=[parseInt(ba[0],10),parseInt(ba[1],10),parseInt(ba[2],10)]}catch(zc){}q={w3:uc,pv:Xa,wk:xc,ie:Ib,win:vc,mac:wc};q.w3&&((typeof w.readyState!= J&&"complete"==w.readyState||typeof w.readyState==J&&(w.getElementsByTagName("body")[0]||w.body))&&Oa(),Ba||(typeof w.addEventListener!=J&&w.addEventListener("DOMContentLoaded",Oa,!1),q.ie&&q.win&&(w.attachEvent("onreadystatechange",function(){"complete"==w.readyState&&(w.detachEvent("onreadystatechange",arguments.callee),Oa())}),ha==top&&function(){if(!Ba){try{w.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}Oa()}}()),q.wk&&function(){Ba||(/loaded|complete/.test(w.readyState)? Oa():setTimeout(arguments.callee,0))}(),$b(Oa)));q.ie&&q.win&&window.attachEvent("onunload",function(){for(var a=Pa.length,b=0;bq.wk)&&a&&b&&c&&d&&e?(Ca(b,!1),Zb(function(){c+="";d+="";var m={};if(i&&typeof i===ra)for(var p in i)m[p]=i[p];m.data=a;m.width=c;m.height=d;p={};if(h&&typeof h===ra)for(var q in h)p[q]=h[q];if(g&&typeof g===ra)for(var t in g)p.flashvars=typeof p.flashvars!=J?p.flashvars+("&"+t+"="+g[t]):t+"="+g[t];if(ib(e))q=Gb(m,p,b),m.id==b&&Ca(b,!0),k.success=!0,k.ref=q;else{if(f&&Bb()){m.data=f;Cb(m,p,b,j);return}Ca(b,!0)}j&&j(k)})): j&&j(k)},switchOffAutoHideShow:function(){ec=!1},ua:q,getFlashPlayerVersion:function(){return{major:q.pv[0],minor:q.pv[1],release:q.pv[2]}},hasFlashPlayerVersion:ib,createSWF:function(a,b,c){if(q.w3)return Gb(a,b,c)},showExpressInstall:function(a,b,c,d){q.w3&&Bb()&&Cb(a,b,c,d)},removeSWF:function(a){q.w3&&cc(a)},createCSS:function(a,b,c,d){q.w3&&dc(a,b,c,d)},addDomLoadEvent:Zb,addLoadEvent:$b,getQueryParamValue:function(a){var b=w.location.search||w.location.hash;if(b){/\?/.test(b)&&(b=b.split("?")[1]); if(null==a)return fc(b);for(var b=b.split("&"),c=0;ca?"0"+a:a}function b(a){e.lastIndex=0;return e.test(a)?'"'+a.replace(e,function(a){var b=h[a];return"string"=== typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function c(a,d){var e,h,j,k,m=f,p,q=d[a];q&&("object"===typeof q&&"function"===typeof q.toJSON)&&(q=q.toJSON(a));"function"===typeof i&&(q=i.call(d,a,q));switch(typeof q){case "string":return b(q);case "number":return isFinite(q)?String(q):"null";case "boolean":case "null":return String(q);case "object":if(!q)return"null";f+=g;p=[];if("[object Array]"===Object.prototype.toString.apply(q)){k=q.length;for(e=0;e>> [validateCallArgs()] Warning: array of objects.");if(1>> [validateCallArgs()] deep recursive call; cancelling; key:", d);continue}e=this.validateCallArgs(e,b+1)}c[d]=e}}return c};qa.prototype.callFlashMethod=function(a,b,c){if(this.isReady())try{c=this.validateCallArgs(c);mc.start();var d=null==c?void 0:ta.stringify(c),e=this.swf.callJsonMethod(a,b,d);return ta.parse(e)}catch(f){k("[FlashChannel.callFlashMethod()] Exception: "+f),k("[] ... oname:",a,"fname:",b,"opts:",c)}else k("[FlashChannel.callFlashMethod()] Called before swf is READY; object:",a,"fname:",b),this.callWhenReady(this.callFlashMethod,arguments,this, this.QUEUE_PRIORITY)};qa.prototype.createFlashObject=function(a,b,c){if(this.isReady()){try{c=this.validateCallArgs(c)}catch(d){k("[FlashChannel.createFlashObject()] Error validating arguments:",d);return}try{this.swf.createObject(a,b,c)||k("[FlashChannel.createFlashObject()] Failed to create: "+a)}catch(e){k("[FlashChannel.createFlashObject()] Exception:",String(e),"oname:",a,"type:",b,"opts:",c)}}else k("[FlashChannel.createFlashObject()] Called before swf is READY; name: "+a+" type: "+b),this.callWhenReady(this.createFlashObject, arguments,this,this.QUEUE_PRIORITY)};qa.prototype.handleFlashEventJson=function(a,b,c){try{var d;null!=c&&(d=ta.parse(c));this.handleFlashEvent(a,b,d)}catch(e){k("[FlashChannel.handleFlashEventJson()] Error parsing json:",c)}};qa.prototype.handleFlashEvent=function(a,b,c){var d=this._newProxyIndex[a];"ready"==b&&"swf"==a?this.startWaiting():this.dispatchEvent(b,c,d)};qa.prototype.handleReadyState=function(){k("%%%% FlashChannel.handleReadyState()");(this.swf=document.getElementById(this.swfId))|| k("[FlashChannel.handleReadyState()] Missing swf; swfId:",this.swfId)};m.useFlashExtensions=function(){Na.hasFlashPlayerVersion("10.0.0")?(k("[map-core-flash.js] useFlashExtensions()"),m.prototype.init=function(){this.initMap();this.initFlashMap();this.mouse&&(this.mouse.addEventListener("mouseover",this.handleMouseOver,this),this.mouse.addEventListener("mouseout",this.handleMouseOut,this))},m.prototype.handleMouseOver=function(){this.callFlashMethod("allowMouseHover",!0)},m.prototype.handleMouseOut= function(){this.callFlashMethod("allowMouseHover",!1)},m.prototype.initFlashMap=function(){k("%%% Map.initFlashMap()");var a=this._opts;a.combineLayers=!1;var b=a.swfUrl||m.swfUrl||"";if(b){var c=isNaN(a.width)?0:a.width,d=isNaN(a.height)?0:a.height;this.div.style.position="relative";var e=new qa(this.divId,c,d,b,"10.0.0");e.enableFlashChannel(this,"hybrid-map");flashOpts={scrollWheelZoom:a.scrollWheelZoom,dragging:a.dragging,doubleClickZoom:a.doubleClickZoom,limitPanning:a.limitPanning};flashOpts.width_pixels= this.getWidthInPixels();flashOpts.height_pixels=this.getHeightInPixels();flashOpts.center=this.getInitialCenterAsLatLng();flashOpts.crs=this.getCRS();b=this.getInitialBounds();flashOpts.width_km=b.width()/1E3;flashOpts.height_km=b.height()/1E3;flashOpts.backgroundColor=a.backgroundColor;flashOpts.zoom_scales=[1,2,4,8];this.createFlashObject("map",flashOpts);e.addEventListener("ready",function(){this.mouse.setMapContainer(e.swf)},this);this.addFlashEventListener("navigate",this.handleMapNavigation); this.addFlashEventListener("zoom",this.handleMapZoom)}else k("[Map for Flash.init()] Missing swf url; opts:",a)},m.prototype.handleMapNavigation=function(){this.dispatchEvent("navigate")},m.prototype.handleMapZoom=function(){this.dispatchEvent("zoom")},m.prototype.display=function(){this.callFlashMethod("display");this.startWaiting()},m.prototype.zoom=function(a){this.callFlashMethod("zoom",a)},m.prototype.zoomToLatLng=function(a,b,c){this.callFlashMethod("zoom",{lat:a,lng:b,zoom:c})},m.prototype.__procMouseData= function(a){if(a.mapWidth&&a.mapHeight){var b=this.getWidthInPixels(),c=this.getHeightInPixels();a.mapX=Math.round(a.mapX*b/a.mapWidth);a.mapY=Math.round(a.mapY*c/a.mapHeight)}this.updateContainerBounds();a.pageX=a.mapX+this._leftPix;a.pageY=a.mapY+this._topPix},m.prototype.getZoom=function(){var a=this.callFlashMethod("getZoom"),b=this.getCRS().baseZoom;b&&(a+=b-1);return a},m.prototype.zoomIn=function(){this.setZoom(this.getZoom()+1)},m.prototype.zoomOut=function(){this.setZoom(this.getZoom()-1)}, m.prototype.setZoom=function(a){var b=this.getCRS().baseZoom;b&&(a-=b-1);this.callFlashMethod("zoom",{zoom:a})},m.prototype.getScale=function(){return this.callFlashMethod("getScale")},m.prototype.getCenterAsLatLng=function(){return this.callFlashMethod("getCenterAsLatLng")},F.prototype.hide=function(){this._hidden=!0;this.callFlashMethod("hide")},F.prototype.show=function(){this._hidden=!1;this.callFlashMethod("show")},F.prototype.initFlashMapLayer=function(){k("[MapLayer.initFlashMapLayer()] this:", this);var a="MapLayer_"+j.getUniqueName();this._map._flashChannel.enableFlashChannel(this,a)},E.prototype.setHoverById=function(a){this.callFlashMethod("setHoverById",a)},E.prototype.getSymbolById=function(a){var b=this.callFlashMethod("getSymbolById",a);if(!b)return k("[SymbolLayer.getSymbolById()] returned invalid object:",b),{};var c=new v;c.setBounds(b.left,b.top,b.right,b.bottom);c.id=a;return c},E.prototype.clearHover=function(){k("[SymbolLayer.clearHover()]");this.callFlashMethod("clearHover")}, E.prototype.initFlashSymbolLayer=function(){this.addFlashEventListener("click",this.handleMouseEvent);this.addFlashEventListener("rollover",this.handleMouseEvent);this.addFlashEventListener("rollout",this.handleMouseEvent);this.addEventListener("click",this.handleClick,this)},E.prototype.handleClick=function(a){var b={hitLayer:this,hitId:a.data.id};p.copyAllParams(b,a.data);this._map.dispatchEvent("click",b)},E.prototype.handleMouseEvent=function(a){var b=a.data;this._map.__procMouseData(b);b.rec= this.getRecordById(a.id).clone()||null;b.id=a.id;this.dispatchEvent(a.type,b)},E.prototype.getFlashOptions=function(){var a=this._opts,b={};b.interactive=!!this._interactive;b.hidden=!!this._hidden;b.hitHelper=a.hitHelper&&a.hitHelper._flashName||"";b.hitPriority=a.hitPriority;return b},S.prototype.init=function(){this.initFlashMapLayer();this.initFlashSymbolLayer();this.waitFor(this._symbols)},S.convertShape=function(a){var b={};b.id=a.id;b.parts=[];for(var a=a.parts,c=0;c> numShapes:",b.length);for(var d=0,e=b.length;dd)d="width"===a?300:150;c===d?(b.style[a]=d+"px",b.getContext("2d")._resize(b.width,b.height)):b[a]=d}}function g(){a.detachEvent(F,g);for(var b in M){var c=M[b],d=c.firstChild,h;for(h in d)"function"==typeof d[h]&&(d[h]=m);for(h in c)"function"==typeof c[h]&&(c[h]=m);d.detachEvent(z,e);c.detachEvent(E,f)}a[q]=m;a[t]=m;a[u]=m;a[v]=m;a[w]=m}function h(a){return(""+a).replace(/&/g,"&").replace(/b)b=300;if(isNaN(c)||0>c)c=150;a.width=b;a.height=c}var m=null,p="canvas",q="CanvasRenderingContext2D",t="CanvasGradient",u="CanvasPattern",v="CanvasSwf",w="G_vmlCanvasManager",z="onfocus",E="onpropertychange",B="onreadystatechange",F="onunload",C;if(!(C=(a[v+"Options"]||{}).swfPath))C=b.getElementsByTagName("script"),C=C[C.length-1],C=(8<=b.documentMode?C.src:C.getAttribute("src",4)).replace(/[^\/]+$/, "");var I=C+"canvas.swf",A=new function(a){for(var b=0,c=a.length;bc||0>f)&&j(1),this._queue.push(A.createRadialGradient,a,b,c,d,e,f),new L(this)},createPattern:function(a,b){a||j(17);var c=a.tagName,d,e=this._canvasId;if(c)if(c=c.toLowerCase(),"img"===c)d=a.getAttribute("src",2);else{if(c===p||"video"===c)return;j(17)}else a.src?d=a.src:j(17);return"repeat"!==b&&"no-repeat"!==b&&"repeat-x"!==b&&"repeat-y"!==b&&""!==b&&b!==m&&j(12),this._queue.push(A.createPattern,h(d),b),!H[e][d]&&G[e]&&(this._executeCommand(),++J[e],H[e][d]=!0),new P(this)},_setLineStyles:function(){var a= this._queue;this._lineWidth!==this.lineWidth&&(this._lineWidth=this.lineWidth,a.push(A.lineWidth,this._lineWidth));this._lineCap!==this.lineCap&&(this._lineCap=this.lineCap,a.push(A.lineCap,this._lineCap));this._lineJoin!==this.lineJoin&&(this._lineJoin=this.lineJoin,a.push(A.lineJoin,this._lineJoin));this._miterLimit!==this.miterLimit&&(this._miterLimit=this.miterLimit,a.push(A.miterLimit,this._miterLimit))},_setShadows:function(){var a=this._queue;this._shadowOffsetX!==this.shadowOffsetX&&(this._shadowOffsetX= this.shadowOffsetX,a.push(A.shadowOffsetX,this._shadowOffsetX));this._shadowOffsetY!==this.shadowOffsetY&&(this._shadowOffsetY=this.shadowOffsetY,a.push(A.shadowOffsetY,this._shadowOffsetY));this._shadowBlur!==this.shadowBlur&&(this._shadowBlur=this.shadowBlur,a.push(A.shadowBlur,this._shadowBlur));this._shadowColor!==this.shadowColor&&(this._shadowColor=this.shadowColor,a.push(A.shadowColor,this._shadowColor))},clearRect:function(a,b,c,d){this._queue.push(A.clearRect,a,b,c,d)},fillRect:function(a, b,c,d){this._setCompositing();this._setShadows();this._setFillStyle();this._queue.push(A.fillRect,a,b,c,d)},strokeRect:function(a,b,c,d){this._setCompositing();this._setShadows();this._setStrokeStyle();this._setLineStyles();this._queue.push(A.strokeRect,a,b,c,d)},beginPath:function(){this._queue.push(A.beginPath)},closePath:function(){this._queue.push(A.closePath)},moveTo:function(a,b){this._queue.push(A.moveTo,a,b)},lineTo:function(a,b){this._queue.push(A.lineTo,a,b)},quadraticCurveTo:function(a, b,c,d){this._queue.push(A.quadraticCurveTo,a,b,c,d)},bezierCurveTo:function(a,b,c,d,e,f){this._queue.push(A.bezierCurveTo,a,b,c,d,e,f)},arcTo:function(a,b,c,d,e){0>e&&isFinite(e)&&j(1);this._queue.push(A.arcTo,a,b,c,d,e)},rect:function(a,b,c,d){this._queue.push(A.rect,a,b,c,d)},arc:function(a,b,c,d,e,f){0>c&&isFinite(c)&&j(1);this._queue.push(A.arc,a,b,c,d,e,f?1:0)},fill:function(){this._setCompositing();this._setShadows();this._setFillStyle();this._queue.push(A.fill)},stroke:function(){this._setCompositing(); this._setShadows();this._setStrokeStyle();this._setLineStyles();this._queue.push(A.stroke)},clip:function(){this._queue.push(A.clip)},isPointInPath:function(){},_setFontStyles:function(){var a=this._queue;if(this._font!==this.font)try{var b=O[this._canvasId];b.style.font=this._font=this.font;var c=b.currentStyle,d=[c.fontStyle,c.fontWeight,b.offsetHeight,c.fontFamily].join(" ");a.push(A.font,d)}catch(e){}this._textAlign!==this.textAlign&&(this._textAlign=this.textAlign,a.push(A.textAlign,this._textAlign)); this._textBaseline!==this.textBaseline&&(this._textBaseline=this.textBaseline,a.push(A.textBaseline,this._textBaseline));this._direction!==this.canvas.currentStyle.direction&&(this._direction=this.canvas.currentStyle.direction,a.push(A.direction,this._direction))},fillText:function(a,b,d,e){this._setCompositing();this._setFillStyle();this._setShadows();this._setFontStyles();this._queue.push(A.fillText,h(a),b,d,e===c?Infinity:e)},strokeText:function(a,b,d,e){this._setCompositing();this._setStrokeStyle(); this._setShadows();this._setFontStyles();this._queue.push(A.strokeText,h(a),b,d,e===c?Infinity:e)},measureText:function(a){var b=O[this._canvasId];try{b.style.font=this.font}catch(c){}return b.innerText=a.replace(/[ \n\f\r]/g,"\t"),new S(b.offsetWidth)},drawImage:function(a,b,c,d,e,f,g,i,k){a||j(17);var l=a.tagName,m,q=arguments.length,r=this._canvasId;if(l)if(l=l.toLowerCase(),"img"===l)m=a.getAttribute("src",2);else{if(l===p||"video"===l)return;j(17)}else a.src?m=a.src:j(17);this._setCompositing(); this._setShadows();m=h(m);if(3===q)this._queue.push(A.drawImage,q,m,b,c);else if(5===q)this._queue.push(A.drawImage,q,m,b,c,d,e);else{if(9!==q)return;(0===d||0===e)&&j(1);this._queue.push(A.drawImage,q,m,b,c,d,e,f,g,i,k)}!H[r][m]&&G[r]&&(this._executeCommand(),++J[r],H[r][m]=!0)},createImageData:function(){},getImageData:function(){},putImageData:function(){},loadImage:function(a,b,c){var d=a.tagName,e,f=this._canvasId;d?"img"===d.toLowerCase()&&(e=a.getAttribute("src",2)):a.src&&(e=a.src);if(e&& !H[f][e]){if(b||c)K[f][e]=[a,b,c];this._queue.push(A.drawImage,1,h(e));G[f]&&(this._executeCommand(),++J[f],H[f][e]=!0)}},_initialize:function(){this.globalAlpha=this._globalAlpha=1;this.globalCompositeOperation=this._globalCompositeOperation="source-over";this.fillStyle=this._fillStyle=this.strokeStyle=this._strokeStyle="#000000";this.lineWidth=this._lineWidth=1;this.lineCap=this._lineCap="butt";this.lineJoin=this._lineJoin="miter";this.miterLimit=this._miterLimit=10;this.shadowBlur=this._shadowBlur= this.shadowOffsetY=this._shadowOffsetY=this.shadowOffsetX=this._shadowOffsetX=0;this.shadowColor=this._shadowColor="rgba(0, 0, 0, 0.0)";this.font=this._font="10px sans-serif";this.textAlign=this._textAlign="start";this.textBaseline=this._textBaseline="alphabetic";this._queue=[];this._stateStack=[]},_flush:function(){var a=this._queue;return this._queue=[],a},_executeCommand:function(){var a=this._flush();if(0'+ a.join("�")+""))},_resize:function(a,b){this._executeCommand();this._initialize();0a||1';M[d]=c;var g=c.firstChild;O[d]=c.lastChild;var h=b.body.contains;if(h(c))g.movie=I;else var j=setInterval(function(){h(c)&&(clearInterval(j),g.movie=I)},0);if("BackCompat"===b.compatMode||!a.XMLHttpRequest)O[d].style.overflow= "hidden";var n=new N(c,g);return c.getContext=function(a){return"2d"===a?n:m},c.toDataURL=function(a,b){return"image/jpeg"===(""+a).replace(/[A-Z]+/g,i)?n._queue.push(A.toDataURL,a,"number"==typeof b?b:""):n._queue.push(A.toDataURL,a),n._executeCommand()},g.attachEvent(z,e),c},saveImage:function(a){a.firstChild.saveImage()},setOptions:function(){},trigger:function(a,b){M[a].fireEvent("on"+b)},unlock:function(a,b,d){var e,g,h;J[a]&&--J[a];if(b===c)e=M[a],b=e.firstChild,k(e),g=e.width,d=e.height,e.style.width= g+"px",e.style.height=d+"px",0Math.abs(b.pageX-a.pageX)+Math.abs(b.pageY-a.pageY)&&500>(new Date).getTime()-b.downTime&&this.dispatchEvent("click",a)};H.prototype.updateContainerBounds=function(a,b,c,d){this._boundsOnPage.setBounds(a,b,c,d)};H.prototype.getStandardMouseData=function(a){var a=this.standardizeMouseEvent(a),b=a.pageX,a=a.pageY,c=this._boundsOnPage;return{pageX:b,pageY:a,mapX:b-c.left,mapY:a-c.bottom,centerX:c.centerX(),centerY:c.centerY(),deltaX:0,deltaY:0,deltaScale:1}}; H.prototype.getCurrentMouseData=function(){var a={};this._moveData&&p.copyAllParams(a,this._moveData);return a};H.prototype.pageX=function(){return this._moveData.pageX};H.prototype.pageY=function(){return this._moveData.pageY};H.prototype.standardizeMouseEvent=function(a){if(a&&void 0!==a.pageX)return a;a=a||window.event;return{pageX:a.pageX||a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,pageY:a.pageY||a.clientY+document.body.scrollTop+document.documentElement.scrollTop}}; H.prototype.throttledMouseMove=function(a){var b=(new Date).getTime();if(40> style:",b)};Y.prototype.setDateRange=function(){};Y.prototype.initYAxis=function(a){this._yAxis=a};Y.prototype.initXAxis=function(a){this._xAxis=a};Y.prototype.addIcon=function(){};Y.prototype.__initBounds=function(){};Y.prototype.__getDataBounds=function(){};Y.prototype.__initYAxis=function(){var a,b,c=this._yAxis;if(!c)return k("[TimeSeriesChart] need to call initYAxis() before draw()"), !1;void 0!=c.minY&&(a=c.minY);void 0!=c.maxY&&(b=c.maxY);(void 0==b||void 0==a)&&this.__getDataBounds();return!0};Y.prototype.draw=function(){this.__initYAxis()};p.extendNamespace("nytg",{Map:m,Utils:j,trace:k,Browser:i,Opts:p,DataTable:u,HashBang:{getRawString:function(){var a=i.getPageUrl();return(a=/(.*)(?:#!([^?]*))(\?.+)?/.exec(a))&&a[2]||""}},ScriptLoader:Sb,TextUtils:zb,GeoPoint:la,ShapeData:ea,GoogleMapStyle:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit.station", elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"all",elementType:"all",stylers:[{lightness:33},{gamma:0.8},{saturation:-61}]},{featureType:"road.local",elementType:"geometry",stylers:[{saturation:-73},{lightness:33},{gamma:0.8},{visibility:"simplified"}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{saturation:-91},{gamma:0.8},{visibility:"simplified"},{lightness:100}]},{featureType:"road.arterial",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.highway", elementType:"geometry",stylers:[{visibility:"simplified"},{saturation:-91},{gamma:0.8},{lightness:94}]},{featureType:"road.highway",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"landscape.man_made",elementType:"geometry",stylers:[{visibility:"simplified"},{gamma:0.76}]}],Waiter:N,BaseLayer:X,TileLayer:ja,IconLayer:ya,HTMLPopup:M,GoogleCRS:Pb,BasemapLayer:bb,El:K,ZoomControl:Tb,DateString:U,ShapeLayer:S,DataStyler:R,C:t,VertexSet:P,ShapeVector:L,TimeSeriesChart:Y,Hurricanes:z})})(); /******************************** ** FILE: hurricane-tracker.js ********************************/ (function() { var $ = jQuery; var n = nytg; // namespace var Utils = n.Utils, Opts = n.Opts, Browser = n.Browser, trace = n.trace, El = n.El, Hurricanes = n.Hurricanes; if (Browser.canvas) { } else { El('nytg-map-controls-container').css("display:none"); } var initYear; var initStormName; var initStormRec; var ZOOM0 = 5; //var LAT0 = 36.0; //var LON0 = -61.8; // kludgy location for isaac var LAT0 = 41.7 var LON0 = -95 // kludgy location for sandy LAT0 = 38; LON0 = -75; var STORM_ID = "2012_18"; // sandy is 18 // isaac is 2012_9 var useLocalhost = false; var LOCAL_JS = "http://localhost/nytweb/2012_hurricanes/js/"; var REMOTE_JS = "http://graphics8.nytimes.com/packages/js/newsgraphics/projects/hurricanes_2012/sandy/"; var REMOTE_STATIC_JS = "http://graphics8.nytimes.com/packages/js/newsgraphics/projects/hurricanes_2012/"; var JS_HOME = useLocalhost ? LOCAL_JS : REMOTE_JS; var JS_STATIC_HOME = useLocalhost ? LOCAL_JS : REMOTE_STATIC_JS; var TRACK_DATA_URL = JS_HOME + "hurricane_tracks.js"; var IMAGE_DATA_URL = JS_HOME + "images.js"; var TILE_URL = "http://graphics8.nytimes.com/packages/images/newsgraphics/projects/hurricanes_2012/tiles/"; var HURRICANE_ICON_URL = "http://graphics8.nytimes.com/packages/images/newsgraphics/projects/hurricanes_2012/hurricane-icon-30.png"; "http://localhost:4567http://graphics8.nytimes.com/packages/images/newsgraphics/2012/0820-hurricane-map/hurricane-icon-30.png"; var RADAR_LOG_URL = REMOTE_JS + "tile_url.js"; var SHOW_RADAR = false; var trackData; // = new n.DataTable(nytg.data.hurricane_log); var imageData; // var updateData = new DataTable(nytg.data.hurricane_update); init(); function init() { var w = new n.Waiter(); var trackLoader = new n.ScriptLoader(TRACK_DATA_URL); var imageLoader = new n.ScriptLoader(IMAGE_DATA_URL); w.waitFor(trackLoader).waitFor(imageLoader).on('ready', initMap, this) if (Browser.canvas) { var countryLoader = new n.ScriptLoader(JS_STATIC_HOME + "countries_web.js", "utf-16be"); w.waitFor(countryLoader); if (SHOW_RADAR) { w.waitFor( new n.ScriptLoader(RADAR_LOG_URL) ); } } w.startWaiting(); } function initChart(pointTable) { // filter out other storms pointTable = pointTable.filter(function(rec) {return rec.get('NOAA_ID') == STORM_ID}); var el = El("nytg-hurricane-chart-container"); trace(el.node()) var chart = new n.TimeSeriesChart(el.node(), {width:300, height: 90}); var timestamps = pointTable.getFieldData(Hurricanes.OBS_TIME); var intensities = pointTable.getFieldData(Hurricanes.OBS_INTENSITY); var times = Utils.map(timestamps, function(ts) {return Hurricanes.TIMESTAMP_PARSER.parseDate(ts).getTime()}); var windspeeds = Utils.map(intensities, function(knots) {return Hurricanes.convKnotsToMilesPerHour(knots)}); var pathVec = new n.VertexSet(times, windspeeds); var pathData = Utils.partitionVertexSet(pathVec, windspeeds, Hurricanes.WINDSPEED_BREAKS); //trace("pathData:", pathData); // get style data var defaultStyle = {strokeWeight: 2, strokeAlpha: 1, strokeColor: 0}; Utils.forEach(pathData.paths, function(vec, i) { var shp = new n.ShapeVector(i, vec); var col = Hurricanes.COLORS[pathData.classes[i]]; var style = {strokeColor: col}; Opts.copyNewParams(style, defaultStyle); chart.addLineShape(shp, style); }); var labelFmt = function(val) {return val + " mph";}; chart.initYAxis({rules: Hurricanes.WINDSPEED_BREAKS, label:labelFmt, labelAlign:"right", ruleColor:"#ccc", ruleStyle:"dashed", baselineColor:"#ccc"}); //chart.addLine({table:pointTable, fieldX:'obsDate', fieldY:'obsWindspeed'}); chart.draw(); /* */ } function initMap() { trackData = new n.DataTable(nytg.data.hurricane_tracks); imageData = new n.DataTable(nytg.data.images); /* trace(">>> initMap() NOAA IDS:", trackData.getFieldData('NOAA_ID')); trace(">>> initMap() NOAA NAMES:", trackData.getFieldData('NAME')) trace(STORM_ID) trace(">>> rec:", trackData.getMatchingRecord('NOAA_ID', STORM_ID)); */ function getPopupHTML(rec) { var intensity = rec.get(Hurricanes.OBS_INTENSITY); var classId = rec.get(Hurricanes.OBS_CLASS); var stormType = Hurricanes.getStormLabel(classId); var mph = Hurricanes.convKnotsToMilesPerHour(intensity); var timestamp = rec.get(Hurricanes.OBS_TIME); var isForecast = rec.get(Hurricanes.OBS_FORECAST) == 1; var forceLabel = isForecast ? "Forecast:" : "Max. winds:"; var stormId = rec.get(Hurricanes.NOAA_ID); var name = trackData.getIndexedRecord(stormId).get('NAME'); var obsDate = Utils.parseDate(timestamp, "%Y%m%d%H"); obsDate = Utils.addHours(obsDate, -4); var dateStr = Utils.formatDate(obsDate, "%b %d, %I:%M %p ET"); var template = '
'; var html = Utils.format(template, name, dateStr, forceLabel, mph, stormType); return html; } function getForecastConePopupHTML(rec) { var template = '
Area of uncertainty for the five-day forecast.
'; var html = Utils.format(template, currentStormRec.get('NAME')); return html; } trackData.insertMappedValues('VISIBLE', 'integer', function(rec) {return rec.get('NOAA_ID') == STORM_ID ? 1 : 0;}); //trackData = trackData.getFilteredCopy(function(rec) {return rec.get('VISIBLE') == 1; } ); Hurricanes.importTrackTable(trackData); //trace(">>> matching rec:", trackData.getMatchingRecord('NOAA_ID', STORM_ID)) trackData.indexOnField('NOAA_ID'); currentStormRec = trackData.getIndexedRecord(STORM_ID).clone(); var stormIsActive = currentStormRec.get('ACTIVE') == 1; var currentLocationInfo = Hurricanes.getCurrentLocation(currentStormRec); // CENTER MAP ON STORM query var "centered" is set if (Browser.getQueryVars()['centered'] != undefined) { LAT0 = currentLocationInfo.lat; LON0 = currentLocationInfo.lng; } // init image maps var imageNames = imageData.getFieldData('TIMESTAMP'); Utils.sortOn(imageNames, 'TIMESTAMP', true); var mapTypes = Hurricanes.getImageMapTypes(imageNames, TILE_URL); trace("imageNames:", imageNames); var mapOpts = { googleBackgroundColor: "none", crs: new n.GoogleCRS(), limitPanning: false, dragging: true, doubleClickZoom: true, //googleMapTypes: mapTypes, //googleMapStyle: Hurricanes.GOOGLE_MAP_STYLE, center: new n.GeoPoint(LAT0, LON0), zoom: ZOOM0, maxZoom: ZOOM0 + 2, minZoom: ZOOM0 - 1 }; var preferFlash = false; var flashUrl = "http://graphics8.nytimes.com/packages/flash/newsgraphics/projects/hurricanes_2012/hybrid_map_02.swf"; // "http://localhost.nytimes.com/~199000/swf/hybrid_map_02.swf?c=2" n.Map.init({preferFlash:preferFlash, flashUrl:flashUrl}); var map2 = new n.Map('nytg-map-container', mapOpts); var popup = new n.HTMLPopup(getPopupHTML, {map:map2}); map2.addLayer(new n.BasemapLayer({style:Hurricanes.GOOGLE_MAP_STYLE})); Browser.canvas && addCountryLayer(map2); var baseLayer = new n.BaseLayer(); baseLayer.addView('base-layer', {type:n.BaseLayer.STYLED_TYPE, style:Hurricanes.GOOGLE_MAP_STYLE, backgroundColor:"#fff"}); map2.addLayer(baseLayer); //baseLayer.setView('base-layer'); Hurricanes.configureImageViews(baseLayer, imageNames, TILE_URL); var idx = imageNames.length -1; var imageView = imageNames[idx]; var mapView = 'base-layer'; baseLayer.setView(mapView); if (stormIsActive && nytg.data.radar_tile_url) { var radarLyr = new n.TileLayer({type: n.TileLayer.IMAGE_TYPE, template: nytg.data.radar_tile_url + "{z}-{x}-{y}.png", opacity:0.45}); radarLyr.hide(); map2.addLayer(radarLyr); } else { $("#nytg-map-controls-container .radar-toggle").hide(); } $("#nytg-map-controls-container").css({display:"block"}); var layers = Hurricanes.getTrackLayers(trackData); var trackLyr = layers.trackLayer; map2.addLayer(trackLyr); var trackPointLyr = layers.trackPointLayer; map2.addLayer(trackPointLyr); // icon layer if (stormIsActive) { var ll = Hurricanes.getCurrentLocation(trackData.getIndexedRecord(STORM_ID)); var icon = {url:HURRICANE_ICON_URL, lat:ll.lat, lng:ll.lng, height:30, width:30}; var imageLyr = new n.IconLayer([icon]); map2.addLayer(imageLyr); } popup.setLayer(trackPointLyr); map2.display(); // create chart //initChart(layers.pointTable); var zoomer = new n.ZoomControl(map2, {size:3, ticSpacing:12}); zoomer.id('nytg-zoom-control'); zoomer.appendTo(map2.div); function switchView(evt) { trace(evt.currentIndex); var idx = evt.currentIndex; var view = idx == 1 ? imageView : mapView; baseLayer.setView(view); if (view == mapView) { countryLyr.hide(); } else { countryLyr.show(); //countryLyr.refresh(); } trace("switchView() idx:", idx, 'radarLyr:', radarLyr); if (radarLyr) { if (idx == 2) { radarLyr.show() } else { radarLyr.hide(); } } } Opts.exportObject("nytg.switchView", switchView); // update readout //var currRec = trackData.getIndexedRecord(STORM_ID); var info = currentLocationInfo; // Hurricanes.getCurrentLocation(currRec); if (info.classId !== undefined) { var name = info.name; if (info.classId <= 1) { // tropical storm force var stormDisplay = $("#nytg-storm-force-data"); stormDisplay.find('.nytg-wind-speed-ts').text(Utils.format("%d", info.mph)); stormDisplay.find('.nytg-category-ts').text(info.stormLabel); } else { name = "Hurricane " + name; stormDisplay = $('#nytg-hurricane-force-data'); stormDisplay.find('.nytg-wind-speed').text(Utils.format("%d", info.mph)); stormDisplay.find('.nytg-category-number').text(info.hurricaneCategory); } stormDisplay.css({display:'block'}); $("#nytg-hurricane-strip > .nytg-hurricane-update-timestamp").text( n.DateString.formatDate(info.date, "Updated %I %p ET %b %d")); $("#nytg-hurricane-strip > .nytg-hurricane-name").text(name); $("#nytg-hurricane-strip").css({visibility:"visible"}); } stormIsActive && addForecastConeLayer(currentStormRec, map2); //var shapes = trackLyr._shapes; //trace("shapes:", shapes.getBounds()); //var symbols = trackLyr._symbols; //trace("symbols:", symbols); //trace("[] map ready?", map2.isReady(), "shapes ready?:", shapes.isReady(), "boundss:", shapes.getBounds()); // map2.addLayer(new CanvasTestLayer()); var countryLyr; function addCountryLayer(map) { var countryLines = new n.ShapeData(n.C.POLYGONS); countryLines.importFromString(nytg.data.countries_web); countryLyr = new n.ShapeLayer(countryLines); countryLyr.setStyle({strokeWeight:1, strokeColor: "#FCEBC5", strokeAlpha:1}); countryLyr.hide(); map.addLayer(countryLyr); } function addForecastConeLayer(rec, map) { var name = rec.get('FORECAST_CONE'); if (!name) { trace(rec); } var url = JS_HOME + name + ".js"; var loader = new n.ScriptLoader(url, 'utf-16be').on('ready', function() { var utf16Str = nytg.data[name]; var shapes = new n.ShapeData(); shapes.importFromString(utf16Str, {transform: Hurricanes.projection}); var lyr = new n.ShapeLayer(shapes, {hitPriority: -1}); var table = new n.DataTable({schema:{days:'integer'}, data:{days:[3, 5]}}); var styler = new n.DataStyler(table); var style = { fillAlpha: 0.2, fillColor: 0xff7777, strokeColor:0, strokeWeight:1, strokeAlpha: 0.3, hoverStrokeAlpha: 1 }; styler.setDefaultStyle(style); //lyr.setStyle(style); styler.setAttributeStyler('hidden', function(rec) {return rec.get('days') == 3;}); lyr.setStyler(styler); lyr.setInteraction(true); lyr.on('rollover', function(evt) { var html = getForecastConePopupHTML(rec); popup.showHTML(html)}); lyr.on('rollout', function(){ popup.hide()}); map.addLayer(lyr); }); } // addForecastConeLyr(); } })();
Anda sedang membaca artikel tentang
Latest Storm Updates
Dengan url
http://homepageglobal.blogspot.com/2012/10/latest-storm-updates.html?m=0
Anda boleh menyebar luaskannya atau mengcopy paste-nya
Latest Storm Updates
namun jangan lupa untuk meletakkan link
sebagai sumbernya
0 komentar:
Posting Komentar