(function(e){functionr(e,t){if(!t.steps)thrownewError("steps option missing");this.options=t,this.running=!1,this._tick=this._tick.bind(this),this._t0=+(newDate),this.callback=e,this._time=0,_.defaults(this.options,{animationDelay:0,maxDelta:.2,loop:!0}),this.rescale()}e.torque=e.torque||{};vart=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,16)},n=window.requestAnimationFrame||window.mozCancelAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(e){cancelTimeout(e)};r.prototype={start:function(){this.running=!0,t(this._tick)},isRunning:function(){returnthis.running},stop:function(){this.pause(),this.time(0)},time:function(e){if(!arguments.length)returnthis._time;this._time=e;vart=this.range(this.domain(this._time));this.callback(t)},toggle:function(){this.running?this.pause():this.start()},rescale:function(){returnthis.domainInv=torque.math.linear(this.options.animationDelay,this.options.animationDelay+this.options.animationDuration),this.domain=this.domainInv.invert(),this.range=torque.math.linear(0,this.options.steps),this.rangeInv=this.range.invert(),this.time(this._time),this},duration:function(e){returnarguments.length?(this.options.animationDuration=e,this.time()>e&&this.time(0),this.rescale(),this):this.options.animationDuration},steps:function(e){returnthis.options.steps=e,this.rescale()},step:function(e){if(arguments.length===0)returnthis.range(this.domain(this._time));this._time=this.domainInv(this.rangeInv(e))},pause:function(){this.running=!1,n(this._tick)},_tick:function(){vare=+(newDate),n=(e-this._t0)*.001;n=Math.min(this.options.maxDelta,n),this._t0=e,this._time+=n,this.time(this._time),this.step()>=this.options.steps&&(this._time=0),this.running&&t(this._tick)}},e.torque.Animator=r})(typeofexports=="undefined"?this:exports),function(e){e.torque=e.torque||{};vart={version:"1.0.0",style:{"comp-op":{css:"comp-op","default-value":"src-over","default-meaning":"add the current layer on top of other layers",doc:"Composite operation. This defines how this layer should behave relative to layers atop or below it.",type:["src","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","darken","lighten"]}},symbolizers:{"*":{"comp-op":{css:"comp-op","default-value":"src-over","default-meaning":"add the current layer on top of other layers",doc:"Composite operation. This defines how this layer should behave relative to layers atop or below it.",type:["src","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","darken","lighten"]},opacity:{css:"opacity",type:"float",doc:"An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)","default-value":1,"default-meaning":"no separate buffer will be used and no alpha will be applied to the style after rendering"}},trail:{steps:{css:"trail-steps",type:"float","default-value":1,"default-meaning":"no trail steps",doc:"How many steps of trails are going to be rendered"}},polygon:{fill:{css:"polygon-fill",type:"color","default-value":"rgba(128,128,128,1)","default-meaning":"gray and fully opaque (alpha = 1), same as rgb(128,128,128)",doc:"Fill color to assign to a polygon"},"fill-opacity":{css:"polygon-opacity",type:"float",doc:"The opacity of the polygon","default-value":1,"default-meaning":"opaque"}},line:{stroke:{css:"line-color","default-value":"rgba(0,0,0,1)",type:"color","default-meaning":"black and fully opaque (alpha = 1), same as rgb(0,0,0)",doc:"The color of a drawn line"},"stroke-width":{css:"line-width","default-value":1,type:"float",doc:"The width of a line in pixels"},"stroke-opacity":{css:"line-opacity","default-value":1,type:"float","default-meaning":"opaque",doc:"The opacity of a line"},"stroke-linejoin":{css:"line-join","default-value":"miter",type:["miter","round","bevel"],doc:"The behavior of lines when joining"},"stroke-linecap":{css:"line-cap","default-value"
.redraw_tile=function(e){this.render(e,e.coord,e.zoom)},CanvasTileLayer.prototype.redraw=function(){for(vareinthis.tiles){vart=this.tiles[e];this.render(t,t.coord,t.zoom)}},CanvasTileLayer.prototype.getTile=function(e,t,n){returnthis.create_tile_canvas(e,t,n)},CanvasTileLayer.prototype.releaseTile=function(e){vart=e.getAttribute("id");deletethis.tiles[t]}}(function(e){functiont(){}if(typeofgoogle=="undefined"||typeofgoogle.maps=="undefined")return;t.prototype={_initTileLoader:function(e,t){this._map=e,this._projection=t,this._tiles={},this._tilesToLoad=0,this._updateTiles=this._updateTiles.bind(this),this._listeners=[],this._listeners.push(google.maps.event.addListener(this._map,"dragend",this._updateTiles),google.maps.event.addListener(this._map,"zoom_changed",this._updateTiles)),this.tileSize=256,this._updateTiles()},_removeTileLoader:function(){for(vareinthis._listeners)google.maps.event.removeListener(this._listeners[e]);this._removeTiles()},_removeTiles:function(){for(vareinthis._tiles)this._removeTile(e)},_reloadTiles:function(){this._removeTiles(),this._updateTiles()},_updateTiles:function(){if(!this._map)return;vare=this._map.getBounds(),t=this._map.getZoom(),n=this.tileSize,r=1<<t,i=newgoogle.maps.LatLng(e.getNorthEast().lat(),e.getSouthWest().lng()),s=newgoogle.maps.LatLng(e.getSouthWest().lat(),e.getNorthEast().lng());this._projection=this._map.getProjection();varo=this._projection.fromLatLngToPoint(i),u=this._projection.fromLatLngToPoint(s),a=newgoogle.maps.Point(Math.floor(o.x*r/n),Math.floor(o.y*r/n)),f=newgoogle.maps.Point(Math.floor(u.x*r/n),Math.floor(u.y*r/n));this._addTilesFromCenterOut(a,f),this._removeOtherTiles(a,f)},_removeOtherTiles:function(e,t){varn,r,i,s,o=this._map.getZoom();for(sinthis._tiles)this._tiles.hasOwnProperty(s)&&(n=s.split(":"),r=parseInt(n[0],10),i=parseInt(n[1],10),z=parseInt(n[2],10),(z!==o||r<e.x||r>t.x||i<e.y||i>t.y)&&this._removeTile(s))},_removeTile:function(e){this.onTileRemoved&&this.onTileRemoved(this._tiles[e]),deletethis._tiles[e]},_tileShouldBeLoaded:function(e){return!(e.x+":"+e.y+":"+e.zoominthis._tiles)},_tileLoaded:function(e,t){this._tilesToLoad--,this._tiles[e.x+":"+e.y+":"+e.zoom]=t,this._tilesToLoad===0&&this.onTilesLoaded&&this.onTilesLoaded()},getTilePos:function(e){vart=1<<this._map.getZoom();e={x:(e.x%t+t)%t,y:e.y},e=newgoogle.maps.Point(e.x*this.tileSize,e.y*this.tileSize);varn=this._map.getBounds(),r=newgoogle.maps.LatLng(n.getNorthEast().lat(),n.getSouthWest().lng()),i=this._map.getProjection().fromLatLngToPoint(r);returnzoom=1<<this._map.getZoom(),i.x=i.x*zoom,i.y=i.y*zoom,newgoogle.maps.Point(e.x-i.x,e.y-i.y)},_addTilesFromCenterOut:function(e,t){functionf(e){vart=e.x-r.x,n=e.y-r.y;returnt*t+n*n}varn=[],r=newgoogle.maps.Point((e.x+t.x)*.5,(e.y+t.y)*.5),i=this._map.getZoom(),s,o,u;for(s=e.y;s<=t.y;s++)for(o=e.x;o<=t.x;o++)u=newgoogle.maps.Point(o,s),u.zoom=i,this._tileShouldBeLoaded(u)&&n.push(u);vara=n.length;if(a===0)return;n.sort(function(e,t){returnf(e)-f(t)}),this._tilesToLoad+=a;if(this.onTileAdded)for(o=0;o<a;o++)this.onTileAdded(n[o])}},torque.GMapsTileLoader=t})(typeofexports=="undefined"?this:exports),function(e){functiont(e){vart=this;if(!torque.isBrowserSupported())thrownewError("browser is not supported by torque");this.key=0,this.cartocss=null,this.ready=!1,this.options=_.extend({},e),_.defaults(this.options,{provider:"sql_api",renderer:"point",resolution:2,steps:100,visible:!0}),this.animator=newtorque.Animator(function(e){varn=e|0;t.key!==n&&t.setKey(n)},this.options),this.play=this.animator.start.bind(this.animator),this.stop=this.animator.stop.bind(this.animator),this.pause=this.animator.pause.bind(this.animator),this.toggle=this.animator.toggle.bind(this.animator),this.setDuration=this.animator.duration.bind(this.animator),this.isRunning=this.animator.isRunning.bind(this.animator),CanvasLayer.call(this,{map:this.options.map,animate:!1,updateHandler:this.render,readyHandler:this.initialize})}functionn(e){this.options=_.extend({},e),CanvasTileLayer.call(this,this._loadTile.bind(this),th