-
Notifications
You must be signed in to change notification settings - Fork 5
/
jquery.geo-1.0.0-b1.5.min.js
4 lines (4 loc) · 92.7 KB
/
jquery.geo-1.0.0-b1.5.min.js
1
2
3
4
/*! jQuery Geo - v1.0.0-b1.5 - 2013-01-17
* http://jquerygeo.com
* Copyright (c) 2013 Ryan Westphal/Applied Geographics, Inc.; Licensed MIT, GPL */
document.createElement("canvas").getContext||function(){function f(){return this.context_||(this.context_=new P(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function T(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function N(e){return parseFloat(e)/100}function C(e,t,n){return Math.min(n,Math.max(t,e))}function k(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=C(N(e[1]),0,1),o=C(N(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=L(a,u,i+1/3),n=L(a,u,i),r=L(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function L(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function O(e){if(e in A)return A[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=T(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(N(r[s])*255):i=+r[s],t+=y[C(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=T(e);t=k(r),n=r[3]}else t=e;return A[e]={color:t,alpha:n}}function D(e){return _[e]||"square"}function P(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function B(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function j(e,t){var n=O(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("<g_vml_:stroke",' opacity="',i,'"',' joinstyle="',e.lineJoin,'"',' miterlimit="',e.miterLimit,'"',' endcap="',D(e.lineCap),'"',' weight="',s,'px"',' color="',r,'" />')}function F(e,t,n,r){var i=e.fillStyle,s=e.arcScaleX_,o=e.arcScaleY_,u=r.x-n.x,a=r.y-n.y,f=O(e.fillStyle),l=f.color,c=f.alpha*e.globalAlpha;t.push('<g_vml_:fill color="',l,'" opacity="',c,'" />')}function I(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function q(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function R(e,t,n){if(!q(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function U(e){throw new z(e)}function z(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n<t.length;n++)this.initElement(t[n])},initElement:function(e){if(!e.getContext){e.getContext=f,d(e.ownerDocument),e.innerHTML="",e.attachEvent("onpropertychange",m),e.attachEvent("onresize",g);var t=e.attributes;t.width&&t.width.specified?e.style.width=t.width.nodeValue+"px":e.width=e.clientWidth,t.height&&t.height.specified?e.style.height=t.height.nodeValue+"px":e.height=e.clientHeight}return e}};v.init();var y=[];for(var b=0;b<16;b++)for(var w=0;w<16;w++)y[b*16+w]=b.toString(16)+w.toString(16);var A={},M={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"},_={butt:"flat",round:"round"},H=P.prototype;H.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null),this.element_.innerHTML=""},H.beginPath=function(){this.currentPath_=[]},H.moveTo=function(e,t){var n=I(this,e,t);this.currentPath_.push({type:"moveTo",x:n.x,y:n.y}),this.currentX_=n.x,this.currentY_=n.y},H.lineTo=function(e,t){var n=I(this,e,t);this.currentPath_.push({type:"lineTo",x:n.x,y:n.y}),this.currentX_=n.x,this.currentY_=n.y},H.bezierCurveTo=function(e,t,n,r,i,s){var o=I(this,i,s),u=I(this,e,t),a=I(this,n,r);B(this,u,a,o)},H.quadraticCurveTo=function(e,t,n,r){var i=I(this,e,t),s=I(this,n,r),o={x:this.currentX_+2/3*(i.x-this.currentX_),y:this.currentY_+2/3*(i.y-this.currentY_)},u={x:o.x+(s.x-this.currentX_)/3,y:o.y+(s.y-this.currentY_)/3};B(this,o,u,s)},H.arc=function(e,t,i,s,a,f){i*=o;var l=f?"at":"wa",c=e+r(s)*i-u,h=t+n(s)*i-u,p=e+r(a)*i-u,d=t+n(a)*i-u;c==p&&!f&&(c+=.125);var v=I(this,e,t),m=I(this,c,h),g=I(this,p,d);this.currentPath_.push({type:l,x:v.x,y:v.y,radius:i,xStart:m.x,yStart:m.y,xEnd:g.x,yEnd:g.y})},H.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("<g_vml_:shape",' filled="',!!e,'"',' style="position:absolute;width:',i,"px;height:",s,'px;"',' coordorigin="0,0"',' coordsize="',o*i,",",o*s,'"',' stroked="',!e,'"',' path="');var u=!1,a={x:null,y:null},f={x:null,y:null};for(var l=0;l<this.currentPath_.length;l++){var c=this.currentPath_[l],h;switch(c.type){case"moveTo":h=c,n.push(" m ",t(c.x),",",t(c.y));break;case"lineTo":n.push(" l ",t(c.x),",",t(c.y));break;case"close":n.push(" x "),c=null;break;case"bezierCurveTo":n.push(" c ",t(c.cp1x),",",t(c.cp1y),",",t(c.cp2x),",",t(c.cp2y),",",t(c.x),",",t(c.y));break;case"at":case"wa":n.push(" ",c.type," ",t(c.x-this.arcScaleX_*c.radius),",",t(c.y-this.arcScaleY_*c.radius)," ",t(c.x+this.arcScaleX_*c.radius),",",t(c.y+this.arcScaleY_*c.radius)," ",t(c.xStart),",",t(c.yStart)," ",t(c.xEnd),",",t(c.yEnd))}if(c){if(a.x==null||c.x<a.x)a.x=c.x;if(f.x==null||c.x>f.x)f.x=c.x;if(a.y==null||c.y<a.y)a.y=c.y;if(f.y==null||c.y>f.y)f.y=c.y}}n.push(' ">'),e?F(this,n,a,f):j(this,n),n.push("</g_vml_:shape>"),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},H.fill=function(){this.stroke(!0)},H.closePath=function(){this.currentPath_.push({type:"close"})},H.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},H.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},H.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];R(this,S(n,this.m_),!1)},H.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];R(this,S(n,this.m_),!0)};var W=z.prototype=new Error;W.INDEX_SIZE_ERR=1,W.DOMSTRING_SIZE_ERR=2,W.HIERARCHY_REQUEST_ERR=3,W.WRONG_DOCUMENT_ERR=4,W.INVALID_CHARACTER_ERR=5,W.NO_DATA_ALLOWED_ERR=6,W.NO_MODIFICATION_ALLOWED_ERR=7,W.NOT_FOUND_ERR=8,W.NOT_SUPPORTED_ERR=9,W.INUSE_ATTRIBUTE_ERR=10,W.INVALID_STATE_ERR=11,W.SYNTAX_ERR=12,W.INVALID_MODIFICATION_ERR=13,W.NAMESPACE_ERR=14,W.INVALID_ACCESS_ERR=15,W.VALIDATION_ERR=16,W.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=P,DOMException=z}(),this.jsviews||this.jQuery&&jQuery.views||function(e,t){function C(e,t){var n="\\"+e.charAt(0),r="\\"+e.charAt(1),o="\\"+t.charAt(0),u="\\"+t.charAt(1);return N.rTag=i=r+"(?:(?:(\\w+(?=[\\/\\s"+o+"]))|(?:(\\w+)?(:)|(>)|(\\*)))"+"\\s*((?:[^"+o+"]|"+o+"(?!"+u+"))*?)"+"(\\/)?|(?:\\/(\\w+)))"+o,i=new RegExp(n+i+u,"g"),s=new RegExp("<.*>|"+e+".*"+t),this}function k(e){var n=this,r=n.tmpl.helpers||{};return e=(n.ctx[e]!==t?n.ctx:r[e]!==t?r:P[e]!==t?P:{})[e],typeof e!="function"?e:function(){return e.apply(n,arguments)}}function L(e,t,n){var r=t.tmpl.converters;return e=r&&r[e]||H[e],e?e.call(t,n):n}function A(e,n,r,i,s){s.props=s.props||{};var u,a=s.props.tmpl,l=n.tmpl.tags,c=n.tmpl.templates,h=arguments,p=l&&l[e]||D[e];return p?(i=i&&n.tmpl.tmpls[i-1],a=a||i||t,s.tmpl=""+a===a?c&&c[a]||_[a]||_(a):a,s.isTag=f,s.converter=r,s.view=n,s.renderContent=B,n.ctx&&o(s.ctx,n.ctx),u=p.apply(s,h.length>5?x.call(h,5):[]),u||(u==t?"":u.toString())):""}function O(e,n,i,s,o,u){var a=i.views,f={tmpl:o,path:n,parent:i,data:s,ctx:e,views:r.isArray(s)?[]:{},hlp:k};return r.isArray(a)?a.splice(f.index=u!==t?u:a.length,0,f):a[f.index="_"+g++]=f,f}function M(e,n,r,i,s){var o,a;if(r&&typeof r=="object"&&!r.nodeType){for(o in r)n(o,r[o]);return e}if(!r||i===t)s&&(i=s(t,i||r));else if(""+r===r)if(i===null)delete n[r];else if(i=s?s(r,i):i)n[r]=i;return(a=u.onStoreItem)&&a(n,r,i,s),i}function _(e,t){return M(this,_,e,t,q)}function D(e,t){return M(this,D,e,t)}function P(e,t){return M(this,P,e,t)}function H(e,t){return M(this,H,e,t)}function B(e,n,i,s,l){var c,h,p,d,v,m,g,y,b,w,E={},S=l===f,x=this,T="";x.isTag?(b=x.tmpl,n=n||x.ctx,i=i||x.view,s=s||x.path,l=l||x.index,E=x.props):b=x.jquery&&x[0]||x,i=i||N.topView,y=i.ctx,w=b.layout,e===i&&(e=i.data,w=f),n=n&&n===y?y:y?(y=o({},y),n)?o(y,n):y:n||{},E.link===a&&(n.link=a),b.fn||(b=_[b]||_(b)),v=n.link&&u.onRenderItem,m=n.link&&u.onRenderItems;if(b){if(r.isArray(e)&&!w){d=S?i:l!==t&&i||O(n,s,i,e,b,l);for(c=0,h=e.length;c<h;c++)p=e[c],g=b.fn(p,O(n,s,d,p,b,(l||0)+c),N),T+=v?v(g,E):g}else d=S?i:O(n,s,i,e,b,l),T+=e||w?b.fn(e,d,N):"";return i.topKey=d.index,m?m(T,s,d.index,b,E):T}return""}function j(){throw"Syntax error"}function F(e,t,n){function P(t){t-=A,t&&M.push(e.substr(A,t).replace(p,"\\n"))}function H(t,i,s,o,u,a,l,c,h,p){u&&(o=":",s="html");var v="",g="",y=!c&&!o;i=i||o,P(p),A=p+t.length,a?N&&M.push(["*",l.replace(d,"$1")]):i?(i==="else"&&(_[5]=e.substring(_[5],p),_=O.pop(),M=_[3],y=f),l=l?I(l,n).replace(m,function(e,t,n){return t?g+=n+",":v+=n+",",""}):"",v=v.slice(0,-1),l=l.slice(0,-1),r=[i,s||"",l,y&&[],"{"+(v?"props:{"+v+"},":"")+"path:'"+l+"'"+(g?",ctx:{"+g.slice(0,-1)+"}":"")+"}"],y&&(O.push(_),_=r,_[5]=A),M.push(r)):h&&(_[5]=e.substring(_[5],p),_=O.pop());if(!_)throw"Expected block tag";M=_[3]}var r,s,o,u,a,l,c,h,g,y,b,w,S,x,T,N,C=t?{allowCode:N=t.allowCode,debug:t.debug}:{},k=t&&t.tmpls,L=[],A=0,O=[],M=L,_=[,,,L],D=0;e=e.replace(v,"\\$1"),e.replace(i,H),P(e.length),u=L.length,a=u?"":'"";';for(o=0;o<u;o++)s=L[o],s[0]==="*"?a=a.slice(0,o?-1:-3)+";"+s[1]+(o+1<u?"ret+=":""):""+s===s?a+='"'+s+'"+':(b=s[0],w=s[1],S=s[2],M=s[3],x=s[4],e=s[5],M&&(T=R(e,C,t,D++),F(e,T),k.push(T)),y=y||x.indexOf("view")>-1,a+=(b===":"?w==="html"?(c=f,"e("+S):w?(g=f,'c("'+w+'",view,'+S):(h=f,"((v="+S+')!=u?v:""'):(l=f,'t("'+b+'",view,"'+(w||"")+'",'+(M?k.length:'""')+","+x+(S?",":"")+S))+")+");return a=new Function("data, view, j, b, u",E+(h?"v,":"")+(l?"t=j.tag,":"")+(g?"c=j.convert,":"")+(c?"e=j.converters.html,":"")+"ret; try{\n\n"+(C.debug?"debugger;":"")+(N?"ret=":"return ")+a.slice(0,-1)+";\n\n"+(N?"return ret;":"")+"}catch(e){return j.err(e);}"),t&&(t.fn=a,t.useVw=g||y||l),a}function I(e,t){function u(e,u,l,h,p,d,v,m,g,y,b,w,E,S,x,T){function N(e,n,r,i,s,o,u){if(n){var a=(r?'view.hlp("'+r+'")':i?"view":"data")+(u?(s?"."+s:r?"":i?"":"."+n)+(o||""):(u=r?"":i?s||"":n,""));return t&&g!=="("&&(a="b("+a+',"'+u+'")'),a+(u?"."+u:"")}return e}p=p||"",l=l||u||b,h=h||m,g=g||x||"",p=p||"";if(!d)return o?(o=!w,o?e:'"'):s?(s=!E,s?e:'"'):(l?(i++,l):"")+(T?i?"":n?(n=a,"\b"):",":v?(i&&j(),n=f,"\b"+h+":"):h?h.replace(c,N)+(g?(r[++i]=f,g):p):p?e:S?(r[i--]=a,S)+(g?(r[++i]=f,g):""):y?(r[i]||j(),","):u?"":(o=w,s=E,'"'));j()}var n,r={},i=0,s=a,o=a;return e=(e+" ").replace(h,u),e}function q(e,n,r,i){function p(t){if(""+t===t||t.nodeType>0)return a=t.nodeType>0?t:!s.test(t)&&l&&l(t)[0],a&&a.type&&(t=_[a.getAttribute(w)],t||(e=e||"_"+y++,a.setAttribute(w,e),t=q(e,a.innerHTML,r,i),_[e]=t)),t}var u,a,f,c,h;u=p(n),i=i||(n.markup?n:{}),i.name=e,c=i.templates,!u&&n.markup&&(u=p(n.markup))&&u.fn&&(u.debug!==n.debug||u.allowCode!==n.allowCode)&&(u=u.markup);if(u!==t){e&&!r&&(T[e]=function(){return n.render.apply(n,arguments)}),u.fn||n.fn?u.fn&&(e&&e!==u.name?n=o(o({},u),i):n=u):(n=R(u,i,r,0),F(u,n));for(f in c)h=c[f],h.name!==f&&(c[f]=q(f,h,n));return n}}function R(e,t,n,r){function i(e){n[e]&&(s[e]=o(o({},n[e]),t[e]))}t=t||{};var s={markup:e,tmpls:[],links:[],render:B};return n&&(n.templates&&(s.templates=o(o({},n.templates),t.templates)),s.parent=n,s.name=n.name+"["+r+"]",s.index=r),o(s,t),n&&(i("templates"),i("tags"),i("helpers"),i("converters")),s}function U(e){return b[e]||(b[e]="&#"+e.charCodeAt(0)+";")}var n="v1.0pre",r,i,s,o,u={},a=!1,f=!0,l=e.jQuery,c=/^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,h=/(\()(?=|\s*\()|(?:([([])\s*)?(?:([#~]?[\w$.]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*([)\]])([([]?))|(\s+)/g,p=/\r?\n/g,d=/\\(['"])/g,v=/\\?(['"])/g,m=/\x08(~)?([^\x08]+)\x08/g,g=0,y=0,b={"&":"&","<":"<",">":">"},w="data-jsv-tmpl",E="var j=j||"+(l?"jQuery.":"js")+"views,",S=/[\x00"&'<>]/g,x=Array.prototype.slice,T={},N={jsviews:n,sub:u,debugMode:f,err:function(e){return N.debugMode?"<br/><b>Error:</b> <em> "+(e.message||e)+". </em>":'""'},tmplFn:F,render:T,templates:_,tags:D,helpers:P,converters:H,View:O,convert:L,delimiters:C,tag:A};l?(r=l,r.templates=_,r.render=T,r.views=N,r.fn.render=B):(r=e.jsviews=N,r.extend=function(e,t){var n;e=e||{};for(n in t)e[n]=t[n];return e},r.isArray=Array&&Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}),o=r.extend,N.topView={views:{},tmpl:{},hlp:k,ctx:N.helpers},D({"if":function(){var e=this,n=e.view;return n.onElse=function(e,r){var i=0,s=r.length;while(s&&!r[i++])if(i===s)return"";return n.onElse=t,e.path="",e.renderContent(n)},n.onElse(this,arguments)},"else":function(){var e=this.view;return e.onElse?e.onElse(this,arguments):""},"for":function(){var e,t=this,n="",r=arguments,i=r.length;t.props.layout&&(t.tmpl.layout=f);for(e=0;e<i;e++)n+=t.renderContent(r[e]);return n},"=":function(e){return e},"*":function(e){return e}}),H({html:function(e){return e!=t?String(e).replace(S,U):""}}),C("{{","}}")}(this),function(e){function r(t){var n=t||window.event,r=[].slice.call(arguments,1),i=0,s=!0,o=0,u=0;return t=e.event.fix(n),t.type="mousewheel",n.wheelDelta&&(i=n.wheelDelta/120),n.detail&&(i=-n.detail/3),u=i,n.axis!==undefined&&n.axis===n.HORIZONTAL_AXIS&&(u=0,o=-1*i),n.wheelDeltaY!==undefined&&(u=n.wheelDeltaY/120),n.wheelDeltaX!==undefined&&(o=-1*n.wheelDeltaX/120),r.unshift(t,i,o,u),(e.event.dispatch||e.event.handle).apply(this,r)}var t=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks)for(var n=t.length;n;)e.event.fixHooks[t[--n]]=e.event.mouseHooks;e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],r,!1);else this.onmousewheel=r},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],r,!1);else this.onmousewheel=null}},e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}(jQuery),$.widget||function(e,t){if(e.cleanData){var n=e.cleanData;e.cleanData=function(t){for(var r=0,i;(i=t[r])!=null;r++)try{e(i).triggerHandler("remove")}catch(s){}n(t)}}else{var r=e.fn.remove;e.fn.remove=function(t,n){return this.each(function(){return n||(!t||e.filter(t,[this]).length)&&e("*",this).add([this]).each(function(){try{e(this).triggerHandler("remove")}catch(t){}}),r.call(e(this),t,n)})}}e.widget=function(t,n,r){var i=t.split(".")[0],s;t=t.split(".")[1],s=i+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][s]=function(n){return!!e.data(n,t)},e[i]=e[i]||{},e[i][t]=function(e,t){arguments.length&&this._createWidget(e,t)};var o=new n;o.options=e.extend(!0,{},o.options),e[i][t].prototype=e.extend(!0,o,{namespace:i,widgetName:t,widgetEventPrefix:e[i][t].prototype.widgetEventPrefix||t,widgetBaseClass:s},r),e.widget.bridge(t,e[i][t])},e.widget.bridge=function(n,r){e.fn[n]=function(i){var s=typeof i=="string",o=Array.prototype.slice.call(arguments,1),u=this;return i=!s&&o.length?e.extend.apply(null,[!0,i].concat(o)):i,s&&i.charAt(0)==="_"?u:(s?this.each(function(){var r=e.data(this,n),s=r&&e.isFunction(r[i])?r[i].apply(r,o):r;if(s!==r&&s!==t)return u=s,!1}):this.each(function(){var t=e.data(this,n);t?t.option(i||{})._init():e.data(this,n,new r(i,this))}),u)}},e.Widget=function(e,t){arguments.length&&this._createWidget(e,t)},e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(t,n){e.data(n,this.widgetName,this),this.element=e(n),this.options=e.extend(!0,{},this.options,this._getCreateOptions(),t);var r=this;this.element.bind("remove."+this.widgetName,function(){r.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return e.metadata&&e.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(n,r){var i=n;if(arguments.length===0)return e.extend({},this.options);if(typeof n=="string"){if(r===t)return this.options[n];i={},i[n]=r}return this._setOptions(i),this},_setOptions:function(t){var n=this;return e.each(t,function(e,t){n._setOption(e,t)}),this},_setOption:function(e,t){return this.options[e]=t,e==="disabled"&&this.widget()[t?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",t),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(t,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.call(this.element[0],n,r)===!1||n.isDefaultPrevented())}}}(jQuery),function(e,t,n){var r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;e.geo={_allCoordinates:function(t){var n=this._flatten(t),r=0,i=[];for(;r<n.length;r++){var s=n[r].coordinates,o=s&&e.isArray(s[0]),u=o&&e.isArray(s[0][0]),a=u&&e.isArray(s[0][0][0]),f,l,c;a||(u||(o||(s=[s]),s=[s]),s=[s]);for(f=0;f<s.length;f++)for(l=0;l<s[f].length;l++)for(c=0;c<s[f][l].length;c++)i.push(s[f][l][c])}return i},_isGeodetic:function(t){while(e.isArray(t)){if(t.length>1&&!e.isArray(t[0]))return t[0]>=-180&&t[0]<=180&&t[1]>=-85&&t[1]<=85;t=t[0]}return!1},center:function(t,n){var r=!1;!n&&e.geo.proj&&this._isGeodetic(t)&&(r=!0,t=e.geo.proj.fromGeodetic(t));var i=[(t[0]+t[2])/2,(t[1]+t[3])/2];return r?e.geo.proj.toGeodetic(i):i},expandBy:function(t,n,r,i){var s=!1;return!i&&e.geo.proj&&this._isGeodetic(t)&&(s=!0,t=e.geo.proj.fromGeodetic(t)),t=[t[0]-n,t[1]-r,t[2]+n,t[3]+r],s?e.geo.proj.toGeodetic(t):t},height:function(t,n){return!n&&e.geo.proj&&this._isGeodetic(t)&&(t=e.geo.proj.fromGeodetic(t)),t[3]-t[1]},_in:function(e,t){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[2]&&e[3]>=t[3]},_bboxDisjoint:function(e,t){return t[0]>e[2]||t[2]<e[0]||t[1]>e[3]||t[3]<e[1]},include:function(t,n,s){if(!n||!e.isArray(n))return t;var o=!1;return!s&&e.geo.proj&&this._isGeodetic(t||n)&&(o=!0),t?o&&(t=e.geo.proj.fromGeodetic(t)):t=[r,r,i,i],n.length===2&&(n=[n[0],n[1],n[0],n[1]]),n=e.geo.proj.fromGeodetic(n),t[0]=Math.min(n[0],t[0]),t[1]=Math.min(n[1],t[1]),t[2]=Math.max(n[2],t[2]),t[3]=Math.max(n[3],t[3]),o?e.geo.proj.toGeodetic(t):t},polygonize:function(t,n){var r=!1;!n&&e.geo.proj&&this._isGeodetic(t)&&(r=!0,t=e.geo.proj.fromGeodetic(t));var i={type:"Polygon",coordinates:[[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]]]};return r&&(i.coordinates=e.geo.proj.toGeodetic(i.coordinates)),i},reaspect:function(t,n,r){var i=!1;!r&&e.geo.proj&&this._isGeodetic(t)&&(i=!0,t=e.geo.proj.fromGeodetic(t));var s=this.width(t,!0),o=this.height(t,!0),u=this.center(t,!0),a,f;return s!==0&&o!==0&&n>0&&(s/o>n?(a=s/2,f=a/n):(f=o/2,a=f*n),t=[u[0]-a,u[1]-f,u[0]+a,u[1]+f]),i?e.geo.proj.toGeodetic(t):t},recenter:function(t,n,r){var i=!1;!r&&e.geo.proj&&(this._isGeodetic(t)&&(i=!0,t=e.geo.proj.fromGeodetic(t)),this._isGeodetic(n)&&(n=e.geo.proj.fromGeodetic(n)));var s=(t[2]-t[0])/2,o=(t[3]-t[1])/2;return t=[n[0]-s,n[1]-o,n[0]+s,n[1]+o],i?e.geo.proj.toGeodetic(t):t},scaleBy:function(t,n,r){var i=!1;!r&&e.geo.proj&&this._isGeodetic(t)&&(i=!0,t=e.geo.proj.fromGeodetic(t));var s=this.center(t,!0),o=(t[2]-t[0])*n/2,u=(t[3]-t[1])*n/2;return t=[s[0]-o,s[1]-u,s[0]+o,s[1]+u],i?e.geo.proj.toGeodetic(t):t},width:function(t,n){return!n&&e.geo.proj&&this._isGeodetic(t)&&(t=e.geo.proj.fromGeodetic(t)),t[2]-t[0]},bbox:function(t,s){var o,u=!1;if(!t)return n;if(t.bbox)o=!s&&e.geo.proj&&this._isGeodetic(t.bbox)?e.geo.proj.fromGeodetic(t.bbox):t.bbox;else{o=[r,r,i,i];var a=this._allCoordinates(t),f=0;if(a.length===0)return n;!s&&e.geo.proj&&this._isGeodetic(a)&&(u=!0,a=e.geo.proj.fromGeodetic(a));for(;f<a.length;f++)o[0]=Math.min(a[f][0],o[0]),o[1]=Math.min(a[f][1],o[1]),o[2]=Math.max(a[f][0],o[2]),o[3]=Math.max(a[f][1],o[3])}return u?e.geo.proj.toGeodetic(o):o},centroid:function(t,s){switch(t.type){case"Point":return e.extend({},t);case"LineString":case"Polygon":var o=0,u=[0,0],a=e.merge([],t.type=="Polygon"?t.coordinates[0]:t.coordinates),f=1,l,c,h=[r,r,i,i],p=!1;!s&&e.geo.proj&&this._isGeodetic(a)&&(p=!0,a=e.geo.proj.fromGeodetic(a));for(;f<=a.length;f++)l=f%a.length,h[0]=Math.min(a[l][0],h[0]),h[1]=Math.min(a[l][1],h[1]),h[2]=Math.max(a[l][0],h[2]),h[3]=Math.max(a[l][1],h[3]),c=a[f-1][0]*a[l][1]-a[l][0]*a[f-1][1],o+=c,u[0]+=(a[f-1][0]+a[l][0])*c,u[1]+=(a[f-1][1]+a[l][1])*c;if(o===0)return a.length>0?(u[0]=Math.min(Math.max(a[0][0],h[0]),h[2]),u[1]=Math.min(Math.max(a[0][1],h[1]),h[3]),{type:"Point",coordinates:p?e.geo.proj.toGeodetic(u):u}):n;return o*=3,u[0]=Math.min(Math.max(u[0]/o,h[0]),h[2]),u[1]=Math.min(Math.max(u[1]/o,h[1]),h[3]),{type:"Point",coordinates:p?e.geo.proj.toGeodetic(u):u}}return n},contains:function(e,t){if(e.type!="Polygon")return!1;switch(t.type){case"Point":return this._containsPolygonPoint(e.coordinates,t.coordinates);case"LineString":return this._containsPolygonLineString(e.coordinates,t.coordinates);case"Polygon":return this._containsPolygonLineString(e.coordinates,t.coordinates[0]);default:return!1}},_containsPolygonPoint:function(e,t){if(e.length===0||e[0].length<4)return!1;var n=0,r=e[0][0],i=1,s,o;for(;i<e[0].length;i++){s=e[0][i];if(r[1]<=t[1]&&t[1]<s[1]||s[1]<=t[1]&&t[1]<r[1]&&(t[0]<r[0]||t[0]<s[0]))o=r[0]+(s[0]-r[0])*(t[1]-r[1])/(s[1]-r[1]),o>t[0]&&n++;r=s}return n%2==1},_containsPolygonLineString:function(e,t){for(var n=0;n<t.length;n++)if(!this._containsPolygonPoint(e,t[n]))return!1;return!0},distance:function(t,r,i){var s=!i&&e.geo.proj&&this._isGeodetic(t.coordinates)?e.geo.proj.fromGeodetic(t.coordinates):t.coordinates,o=!i&&e.geo.proj&&this._isGeodetic(r.coordinates)?e.geo.proj.fromGeodetic(r.coordinates):r.coordinates;switch(t.type){case"Point":switch(r.type){case"Point":return this._distancePointPoint(o,s);case"LineString":return this._distanceLineStringPoint(o,s);case"Polygon":return this._containsPolygonPoint(o,s)?0:this._distanceLineStringPoint(o[0],s);default:return n}break;case"LineString":switch(r.type){case"Point":return this._distanceLineStringPoint(s,o);case"LineString":return this._distanceLineStringLineString(s,o);case"Polygon":return this._containsPolygonLineString(o,s)?0:this._distanceLineStringLineString(o[0],s);default:return n}break;case"Polygon":switch(r.type){case"Point":return this._containsPolygonPoint(s,o)?0:this._distanceLineStringPoint(s[0],o);case"LineString":return this._containsPolygonLineString(s,o)?0:this._distanceLineStringLineString(s[0],o);case"Polygon":return this._containsPolygonLineString(s,o[0])?0:this._distanceLineStringLineString(s[0],o[0]);default:return n}}},_distancePointPoint:function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)},_distanceLineStringPoint:function(e,t){var n=r;if(e.length>0){var i=e[0],s=t[0]-i[0],o=t[1]-i[1];if(e.length==1)return Math.sqrt(s*s+o*o);for(var u=1;u<e.length;u++){var a=e[u],f=a[0]-i[0],l=a[1]-i[1],c=t[0]-a[0],h=t[1]-a[1],p=this._distanceSegmentPoint(f,l,s,o,c,h);if(p===0)return 0;p<n&&(n=p),i=a,s=c,o=h}}return Math.sqrt(n)},_distanceSegmentPoint:function(e,t,n,r,i,s){var o=e*n+t*r;if(o<=0)return n*n+r*r;var u=e*e+t*t;return o>=u?i*i+s*s:n*n+r*r-o*o/u},_distanceLineStringLineString:function(e,t){var n=r;for(var i=0;i<t.length;i++)n=Math.min(n,this._distanceLineStringPoint(e,t[i]));return n},_buffer:function(t,r,i){var s=!1,o=t.coordinates;!i&&e.geo.proj&&this._isGeodetic(t.coordinates)&&(s=!0,o=e.geo.proj.fromGeodetic(t.coordinates));if(t.type==="Point"){var u=[],a=180,f=0,l;for(;f<=a;f++)l=f*360/a*(Math.PI/180),u.push([o[0]+Math.cos(l)*r,o[1]+Math.sin(l)*r]);return{type:"Polygon",coordinates:[s?e.geo.proj.toGeodetic(u):u]}}return n},_flatten:function(t){var n=[],r=0;switch(t.type){case"Feature":e.merge(n,this._flatten(t.geometry));break;case"FeatureCollection":for(;r<t.features.length;r++)e.merge(n,this._flatten(t.features[r].geometry));break;case"GeometryCollection":for(;r<t.geometries.length;r++)e.merge(n,this._flatten(t.geometries[r]));break;default:n[0]=t}return n},length:function(t,n){var r=0,i,s=1,o,u;switch(t.type){case"Point":return 0;case"LineString":i=t.coordinates;break;case"Polygon":i=t.coordinates[0]}if(i){!n&&e.geo.proj&&this._isGeodetic(i)&&(i=e.geo.proj.fromGeodetic(i));for(;s<i.length;s++)o=i[s][0]-i[s-1][0],u=i[s][1]-i[s-1][1],r+=Math.sqrt(o*o+u*u);return r}},area:function(t,n){var r=0,i,s=1,o;switch(t.type){case"Point":case"LineString":return 0;case"Polygon":i=t.coordinates[0]}if(i){!n&&e.geo.proj&&this._isGeodetic(i)&&(i=e.geo.proj.fromGeodetic(i));for(;s<=i.length;s++)o=s%i.length,r+=(i[s-1][0]-i[o][0])*(i[s-1][1]+i[o][1])/2;return Math.abs(r)}},pointAlong:function(t,n,r){var i=0,s=0,o=0,u,a,f,l=[],c=1,h,p,d,v,m,g=!1;switch(t.type){case"Point":return e.extend({},t);case"LineString":f=t.coordinates;break;case"Polygon":f=t.coordinates[0]}if(f){if(n===0)return{type:"Point",coordinates:[f[0][0],f[0][1]]};if(n===1)return c=f.length-1,{type:"Point",coordinates:[f[c][0],f[c][1]]};!r&&e.geo.proj&&this._isGeodetic(f)&&(g=!0,f=e.geo.proj.fromGeodetic(f));for(;c<f.length;c++)h=f[c][0]-f[c-1][0],p=f[c][1]-f[c-1][1],a=Math.sqrt(h*h+p*p),l.push(a),i+=a;for(c=0;c<l.length&&o<n;c++)s=o,o+=l[c]/i;return u=n-s,v=f[c-1],m=f[c],d=[v[0]+u*(m[0]-v[0]),v[1]+u*(m[1]-v[1])],{type:"Point",coordinates:g?e.geo.proj.toGeodetic(d):d}}},_WKT:function(){function t(e){return"POINT "+n(e.coordinates)}function n(e){return!e||!e.length?"EMPTY":"("+e.join(" ")+")"}function r(e){return"LINESTRING "+i(e.coordinates)}function i(e){if(!e||!e.length)return"EMPTY";var t=[];for(var n=0;n<e.length;n++)t.push(e[n].join(" "));return"("+t+")"}function s(e){return"POLYGON "+o(e.coordinates)}function o(e){if(!e||!e.length)return"EMTPY";var t=[];for(var n=0;n<e.length;n++)t.push(i(e[n]));return"("+t+")"}function u(e){return"MULTIPOINT "+i(e.coordinates)}function a(e){return"MULTILINSTRING "+o(e.coordinates)}function f(e){return"MULTIPOLYGON "+l(e.coordinates)}function l(e){if(!e||!e.length)return"EMPTY";var t=[];for(var n=0;n<e.length;n++)t.push(o(e[n]));return"("+t+")"}function c(e){return"GEOMETRYCOLLECTION "+h(e.geometries)}function h(e){if(!e||!e.length)return"EMPTY";var t=[];for(var n=0;n<e.length;n++)t.push(p(e[n]));return"("+e+")"}function p(e){if(!e||!e.type)return"";switch(e.type){case"Point":return t(e);case"LineString":return r(e);case"Polygon":return s(e);case"MultiPoint":return u(e);case"MultiLineString":return a(e);case"MultiPolygon":return f(e);case"GeometryCollection":return c(e);default:return""}}function d(e){var t=e.match(/\(\s*([\d\.\-]+)\s+([\d\.\-]+)\s*\)/);return t&&t.length>2?{type:"Point",coordinates:[parseFloat(t[1]),parseFloat(t[2])]}:null}function v(e){var t=e.match(/\s*\((.*)\)/),n=[],r,i,s=0;if(t&&t.length>1){r=t[1].match(/[\d\.\-]+\s+[\d\.\-]+/g);for(;s<r.length;s++)i=r[s].match(/\s*([\d\.\-]+)\s+([\d\.\-]+)\s*/),n[s]=[parseFloat(i[1]),parseFloat(i[2])];return{type:"LineString",coordinates:n}}return null}function m(e){var t=e.match(/\s*\(\s*\((.*)\)\s*\)/),n=[],r,i,s=0;if(t&&t.length>1){r=t[1].match(/[\d\.\-]+\s+[\d\.\-]+/g);for(;s<r.length;s++)i=r[s].match(/\s*([\d\.\-]+)\s+([\d\.\-]+)\s*/),n[s]=[parseFloat(i[1]),parseFloat(i[2])];return{type:"Polygon",coordinates:[n]}}return null}function g(t){var n;return t.indexOf("((")===-1?n=v(t):(n=y(t),n.coordinates=e.geo._allCoordinates(n)),n.type="MultiPoint",n}function y(e){var t=e.substr(1,e.length-2),n=t.split(")),(("),r=0,i={type:"MultiLineString",coordinates:[]};for(;r<n.length;r++)i.coordinates.push(v(n[r]).coordinates);return i}function b(e){var t=e.substr(1,e.length-2),n=t.split(")),(("),r=0,i={type:"MultiPolygon",coordinates:[]};for(;r<n.length;r++)i.coordinates.push(m(n[r]).coordinates);return i}function w(e){var t=e.substr(1,e.length-2),n=t.match(/\),[a-zA-Z]/g),r={type:"GeometryCollection",geometries:[]},i,s=0,o=0,u;if(n&&n.length>0){for(;s<n.length;s++)u=t.indexOf(n[s],o)-o+1,i=E(t.substr(o,u)),i&&r.geometries.push(i),o+=u+1;return i=E(t.substr(o)),i&&r.geometries.push(i),r}return null}function E(t){t=e.trim(t);var n=t.indexOf("("),r=t.substr(n);switch(e.trim(t.substr(0,n)).toUpperCase()){case"POINT":return d(r);case"LINESTRING":return v(r);case"POLYGON":return m(r);case"MULTIPOINT":return g(r);case"MULTILINESTRING":return y(r);case"MULTIPOLYGON":return b(r);case"GEOMETRYCOLLECTION":return w(r);default:return null}}return{stringify:p,parse:E}}(),proj:function(){var t=1.5707963267948966,n=.7853981633974483,r=.017453292519943295,i=57.29577951308232,s=6378137;return{fromGeodeticPos:function(e){return[s*e[0]*r,s*Math.log(Math.tan(n+e[1]*r/2))]},fromGeodetic:function(t){if(!e.geo._isGeodetic(t))return t;var n=e.isArray(t[0]),r=this.fromGeodeticPos;if(!n&&t.length==4){var i=r([t[0],t[1]]),s=r([t[2],t[3]]);return[i[0],i[1],s[0],s[1]]}var o=n&&e.isArray(t[0][0]),u=o&&e.isArray(t[0][0][0]),a=[],f,l,c;u||(o||(n||(t=[t]),t=[t]),t=[t]);for(f=0;f<t.length;f++){a[f]=[];for(l=0;l<t[f].length;l++){a[f][l]=[];for(c=0;c<t[f][l].length;c++)a[f][l][c]=r(t[f][l][c])}}return u?a:o?a[0]:n?a[0][0]:a[0][0][0]},toGeodeticPos:function(e){return[e[0]/s*i,(t-2*Math.atan(1/Math.exp(e[1]/s)))*i]},toGeodetic:function(t){if(e.geo._isGeodetic(t))return t;var n=e.isArray(t[0]),r=this.toGeodeticPos;if(!n&&t.length==4){var i=r([t[0],t[1]]),s=r([t[2],t[3]]);return[i[0],i[1],s[0],s[1]]}var o=n&&e.isArray(t[0][0]),u=o&&e.isArray(t[0][0][0]),a=[],f,l,c;u||(o||(n||(t=[t]),t=[t]),t=[t]);for(f=0;f<t.length;f++){a[f]=[];for(l=0;l<t[f].length;l++){a[f][l]=[];for(c=0;c<t[f][l].length;c++)a[f][l][c]=r(t[f][l][c])}}return u?a:o?a[0]:n?a[0][0]:a[0][0][0]}}}(),_serviceTypes:{}}}(jQuery,this),function(e,t){var n=function(){var e=5,t=document.createElement("div"),n=t.all||[];do t.innerHTML="<!--[if gt IE "+ ++e+"]><br><![endif]-->";while(n[0]);return e>6?e:!e}();e.widget("geo.geographics",{_$elem:t,_options:{},_trueCanvas:!0,_trueDoubleBuffer:!0,_width:0,_height:0,_$canvas:t,_context:t,_$canvasSceneFront:t,_$canvasSceneBack:t,_timeoutEnd:null,_requireFlip:!1,_blitcanvas:t,_blitcontext:t,_$labelsContainerFront:t,_$labelsContainerBack:t,_labelsHtml:"",options:{style:{borderRadius:"8px",color:"#7f0000",fillOpacity:.2,height:"8px",opacity:1,strokeOpacity:1,strokeWidth:"2px",visibility:"visible",width:"8px"},doubleBuffer:!0},_create:function(){this._$elem=this.element,this._options=this.options,this._$elem.css({webkitTransform:"translateZ(0)",display:"inline-block",overflow:"hidden",textAlign:"left"}),this._$elem.css("position")=="static"&&this._$elem.css("position","relative"),this._$elem.addClass("geo-graphics"),this._width=this._$elem.width(),this._height=this._$elem.height();if(!this._width||!this._height)this._width=parseInt(this._$elem.css("width"),10),this._height=parseInt(this._$elem.css("height"),10);var t="position:absolute;left:0;top:0;margin:0;padding:0;",r="width:"+this._width+"px;height:"+this._height+"px;",i='width="'+this._width+'" height="'+this._height+'"';this._blitcanvas=document.createElement("canvas"),this._blitcanvas.getContext?(this._$canvas=e("<canvas "+i+' style="-webkit-transform:translateZ(0);'+t+'"></canvas>'),this._blitcanvas.width=1,this._blitcanvas.height=1,this._trueDoubleBuffer=this._blitcanvas.toDataURL().length>6,(!this._options.doubleBuffer||!this._trueDoubleBuffer)&&this._$elem.append(this._$canvas),this._context=this._$canvas[0].getContext("2d"),this._blitcanvas.width=this._width,this._blitcanvas.height=this._height,this._blitcontext=this._blitcanvas.getContext("2d"),this._$canvasSceneFront=e('<img id="scene0" style="-webkit-transform:translateZ(0);'+t+r+'" />'),this._$canvasSceneBack=e('<img id="scene1" style="-webkit-transform:translateZ(0);'+t+r+'" />')):n<=8&&(this._trueCanvas=!1,this._$elem.append("<div "+i+' style="'+t+r+'"></div>'),this._$canvas=this._$elem.children(":last"),G_vmlCanvasManager.initElement(this._$canvas[0]),this._context=this._$canvas[0].getContext("2d"),this._$canvas.children().css({backgroundColor:"transparent",width:this._width,height:this._height})),this._$labelsContainerFront=e('<div class="geo-labels-container" style="-webkit-transform:translateZ(0);'+t+r+'"></div>'),this._$labelsContainerBack=e('<div class="geo-labels-container" style="-webkit-transform:translateZ(0);'+t+r+'"></div>')},_setOption:function(t,n){t=="style"&&(n=e.extend({},this._options.style,n)),e.Widget.prototype._setOption.apply(this,arguments)},destroy:function(){e.Widget.prototype.destroy.apply(this,arguments),this._$elem.html(""),this._$elem.removeClass("geo-graphics")},clear:function(){this._context.clearRect(0,0,this._width,this._height),this._labelsHtml="",this._end()},drawArc:function(e,t,n,r){r=this._getGraphicStyle(r);if(r.visibility!="hidden"&&r.opacity>0&&r.widthValue>0&&r.heightValue>0){var i=Math.min(r.widthValue,r.heightValue)/2;t=t*Math.PI/180,n=n*Math.PI/180,this._context.save(),this._context.translate(e[0],e[1]),r.widthValue>r.heightValue?this._context.scale(r.widthValue/r.heightValue,1):this._context.scale(1,r.heightValue/r.widthValue),this._context.beginPath(),this._context.arc(0,0,i,t,n,!1),this._trueCanvas&&this._context.restore(),r.doFill&&(this._context.fillStyle=r.fill,this._context.globalAlpha=r.opacity*r.fillOpacity,this._context.fill()),r.doStroke&&(this._context.lineJoin="round",this._context.lineWidth=r.strokeWidthValue,this._context.strokeStyle=r.stroke,this._context.globalAlpha=r.opacity*r.strokeOpacity,this._context.stroke()),this._trueCanvas||this._context.restore()}this._end()},drawPoint:function(e,t){t=this._getGraphicStyle(t),t.widthValue==t.heightValue&&t.heightValue==t.borderRadiusValue?this.drawArc(e,0,360,t):t.visibility!="hidden"&&t.opacity>0&&(t.borderRadiusValue=Math.min(Math.min(t.widthValue,t.heightValue)/2,t.borderRadiusValue),e[0]-=t.widthValue/2,e[1]-=t.heightValue/2,this._context.beginPath(),this._context.moveTo(e[0]+t.borderRadiusValue,e[1]),this._context.lineTo(e[0]+t.widthValue-t.borderRadiusValue,e[1]),this._context.quadraticCurveTo(e[0]+t.widthValue,e[1],e[0]+t.widthValue,e[1]+t.borderRadiusValue),this._context.lineTo(e[0]+t.widthValue,e[1]+t.heightValue-t.borderRadiusValue),this._context.quadraticCurveTo(e[0]+t.widthValue,e[1]+t.heightValue,e[0]+t.widthValue-t.borderRadiusValue,e[1]+t.heightValue),this._context.lineTo(e[0]+t.borderRadiusValue,e[1]+t.heightValue),this._context.quadraticCurveTo(e[0],e[1]+t.heightValue,e[0],e[1]+t.heightValue-t.borderRadiusValue),this._context.lineTo(e[0],e[1]+t.borderRadiusValue),this._context.quadraticCurveTo(e[0],e[1],e[0]+t.borderRadiusValue,e[1]),this._context.closePath(),t.doFill&&(this._context.fillStyle=t.fill,this._context.globalAlpha=t.opacity*t.fillOpacity,this._context.fill()),t.doStroke&&(this._context.lineJoin="round",this._context.lineWidth=t.strokeWidthValue,this._context.strokeStyle=t.stroke,this._context.globalAlpha=t.opacity*t.strokeOpacity,this._context.stroke()),this._end())},drawLineString:function(e,t){this._drawLines([e],!1,t)},drawPolygon:function(e,t){if(!this._trueCanvas||e.length==1)this._drawLines(e,!0,t);else{if(!e||!e.length||e[0].length<3)return;t=this._getGraphicStyle(t);var n,r,i;if(t.visibility!="hidden"&&t.opacity>0){this._blitcontext.clearRect(0,0,this._width,this._height);if(t.doFill&&e.length>1){this._blitcontext.globalCompositeOperation="source-out",this._blitcontext.globalAlpha=1;for(r=1;r<e.length;r++){this._blitcontext.beginPath(),this._blitcontext.moveTo(e[r][0][0],e[r][0][1]);for(i=1;i<e[r].length;i++)this._blitcontext.lineTo(e[r][i][0],e[r][i][1]);this._blitcontext.closePath(),this._blitcontext.fill()}}this._blitcontext.beginPath(),this._blitcontext.moveTo(e[0][0][0],e[0][0][1]),n=[e[0][0][0]-t.strokeWidthValue,e[0][0][1]-t.strokeWidthValue,e[0][0][0]+t.strokeWidthValue,e[0][0][1]+t.strokeWidthValue];for(r=1;r<e[0].length-1;r++)this._blitcontext.lineTo(e[0][r][0],e[0][r][1]),n[0]=Math.min(e[0][r][0]-t.strokeWidthValue,n[0]),n[1]=Math.min(e[0][r][1]-t.strokeWidthValue,n[1]),n[2]=Math.max(e[0][r][0]+t.strokeWidthValue,n[2]),n[3]=Math.max(e[0][r][1]+t.strokeWidthValue,n[3]);this._blitcontext.closePath(),this._blitcontext.globalCompositeOperation="source-out",t.doFill&&(this._blitcontext.fillStyle=t.fill,this._blitcontext.globalAlpha=t.opacity*t.fillOpacity,this._blitcontext.fill()),this._blitcontext.globalCompositeOperation="source-over";if(t.doStroke){this._blitcontext.lineCap=this._blitcontext.lineJoin="round",this._blitcontext.lineWidth=t.strokeWidthValue,this._blitcontext.strokeStyle=t.stroke,this._blitcontext.globalAlpha=t.opacity*t.strokeOpacity,this._blitcontext.stroke();if(e.length>1)for(r=1;r<e.length;r++){this._blitcontext.beginPath(),this._blitcontext.moveTo(e[r][0][0],e[r][0][1]);for(i=1;i<e[r].length;i++)this._blitcontext.lineTo(e[r][i][0],e[r][i][1]);this._blitcontext.closePath(),this._blitcontext.stroke()}}n[0]=Math.min(Math.max(n[0],0),this._width),n[1]=Math.min(Math.max(n[1],0),this._height),n[2]=Math.min(Math.max(n[2],0),this._width),n[3]=Math.min(Math.max(n[3],0),this._height),n[0]!==n[2]&&n[1]!==n[3]&&(this._context.drawImage(this._blitcanvas,n[0],n[1],n[2]-n[0],n[3]-n[1],n[0],n[1],n[2]-n[0],n[3]-n[1]),this._end())}}},drawBbox:function(e,t){this._drawLines([[[e[0],e[1]],[e[0],e[3]],[e[2],e[3]],[e[2],e[1]],[e[0],e[1]]]],!0,t)},drawLabel:function(e,t){this._labelsHtml+='<div class="geo-label" style="-webkit-transform:translateZ(0);position:absolute; left:'+e[0]/this._width*100+"%; top:"+e[1]/this._height*100+'%;">'+t+"</div>"},resize:function(){this._width=this._$elem.width(),this._height=this._$elem.height();if(!this._width||!this._height)this._width=parseInt(this._$elem.css("width"),10),this._height=parseInt(this._$elem.css("height"),10);this._trueCanvas?(this._$canvas[0].width=this._width,this._$canvas[0].height=this._height,this._$canvasSceneFront.css({width:this._width,height:this._height}),this._$canvasSceneBack.css({width:this._width,height:this._height})):this._$canvas.css({width:this._width,height:this._height}),this._$labelsContainerFront.css({width:this._width,height:this._height}),this._$labelsContainerBack.css({width:this._width,height:this._height})},interactiveTransform:function(e,t){this._timeoutEnd&&(clearTimeout(this._timeoutEnd),this._timeoutEnd=null);if(this._trueCanvas)if(this._options.doubleBuffer&&this._trueDoubleBuffer){if(this._requireFlip){var n=this,r=n._$canvasSceneFront;n._$canvasSceneFront=n._$canvasSceneBack.css({left:0,top:0,width:n._width,height:n._height}).prop("src",n._$canvas[0].toDataURL()).prependTo(n._$elem),n._$canvasSceneBack=r.detach(),n._requireFlip=!1}this._$canvasSceneFront.css({left:Math.round(e[0]),top:Math.round(e[1]),width:this._width*t,height:this._height*t})}else this._context.clearRect(0,0,this._width,this._height);else this._context.clearRect(0,0,this._width,this._height);this._$labelsContainerFront.css({left:Math.round(e[0]),top:Math.round(e[1]),width:this._width*t,height:this._height*t})},_end:function(){function t(){if(!e._timeoutEnd)return;e._trueCanvas&&e._options.doubleBuffer&&e._trueDoubleBuffer&&e._$canvasSceneBack.prop("src","").one("load",function(t){e._requireFlip=!1;var n=e._$canvasSceneFront;e._$canvasSceneFront=e._$canvasSceneBack.css({left:0,top:0,width:e._width,height:e._height}).prependTo(e._$elem),e._$canvasSceneBack=n.detach()}).prop("src",e._$canvas[0].toDataURL()),e._$labelsContainerBack.html(e._labelsHtml).find("a").css({position:"relative",zIndex:100,display:"inline-block",webkitTransform:"translateZ(0)"});var t=e._$labelsContainerFront;e._$labelsContainerFront=e._$labelsContainerBack.css({left:0,top:0,width:e._width,height:e._height}).prependTo(e._$elem),e._$labelsContainerBack=t.detach(),e._timeoutEnd=null}this._timeoutEnd&&(clearTimeout(this._timeoutEnd),this._timeoutEnd=null),this._requireFlip=!0;var e=this;this._timeoutEnd=setTimeout(t,20)},_getGraphicStyle:function(t){function n(e){return e=parseInt(e,10),+e+""===e?+e:e}return t=e.extend({},this._options.style,t),t.borderRadiusValue=n(t.borderRadius),t.fill=t.fill||t.color,t.doFill=t.fill&&t.fillOpacity>0,t.stroke=t.stroke||t.color,t.strokeWidthValue=n(t.strokeWidth),t.doStroke=t.stroke&&t.strokeOpacity>0&&t.strokeWidthValue>0,t.widthValue=n(t.width),t.heightValue=n(t.height),t},_drawLines:function(e,t,n){if(!e||!e.length||e[0].length<2)return;var r,i;n=this._getGraphicStyle(n);if(n.visibility!="hidden"&&n.opacity>0){this._context.beginPath();for(r=0;r<e.length;r++){this._context.moveTo(e[r][0][0],e[r][0][1]);for(i=1;i<e[r].length;i++)this._context.lineTo(e[r][i][0],e[r][i][1])}t&&this._context.closePath(),t&&n.doFill&&(this._context.fillStyle=n.fill,this._context.globalAlpha=n.opacity*n.fillOpacity,this._context.fill()),n.doStroke&&(this._context.lineCap=this._context.lineJoin="round",this._context.lineWidth=n.strokeWidthValue,this._context.strokeStyle=n.stroke,this._context.globalAlpha=n.opacity*n.strokeOpacity,this._context.stroke()),this._end()}}})}(jQuery),function(e,t){var n=0,r=function(){var e=5,t=document.createElement("div"),n=t.all||[];do t.innerHTML="<!--[if gt IE "+ ++e+"]><br><![endif]-->";while(n[0]);return e>6?e:!e}(),i={bbox:[-180,-85,180,85],bboxMax:[-180,-85,180,85],center:[0,0],cursors:{"static":"default",pan:"url(data:image/vnd.microsoft.icon;base64,AAACAAEAICACAAgACAAwAQAAFgAAACgAAAAgAAAAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAgAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAA/AAAAfwAAAP+AAAH/gAAB/8AAA//AAAd/wAAGf+AAAH9gAADbYAAA2yAAAZsAAAGbAAAAGAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////gH///4B///8Af//+AD///AA///wAH//4AB//8AAf//AAD//5AA///gAP//4AD//8AF///AB///5A////5///8=), move",zoom:"crosshair",dragBox:"crosshair",dragCircle:"crosshair",drawPoint:"crosshair",drawLineString:"crosshair",drawPolygon:"crosshair",measureLength:"crosshair",measureArea:"crosshair"},measureLabels:{length:"{{:length.toFixed( 2 )}} m",area:"{{:area.toFixed( 2 )}} sq m"},drawStyle:{},shapeStyle:{},mode:"pan",pannable:!0,scroll:"default",shift:"default",services:[{"class":"osm",type:"tiled",src:function(e){return"http://otile"+(e.index%4+1)+".mqcdn.com/tiles/1.0.0/osm/"+e.zoom+"/"+e.tile.column+"/"+e.tile.row+".png"},attr:"Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>"}],tilingScheme:{tileWidth:256,tileHeight:256,levels:18,basePixelSize:156543.03392799935,origin:[-20037508.342787,20037508.342787]},axisLayout:"map",zoom:0,zoomMin:0,zoomMax:Number.POSITIVE_INFINITY,pixelSize:0};e.widget("geo.geomap",{_$elem:t,_map:t,_created:!1,_createdGraphics:!1,_widgetId:0,_tmplLengthId:"",_tmplAreaId:"",_contentBounds:{},_$resizeContainer:t,_$eventTarget:t,_$contentFrame:t,_$existingChildren:t,_$attrList:t,_$servicesContainer:t,_$shapesContainers:t,_$panContainer:t,_$shapesContainer:t,_$drawContainer:t,_$measureContainer:t,_$measureLabel:t,_dpi:96,_currentServices:[],_center:t,_pixelSize:t,_centerMax:t,_pixelSizeMax:t,_userGeodetic:!0,_centerInteractive:t,_pixelSizeInteractive:t,_timeoutInteractive:null,_triggerInteractive:!1,_timeoutRefreshShapes:null,_loadCount:0,_wheelTimeout:null,_wheelLevel:0,_zoomFactor:2,_fullZoomFactor:2,_partialZoomFactor:1.18920711500273,_mouseDown:t,_inOp:t,_toolPan:t,_shiftDown:t,_anchor:t,_current:t,_downDate:t,_moveDate:t,_clickDate:t,_lastMove:t,_lastDrag:t,_windowHandler:null,_resizeTimeout:null,_panning:t,_velocity:t,_friction:t,_supportTouch:t,_softDblClick:t,_isTap:t,_isDbltap:t,_isMultiTouch:t,_multiTouchAnchor:[],_multiTouchAnchorBbox:t,_multiTouchCurrentBbox:t,_drawTimeout:null,_drawPixels:[],_drawCoords:[],_graphicShapes:[],_initOptions:{},_options:{},options:e.extend({},i),_createWidget:function(t,r){this._$elem=e(r);if(this._$elem.is(".geo-service")){this._graphicShapes=[],e.Widget.prototype._createWidget.apply(this,arguments);return}this._widgetId=n++,this._tmplLengthId="geoMeasureLength"+this._widgetId,this._tmplAreaId="geoMeasureArea"+this._widgetId,this._$elem.addClass("geo-map").css({webkitTransform:"translateZ(0)"}),this._initOptions=t||{},this._forcePosition(this._$elem),this._$elem.css("text-align","left");var i=this._findMapSize();this._contentBounds={x:parseInt(this._$elem.css("padding-left"),10),y:parseInt(this._$elem.css("padding-top"),10),width:i.width,height:i.height},this._createChildren(),this._center=[0,0],this._centerMax=[0,0],this._centerInteractive=[0,0],this.options.pixelSize=this._pixelSize=this._pixelSizeMax=156543.03392799935,this._mouseDown=this._inOp=this._toolPan=this._shiftDown=this._panning=this._isTap=this._isDbltap=!1,this._anchor=[0,0],this._current=[0,0],this._lastMove=[0,0],this._lastDrag=[0,0],this._velocity=[0,0],this._friction=[.8,.8],this._downDate=this._moveDate=this._clickDate=0,this._drawPixels=[],this._drawCoords=[],this._graphicShapes=[],e.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._options=this.options;if(this._$elem.is(".geo-service")){this._map=this._$elem.data("geoMap"),this._$elem.data("geoService",this);return}this._map=this,this._supportTouch="ontouchend"in document,this._softDblClick=this._supportTouch||r==7;var n=this,i=this._supportTouch?"touchstart":"mousedown",s=this._supportTouch?"touchend touchcancel":"mouseup",o=this._supportTouch?"touchmove":"mousemove";e(document).keydown(e.proxy(this._document_keydown,this)),this._$eventTarget.dblclick(e.proxy(this._eventTarget_dblclick,this)),this._$eventTarget.bind(i,e.proxy(this._eventTarget_touchstart,this));var u=this._$eventTarget[0].setCapture?this._$eventTarget:e(document);u.bind(o,e.proxy(this._dragTarget_touchmove,this)),u.bind(s,e.proxy(this._dragTarget_touchstop,this)),this._$eventTarget.mousewheel(e.proxy(this._eventTarget_mousewheel,this)),this._windowHandler=function(){n._resizeTimeout&&clearTimeout(n._resizeTimeout),n._resizeTimeout=setTimeout(function(){n._created&&n._$elem.geomap("resize",!0)},500)},e(window).resize(this._windowHandler),this._$drawContainer.geographics({style:this._initOptions.drawStyle||{},doubleBuffer:!1}),this._options.drawStyle=this._$drawContainer.geographics("option","style"),this._$shapesContainer.geographics({style:this._initOptions.shapeStyle||{}}),this._createdGraphics=!0,this._options.shapeStyle=this._$shapesContainer.geographics("option","style"),this._initOptions&&(this._initOptions.tilingScheme!==t&&this._setOption("tilingScheme",this._initOptions.tilingScheme||null,!1),this._initOptions.services&&(this._options.services=e.merge([],this._initOptions.services)),this._initOptions.bboxMax&&(this._setOption("bboxMax",this._initOptions.bboxMax,!1),this._setOption("bbox",this._initOptions.bboxMax,!1)),this._initOptions.zoomMin!==t&&this._setOption("zoomMin",this._initOptions.zoomMin,!1),this._initOptions.zoomMax!==t&&this._setOption("zoomMax",this._initOptions.zoomMax,!1),this._initOptions.bbox&&this._setOption("bbox",this._initOptions.bbox,!1),this._initOptions.center&&this._setOption("center",this._initOptions.center,!1),this._initOptions.zoom!==t&&this._setOption("zoom",this._initOptions.zoom,!1)),e.templates(this._tmplLengthId,this._options.measureLabels.length),e.templates(this._tmplAreaId,this._options.measureLabels.area),this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]),this._createServices(),this._refresh(),this._created=!0},_setOption:function(n,r,i){if(n=="pixelSize")return;i=i===t||i,this._$elem.is(".geo-map")&&this._panFinalize();var s,o,u,a;switch(n){case"bbox":this._created&&this._clearInteractiveTimeout(),this._userGeodetic=e.geo.proj&&e.geo._isGeodetic(r),this._userGeodetic&&(r=e.geo.proj.fromGeodetic(r)),s=[r[0]+(r[2]-r[0])/2,r[1]+(r[3]-r[1])/2],o=Math.max(e.geo.width(r,!0)/this._contentBounds.width,e.geo.height(r,!0)/this._contentBounds.height),a=this._getZoom(s,o),this._options.tilingScheme?o=this._getPixelSize(Math.min(Math.max(a,this._options.zoomMin),this._options.zoomMax)):a<this._options.zoomMin?o=this._getPixelSize(this._options.zoomMin):a>this._options.zoomMax&&(o=this._getPixelSize(this._options.zoomMax)),this._created?(this._setInteractiveCenterAndSize(s,o),this._setInteractiveTimeout(!1)):this._setCenterAndSize(s,o,!1,i),r=this._getBbox(s,o);break;case"bboxMax":this._userGeodetic=e.geo.proj&&e.geo._isGeodetic(r);break;case"center":this._created&&this._clearInteractiveTimeout(),this._userGeodetic=e.geo.proj&&e.geo._isGeodetic(r),this._userGeodetic&&(r=e.geo.proj.fromGeodetic(r)),this._created?(this._setInteractiveCenterAndSize(r,this._pixelSizeInteractive),this._interactiveTransform(),this._setInteractiveTimeout(!1)):this._setCenterAndSize(r,this._pixelSize,!1,i);break;case"measureLabels":r=e.extend(this._options.measureLabels,r),e.templates(this._tmplLengthId,this._options.measureLabels.length),e.templates(this._tmplAreaId,this._options.measureLabels.area);break;case"drawStyle":this._$drawContainer&&(this._$drawContainer.geographics("option","style",r),r=this._$drawContainer.geographics("option","style"));break;case"shapeStyle":this._$elem.is(".geo-service")&&!this._createdGraphics&&this._createServiceGraphics(),this._createdGraphics&&(this._$shapesContainer.geographics("option","style",r),r=this._$shapesContainer.geographics("option","style"));break;case"mode":this._resetDrawing(),this._$eventTarget.css("cursor",this._options.cursors[r]);break;case"zoom":this._created?this._setZoom(r,!1,i):(r=Math.max(r,0),this._setCenterAndSize(this._center,this._getPixelSize(r),!1,i))}e.Widget.prototype._setOption.apply(this,arguments);switch(n){case"bbox":case"center":this._userGeodetic&&(this._options.bbox=e.geo.proj.toGeodetic(this._options.bbox),this._options.center=e.geo.proj.toGeodetic(this._center));break;case"tilingScheme":r!==null&&(this._pixelSizeMax=this._getPixelSize(0),this._centerMax=[r.origin[0]+this._pixelSizeMax*r.tileWidth/2,r.origin[1]+this._pixelSizeMax*r.tileHeight/2]);break;case"bboxMax":e.geo.proj&&e.geo._isGeodetic(r)?u=e.geo.proj.fromGeodetic(r):u=r,this._centerMax=e.geo.center(u),this._pixelSizeMax=Math.max(e.geo.width(u,!0)/this._contentBounds.width,e.geo.height(u,!0)/this._contentBounds.height);break;case"services":this._createServices(),i&&(this._refresh(),this._refreshAllShapes());break;case"shapeStyle":i&&this._createdGraphics&&(this._$shapesContainer.geographics("clear"),this._refreshShapes(this._$shapesContainer,this._graphicShapes,this._graphicShapes,this._graphicShapes))}},destroy:function(){if(this._$elem.is(".geo-service"))this._createdGraphics&&(this._$shapesContainer.geographics("destroy"),this._$shapesContainer=t,this._createdGraphics=!1);else{clearTimeout(this._timeoutInteractive),this._timeoutInteractive=null,this._created=!1,e(window).unbind("resize",this._windowHandler);for(var n=0;n<this._currentServices.length;n++)this._currentServices[n].serviceContainer.geomap("destroy"),e.geo._serviceTypes[this._currentServices[n].type].destroy(this,this._$servicesContainer,this._currentServices[n]);this._$shapesContainer.geographics("destroy"),this._$shapesContainer=t,this._createdGraphics=!1,this._$drawContainer.geographics("destroy"),this._$drawContainer=t,this._$existingChildren.detach(),this._$elem.html(""),this._$elem.append(this._$existingChildren),this._$elem.removeClass("geo-map")}e.Widget.prototype.destroy.apply(this,arguments)},toMap:function(t){return t=this._toMap(t),this._userGeodetic?e.geo.proj.toGeodetic(t):t},toPixel:function(t,n,r){return this._toPixel(e.geo.proj?e.geo.proj.fromGeodetic(t):t,n,r)},opacity:function(t,n){if(this._$elem.is(".geo-service"))this._$elem.closest(".geo-map").geomap("opacity",t,this._$elem);else if(t>=0||t<=1)for(var r=0;r<this._currentServices.length;r++){var i=this._currentServices[r];if(!n||i.serviceContainer[0]==n[0])i.style.opacity=t,i.serviceObject.style=e.extend({},i.serviceObject.style,i.style),e.geo._serviceTypes[i.type].opacity(this,i)}},toggle:function(n,r){if(this._$elem.is(".geo-service"))this._$elem.closest(".geo-map").geomap("toggle",n,this._$elem);else for(var i=0;i<this._currentServices.length;i++){var s=this._currentServices[i];if(!r||s.serviceContainer[0]==r[0])n===t&&(n=s.style.visibility!=="visible"),s.style.visibility=n?"visible":"hidden",s.serviceObject.style=e.extend({},s.serviceObject.style,s.style),s.serviceContainer.toggle(n),n&&e.geo._serviceTypes[s.type].refresh(this,s)}},zoom:function(e){e!==null&&this._setZoom(this._options.zoom+e,!1,!0)},refresh:function(e,t){this._$elem.is(".geo-service")?this._$elem.closest(".geo-map").geomap("refresh",e,this._$elem):(this._refresh(e,t),this._refreshAllShapes())},resize:function(t){var n=this._findMapSize(),r=n.width/2-this._contentBounds.width/2,i=n.height/2-this._contentBounds.height/2,s;this._contentBounds={x:parseInt(this._$elem.css("padding-left"),10),y:parseInt(this._$elem.css("padding-top"),10),width:n.width,height:n.height},this._$resizeContainer.css({width:n.width,height:n.height});for(s=0;s<this._currentServices.length;s++)e.geo._serviceTypes[this._currentServices[s].type].resize(this,this._currentServices[s]);this._$elem.find(".geo-graphics").css({width:n.width,height:n.height}).geographics("resize");for(s=0;s<this._drawPixels.length;s++)this._drawPixels[s][0]+=r,this._drawPixels[s][1]+=i;this._setCenterAndSize(this._center,this._pixelSize,t,!0)},append:function(n,r,i,s){if(n&&(e.isPlainObject(n)||e.isArray(n)&&n.length>0)){this._createdGraphics||this._createServiceGraphics();var o,u,a,f,l,c;e.isArray(n)?o=n:n.type=="FeatureCollection"?o=n.features:o=[n];for(a=1;a<arguments.length;a++)u=arguments[a],typeof u=="object"?f=u:typeof u=="number"||typeof u=="string"?l=u:typeof u=="boolean"&&(c=u);for(a=0;a<o.length;a++){if(o[a].type!="Point"){var h=e.geo.bbox(o[a]);e.geo.proj&&e.geo._isGeodetic(h)&&(h=e.geo.proj.fromGeodetic(h)),e.data(o[a],"geoBbox",h)}this._graphicShapes.push({shape:o[a],style:f,label:l})}if(c===t||c)this._$elem.is(".geo-service")?this._refresh(!1,this._$elem):this._refresh(),this._refreshAllShapes()}},empty:function(n){for(var r=0;r<this._graphicShapes.length;r++)e.removeData(this._graphicShapes[r].shape,"geoBbox");this._graphicShapes=[];if(n===t||n)this._$elem.is(".geo-service")?this._refresh(!1,this._$elem):this._refresh(),this._refreshAllShapes()},find:function(n,r){var i=e.isPlainObject(n),s=i?this._map.toPixel(n.coordinates):t,o=this._map._pixelSize*r,u=[],a,f,l,c=0;for(;c<this._graphicShapes.length;c++){a=this._graphicShapes[c];if(i)if(a.shape.type=="Point")e.geo.distance(a.shape,n)<=o&&u.push(a.shape);else{var h=e.data(a.shape,"geoBbox"),p={type:"Polygon",coordinates:[[[h[0],h[1]],[h[0],h[3]],[h[2],h[3]],[h[2],h[1]],[h[0],h[1]]]]},d={type:"Point",coordinates:e.geo.proj&&e.geo._isGeodetic(n.coordinates)?e.geo.proj.fromGeodetic(n.coordinates):n.coordinates};if(e.geo.distance(p,d,!0)<=o){f=e.geo._flatten(a.shape);for(l=0;l<f.length;l++)if(e.geo.distance(f[l],n)<=o){u.push(a.shape);break}}}else u.push(a.shape)}return this._$elem.is(".geo-map")&&this._$elem.find(".geo-service").each(function(){u=e.merge(u,e(this).geomap("find",n,r))}),u},remove:function(n,r){if(n&&(e.isPlainObject(n)||e.isArray(n)&&n.length>0)){var i=e.isArray(n)?n:[n],s;for(var o=0;o<this._graphicShapes.length;o++)e.inArray(this._graphicShapes[o].shape,i)>=0&&(e.removeData(n,"geoBbox"),s=this._graphicShapes.slice(o+1),this._graphicShapes.length=o,this._graphicShapes.push.apply(this._graphicShapes,s),o--);if(r===t||r)this._$elem.is(".geo-service")?this._refresh(!1,this._$elem):this._refresh(),this._refreshAllShapes()}},_getBbox:function(e,t){e=e||this._center,t=t||this._pixelSize;var n=this._contentBounds.width/2*t,r=this._contentBounds.height/2*t;return[e[0]-n,e[1]-r,e[0]+n,e[1]+r]},_setBbox:function(t,n,r){var i=[t[0]+(t[2]-t[0])/2,t[1]+(t[3]-t[1])/2],s=Math.max(e.geo.width(t,!0)/this._contentBounds.width,e.geo.height(t,!0)/this._contentBounds.height),o=this._getZoom(i,s);this._options.tilingScheme?s=this._getPixelSize(Math.min(Math.max(o,this._options.zoomMin),this._options.zoomMax)):o<this._options.zoomMin?s=this._getPixelSize(this._options.zoomMin):o>this._options.zoomMax&&(s=this._getPixelSize(this._options.zoomMax)),this._setInteractiveCenterAndSize(i,s),this._interactiveTransform()},_getBboxMax:function(){var e=this._contentBounds.width/2*this._pixelSizeMax,t=this._contentBounds.height/2*this._pixelSizeMax;return[this._centerMax[0]-e,this._centerMax[1]-t,this._centerMax[0]+e,this._centerMax[1]+t]},_getCenter:function(){return this._center},_getContentBounds:function(){return this._contentBounds},_getServicesContainer:function(){return this._$servicesContainer},_getZoom:function(t,n){t=t||this._center,n=n||this._pixelSize;var r=this._options.tilingScheme;if(r){if(r.pixelSizes){var i=Math.floor(n*1e3),s=r.pixelSizes.length,o=s-1;for(;o>=0;o--)if(Math.floor(r.pixelSizes[o]*1e3)>=i)return o;return 0}return Math.round(Math.log(r.basePixelSize/n)/Math.log(2))}var u=this._contentBounds.width/this._contentBounds.height,a=e.geo.reaspect(this._getBbox(t,n),u,!0),f=e.geo.reaspect(this._getBboxMax(),u,!0);return Math.round(Math.log(e.geo.width(f,!0)/e.geo.width(a,!0))/Math.log(this._zoomFactor))},_setZoom:function(e,t,n){this._clearInteractiveTimeout(),e=Math.min(Math.max(e,this._options.zoomMin),this._options.zoomMax),this._setInteractiveCenterAndSize(this._centerInteractive,this._getPixelSize(e)),this._interactiveTransform(),this._setInteractiveTimeout(t)},_createChildren:function(){this._$existingChildren=this._$elem.children(),this._forcePosition(this._$existingChildren),this._$existingChildren.detach().css({mozUserSelect:"none"});var t="width:"+this._contentBounds.width+"px; height:"+this._contentBounds.height+"px; margin:0; padding:0;",n="position:absolute; left:0; top:0;";this._$elem.prepend('<div class="geo-event-target geo-content-frame" style="position:absolute; left:'+this._contentBounds.x+"px; top:"+this._contentBounds.y+"px;"+t+'overflow:hidden; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none;" unselectable="on"></div>'),this._$eventTarget=this._$contentFrame=this._$elem.children(":first"),this._$contentFrame.append('<div class="geo-services-container" style="'+n+t+'"></div>'),this._$servicesContainer=this._$contentFrame.children(":last"),this._$contentFrame.append('<ul style="position: absolute; bottom: 8px; left: 8px; list-style-type: none; max-width: 50%; padding: 0; margin: 0;"></ul>'),this._$attrList=this._$contentFrame.children(":last"),this._$contentFrame.append('<div class="geo-draw-container" style="'+n+t+'"></div>'),this._$drawContainer=this._$contentFrame.children(":last"),this._$contentFrame.append('<div class="geo-measure-container" style="'+n+t+'"><span class="geo-measure-label" style="'+n+'; display: none;"></span></div>'),this._$measureContainer=this._$contentFrame.children(":last"),this._$measureLabel=this._$measureContainer.children(),this._$contentFrame.append('<div class="geo-shapes-container" style="'+n+t+'"></div>'),this._$shapesContainer=this._$contentFrame.children(":last"),this._$panContainer=e([this._$shapesContainer[0],this._$drawContainer[0],this._$measureContainer[0]]),this._$resizeContainer=e([this._$contentFrame[0],this._$servicesContainer[0],this._$eventTarget[0],this._$measureContainer[0]]),this._$contentFrame.append(this._$existingChildren),e("#geo-measure-style").length||e("head").prepend('<style type="text/css" id="geo-measure-style">.geo-measure-label { margin: 4px 0 0 6px; font-family: sans-serif;'+(r?"letter-spacing: 2px; color: #444; filter:progid:DXImageTransform.Microsoft.DropShadow(Color=white, OffX=1, OffY=2, Positive=true);":"color: #000; text-shadow: #fff 1px 2px; font-weight: bold;")+" }</style>")},_createServices:function(){var t,n;for(n=0;n<this._currentServices.length;n++)this._currentServices[n].serviceContainer.geomap("destroy"),e.geo._serviceTypes[this._currentServices[n].type].destroy(this,this._$servicesContainer,this._currentServices[n]);this._currentServices=[],this._$servicesContainer.html(""),this._$attrList.html("");for(n=0;n<this._options.services.length;n++){t=this._currentServices[n]=e.extend({},this._options.services[n]),t.serviceObject=this._options.services[n],t.style=e.extend({visibility:"visible",opacity:1},t.style);var r=t.id?' id="'+t.id+'"':"",i='class="geo-service '+(t["class"]?t["class"]:"")+'"',s="<div "+r+i+' style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:32px; height:32px; margin:0; padding:0; display:'+(t.style.visibility==="visible"?"block":"none")+';"></div>',o;this._$servicesContainer.append(s),serviceContainer=this._$servicesContainer.children(":last"),t.serviceContainer=serviceContainer,e.geo._serviceTypes[t.type].create(this,serviceContainer,t,n),serviceContainer.data("geoMap",this).geomap(),t.attr&&this._$attrList.append("<li>"+t.attr+"</li>")}this._$shapesContainers=this._$shapesContainer,this._$attrList.find("a").css({position:"relative",zIndex:100})},_createServiceGraphics:function(){var e=this._$elem.closest(".geo-content-frame");this._$elem.append('<div class="geo-shapes-container" style="position:absolute; left:0; top:0; width:'+e.css("width")+"; height:"+e.css("height")+'; margin:0; padding:0;"></div>'),this._$shapesContainer=this._$elem.children(":last"),this._map._$shapesContainers=this._map._$shapesContainers.add(this._$shapesContainer),this._$shapesContainer.geographics(),this._createdGraphics=!0,this._options.shapeStyle=this._$shapesContainer.geographics("option","style")},_refreshDrawing:function(){this._$drawContainer.geographics("clear");if(this._drawPixels.length>0){var t=this._options.mode,n=this._drawPixels,r=this._drawCoords,i,s,o,u,a;switch(t){case"measureLength":t="drawLineString",s={type:"LineString",coordinates:r},i=e.render[this._tmplLengthId]({length:e.geo.length(s,!0)}),o=e.merge([],n[n.length-1]);break;case"measureArea":t="drawPolygon",s={type:"Polygon",coordinates:[e.merge([],r)]},s.coordinates[0].push(r[0]),i=e.render[this._tmplAreaId]({area:e.geo.area(s,!0)}),o=this._toPixel(e.geo.centroid(s).coordinates),n=[n];break;case"drawPolygon":n=[n]}this._$drawContainer.geographics(t,n),i&&(this._$measureLabel.html(i),u=this._contentBounds.width-(this._$measureLabel.outerWidth(!0)+o[0]),a=this._contentBounds.height-(this._$measureLabel.outerHeight(!0)+o[1]),u<0&&(o[0]+=u),a<0&&(o[1]+=a),this._$measureLabel.css({left:Math.max(o[0],0),top:Math.max(o[1],0)}).show())}},_resetDrawing:function(){this._drawPixels=[],this._drawCoords=[],this._$drawContainer.geographics("clear"),this._$measureLabel.hide()},_refreshAllShapes:function(){this._timeoutRefreshShapes=null;var e,t,n=0;for(;n<this._currentServices.length;n++)e=this._currentServices[n],t=e.serviceContainer.data("geoService"),t._createdGraphics&&(t._$shapesContainer.geographics("clear"),t._graphicShapes.length>0&&t._refreshShapes(t._$shapesContainer,t._graphicShapes,t._graphicShapes,t._graphicShapes));this._createdGraphics&&(this._$shapesContainer.geographics("clear"),this._graphicShapes.length>0&&this._refreshShapes(this._$shapesContainer,this._graphicShapes,this._graphicShapes,this._graphicShapes))},_refreshShapes:function(n,r,i,s,o,u){var a,f,l,c,h,p,d,v,m=this._map._getBbox(o,u);for(a=0;a<r.length;a++){l=r[a].shape||r[a],l=l.geometry||l,c=e.data(l,"geoBbox");if(c&&e.geo._bboxDisjoint(m,c))continue;h=e.isArray(i)?i[a].style:i,p=e.isArray(s)?s[a].label:s,d=p!==t,v=t;switch(l.type){case"Point":v=this._map.toPixel(l.coordinates,o,u),this._$shapesContainer.geographics("drawPoint",v,h);break;case"LineString":this._$shapesContainer.geographics("drawLineString",this._map.toPixel(l.coordinates,o,u),h),d&&(v=this._map.toPixel(e.geo.pointAlong(l,.5).coordinates,o,u));break;case"Polygon":this._$shapesContainer.geographics("drawPolygon",this._map.toPixel(l.coordinates,o,u),h),d&&(v=this._map.toPixel(e.geo.centroid(l).coordinates,o,u));break;case"MultiPoint":for(f=0;f<l.coordinates.length;f++)this._$shapesContainer.geographics("drawPoint",this._map.toPixel(l.coordinates[f],o,u),h);d&&(v=this._map.toPixel(e.geo.centroid(l).coordinates,o,u));break;case"MultiLineString":for(f=0;f<l.coordinates.length;f++)this._$shapesContainer.geographics("drawLineString",this._map.toPixel(l.coordinates[f],o,u),h);d&&(v=this._map.toPixel(e.geo.centroid(l).coordinates,o,u));break;case"MultiPolygon":for(f=0;f<l.coordinates.length;f++)this._$shapesContainer.geographics("drawPolygon",this._map.toPixel(l.coordinates[f],o,u),h);d&&(v=this._map.toPixel(e.geo.centroid(l).coordinates,o,u));break;case"GeometryCollection":this._refreshShapes(n,l.geometries,h,p,o,u)}d&&v&&this._$shapesContainer.geographics("drawLabel",v,p)}},_findMapSize:function(){var e={width:0,height:0},t=this._$elem;while(t.size()&&!(e.width>0&&e.height>0)){e={width:t.width(),height:t.height()};if(e.width<=0||e.height<=0)e={width:parseInt(t.css("width"),10),height:parseInt(t.css("height"),10)};t=t.parent()}return e},_forcePosition:function(e){var t=e.css("position");t!="relative"&&t!="absolute"&&t!="fixed"&&e.css("position","relative")},_getPixelSize:function(t){var n=this._options.tilingScheme;if(n!==null){if(t===0)return n.pixelSizes?n.pixelSizes[0]:n.basePixelSize;t=Math.round(t),t=Math.max(t,0);var r=n.pixelSizes?n.pixelSizes.length:n.levels;return t=Math.min(t,r-1),n.pixelSizes?n.pixelSizes[t]:n.basePixelSize/Math.pow(2,t)}var i=e.geo.scaleBy(this._getBboxMax(),1/Math.pow(this._zoomFactor,t),!0);return Math.max(e.geo.width(i,!0)/this._contentBounds.width,e.geo.height(i,!0)/this._contentBounds.height)},_getZoomCenterAndSize:function(e,t,n){var r=n?this._fullZoomFactor:this._partialZoomFactor,i=Math.pow(r,-t),s=this._pixelSizeInteractive*i,o=this._getZoom(this._centerInteractive,s);n&&this._options.tilingScheme?s=this._getPixelSize(Math.min(Math.max(o,this._options.zoomMin),this._options.zoomMax)):t<0&&o<this._options.zoomMin?s=this._pixelSizeInteractive:t>0&&o>this._options.zoomMax&&(s=this._pixelSizeInteractive);var u=s/this._pixelSizeInteractive,a=this._toMap(e,this._centerInteractive,this._pixelSizeInteractive),f=[(this._centerInteractive[0]-a[0])*u,(this._centerInteractive[1]-a[1])*u],l=[a[0]+f[0],a[1]+f[1]];return{pixelSize:s,center:l}},_mouseWheelFinish:function(e){this._wheelTimeout=null;if(this._wheelLevel!==0){var t=this._getZoomCenterAndSize(this._anchor,this._wheelLevel,this._options.tilingScheme!==null);this._wheelLevel=0}else e&&(this._refresh(),this._refreshAllShapes())},_panFinalize:function(){if(this._panning){this._velocity=[0,0];var e=this._current[0]-this._anchor[0],t=this._current[1]-this._anchor[1],n=this._options.axisLayout==="image",r=-e*this._pixelSize,i=(n?-1:1)*t*this._pixelSize;this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]),this._inOp=!1,this._anchor=this._current,this._mouseDown=this._toolPan=this._panning=!1}},_panMove:function(){if(!this._options.pannable)return;var e=this._current[0]-this._lastDrag[0],t=this._current[1]-this._lastDrag[1],n=0,r,i;if(this._toolPan||e>3||e<-3||t>3||t<-3){this._toolPan||(this._toolPan=!0,this._$eventTarget.css("cursor",this._options.cursors.pan)),this._mouseDown&&(this._velocity=[e,t]);if(e!==0||t!==0)this._panning=!0,this._lastDrag=this._current,this._centerInteractive[0]-=e*this._pixelSizeInteractive,this._centerInteractive[1]+=(this._options.axisLayout==="image"?-1:1)*t*this._pixelSizeInteractive,this._setInteractiveCenterAndSize(this._centerInteractive,this._pixelSizeInteractive),this._interactiveTransform()}},_clearInteractiveTimeout:function(){return this._timeoutRefreshShapes&&(clearTimeout(this._timeoutRefreshShapes),this._timeoutRefreshShapes=null),this._timeoutInteractive?(clearTimeout(this._timeoutInteractive),this._timeoutInteractive=null,!0):(this._centerInteractive[0]=this._center[0],this._centerInteractive[1]=this._center[1],this._pixelSizeInteractive=this._pixelSize,!1)},_interactiveTransform:function(){var t=this._contentBounds.width,n=this._contentBounds.height,r=t/2,i=n/2,s=[this._centerInteractive[0]-r,this._centerInteractive[1]-i,this._centerInteractive[0]+r,this._centerInteractive[1]+i],o=this._pixelSize,u=o/this._pixelSizeInteractive;if(o>0){u=Math.round(u*1e3)/1e3;var a=this._toMap([0,0]),f=this._toPixel(a,this._centerInteractive,this._pixelSizeInteractive);this._$shapesContainers.geographics("interactiveTransform",f,u)}for(var l=0;l<this._currentServices.length;l++)service=this._currentServices[l],e.geo._serviceTypes[service.type].interactiveTransform(this,service,this._centerInteractive,this._pixelSizeInteractive);this._drawCoords.length>0&&(this._drawPixels=this._toPixel(this._drawCoords,this._centerInteractive,this._pixelSizeInteractive),this._refreshDrawing())},_interactiveTimeout:function(){this._isMultiTouch?this._timeoutInteractive=setTimeout(e.proxy(interactiveTimeout,this),128):this._created&&this._timeoutInteractive&&(this._setCenterAndSize(this._centerInteractive,this._pixelSizeInteractive,this._triggerInteractive,!0),this._timeoutInteractive=null,this._triggerInteractive=!1,this._timeoutRefreshShapes=setTimeout(e.proxy(this._refreshAllShapes,this),128))},_setInteractiveTimeout:function(t){this._timeoutInteractive=setTimeout(e.proxy(this._interactiveTimeout,this),128),this._triggerInteractive|=t},_refresh:function(t,n){var r,i=0;for(;i<this._currentServices.length;i++)r=this._currentServices[i],(!n||r.serviceContainer[0]==n[0])&&e.geo._serviceTypes[r.type].refresh(this,r,t)},_setInteractiveCenterAndSize:function(t,n){this._centerInteractive[0]=t[0],this._centerInteractive[1]=t[1],this._pixelSizeInteractive=n,this._userGeodetic?(this._options.bbox=e.geo.proj.toGeodetic(this._getBbox(t,n)),this._options.center=e.geo.proj.toGeodetic(t)):(this._options.bbox=this._getBbox(t,n),this._options.center[0]=t[0],this._options.center[1]=t[1]),this._options.pixelSize=n,this._options.zoom=this._getZoom(t,n)},_setCenterAndSize:function(t,n,r,i){if(!e.isArray(t)||t.length!=2||typeof t[0]!="number"||typeof t[1]!="number")return;var s=this._getZoom(t,n);this._options.tilingScheme?this._pixelSizeInteractive=n=this._getPixelSize(Math.min(Math.max(s,this._options.zoomMin),this._options.zoomMax)):s<this._options.zoomMin?this._pixelSizeInteractive=n=this._getPixelSize(this._options.zoomMin):s>this._options.zoomMax&&(this._pixelSizeInteractive=n=this._getPixelSize(this._options.zoomMax)),this._center[0]=t[0],this._center[1]=t[1],this._options.pixelSize=this._pixelSize=n,this._userGeodetic?(this._options.bbox=e.geo.proj.toGeodetic(this._getBbox()),this._options.center=e.geo.proj.toGeodetic(this._center)):(this._options.bbox=this._getBbox(),this._options.center=e.merge([],t)),this._options.zoom=s,r&&this._trigger("bboxchange",window.event,{bbox:e.merge([],this._options.bbox)}),i&&(this._refresh(),this._refreshAllShapes(),this._refreshDrawing())},_requestQueued:function(){this._loadCount===0&&this._trigger("loadstart",window.event),this._loadCount++},_requestComplete:function(){this._loadCount--,this._loadCount<=0&&(this._loadCount=0,this._trigger("loadend",window.event))},_toMap:function(t,n,r){n=n||this._center,r=r||this._pixelSize;var i=e.isArray(t[0]),s=i&&e.isArray(t[0][0]),o=s&&e.isArray(t[0][0][0]),u=this._contentBounds.width,a=this._contentBounds.height,f=u/2*r,l=a/2*r,c=[n[0]-f,n[1]-l,n[0]+f,n[1]+l],h=e.geo.width(c,!0)/u,p=e.geo.height(c,!0)/a,d,v=this._options.axisLayout==="image",m=[],g,y,b;o||(s||(i||(t=[t]),t=[t]),t=[t]);for(g=0;g<t.length;g++){m[g]=[];for(y=0;y<t[g].length;y++){m[g][y]=[];for(b=0;b<t[g][y].length;b++)d=t[g][y][b][1]*p,m[g][y][b]=[c[0]+t[g][y][b][0]*h,v?c[1]+d:c[3]-d]}}return o?m:s?m[0]:i?m[0][0]:m[0][0][0]},_toPixel:function(t,n,r){n=n||this._center,r=r||this._pixelSize;var i=e.isArray(t[0]),s=i&&e.isArray(t[0][0]),o=s&&e.isArray(t[0][0][0]),u=this._contentBounds.width,a=this._contentBounds.height,f=u/2*r,l=a/2*r,c=[n[0]-f,n[1]-l,n[0]+f,n[1]+l],h=e.geo.width(c,!0),p=e.geo.height(c,!0),d=this._options.axisLayout==="image",v=u/h,m=a/p,g=[],y,b,w;o||(s||(i||(t=[t]),t=[t]),t=[t]);for(y=0;y<t.length;y++){g[y]=[];for(b=0;b<t[y].length;b++){g[y][b]=[];for(w=0;w<t[y][b].length;w++)g[y][b][w]=[Math.round((t[y][b][w][0]-c[0])*v),Math.round((d?t[y][b][w][1]-c[1]:c[3]-t[y][b][w][1])*m)]}}return o?g:s?g[0]:i?g[0][0]:g[0][0][0]},_document_keydown:function(t){var n=this._drawCoords.length;n>0&&t.which==27&&(n<=2?(this._resetDrawing(),this._inOp=!1):(this._drawCoords[n-2]=e.merge([],this._drawCoords[n-1]),this._drawPixels[n-2]=e.merge([],this._drawPixels[n-1]),this._drawCoords.length--,this._drawPixels.length--,this._refreshDrawing()))},_eventTarget_dblclick_zoom:function(e){var t=this._clearInteractiveTimeout();this._trigger("dblclick",e,{type:"Point",coordinates:this._toMap(this._current,this._centerInteractive,this._pixelSizeInteractive)});if(!e.isDefaultPrevented()){var n=this._getZoomCenterAndSize(this._current,1,!0);this._setInteractiveCenterAndSize(n.center,n.pixelSize),this._interactiveTransform(),t=!0}t&&this._setInteractiveTimeout(!0)},_eventTarget_dblclick:function(t){if(this._options.mode==="static")return;this._drawTimeout&&(window.clearTimeout(this._drawTimeout),this._drawTimeout=null);var n=e(t.currentTarget).offset();switch(this._options.mode){case"drawLineString":case"measureLength":this._drawCoords.length>1&&(this._drawCoords[0][0]!=this._drawCoords[1][0]||this._drawCoords[0][1]!=this._drawCoords[1][1])?(this._drawCoords.length--,this._trigger("shape",t,{type:"LineString",coordinates:this._userGeodetic?e.geo.proj.toGeodetic(this._drawCoords):this._drawCoords})):this._eventTarget_dblclick_zoom(t),this._resetDrawing();break;case"drawPolygon":case"measureArea":if(this._drawCoords.length>1&&(this._drawCoords[0][0]!=this._drawCoords[1][0]||this._drawCoords[0][1]!=this._drawCoords[1][1])){var r=this._drawCoords.length-1;r>2&&(this._drawCoords[r]=e.merge([],this._drawCoords[0]),this._trigger("shape",t,{type:"Polygon",coordinates:[this._userGeodetic?e.geo.proj.toGeodetic(this._drawCoords):this._drawCoords]}))}else this._eventTarget_dblclick_zoom(t);this._resetDrawing();break;default:this._eventTarget_dblclick_zoom(t)}this._inOp=!1},_eventTarget_touchstart:function(t){if(typeof document.elementFromPoint!="undefined"&&document.elementFromPoint(t.pageX,t.pageY).nodeName==="A")return;var n=this._options.mode,r=this._options.shift,i=n==="dragBox"?"dragBox":"zoom";if(n==="static")return;if(!this._supportTouch&&t.which!=1)return;var s=this._clearInteractiveTimeout(),o=e(t.currentTarget).offset(),u=t.originalEvent.changedTouches;this._supportTouch?(this._multiTouchAnchor=e.merge([],u),this._isMultiTouch=this._multiTouchAnchor.length>1,this._isMultiTouch?(this._multiTouchCurrentBbox=[u[0].pageX-o.left,u[0].pageY-o.top,u[1].pageX-o.left,u[1].pageY-o.top],this._multiTouchAnchorBbox=e.merge([],this._multiTouchCurrentBbox),this._current=e.geo.center(this._multiTouchCurrentBbox,!0)):(this._multiTouchCurrentBbox=[u[0].pageX-o.left,u[0].pageY-o.top,NaN,NaN],this._current=[u[0].pageX-o.left,u[0].pageY-o.top])):this._current=[t.pageX-o.left,t.pageY-o.top];if(this._softDblClick){var a=e.now();if(a-this._downDate<750){if(this._isTap){var f=this._current[0]-this._anchor[0],l=this._current[1]-this._anchor[1],c=Math.sqrt(f*f+l*l);c>8?this._isTap=!1:this._current=e.merge([],this._anchor)}this._isDbltap?this._isDbltap=!1:this._isDbltap=this._isTap}else this._isDbltap=!1;this._isTap=!0,this._downDate=a}return this._mouseDown=!0,this._anchor=e.merge([],this._current),!this._inOp&&t.shiftKey&&r!=="off"?(this._shiftDown=!0,this._$eventTarget.css("cursor",this._options.cursors[r==="default"?i:r])):!this._isMultiTouch&&(this._options.pannable||n==="dragBox"||n==="dragCircle")&&(this._inOp=!0,n!=="zoom"&&n!=="dragBox"&&n!=="dragCircle"&&(this._lastDrag=this._current,t.currentTarget.setCapture&&t.currentTarget.setCapture())),t.preventDefault(),s&&this._setInteractiveTimeout(!0),!1},_dragTarget_touchmove:function(t){if(this._options.mode==="static")return;var n=!1;this._mouseDown&&(n=this._clearInteractiveTimeout());var i=this._$eventTarget.offset(),s=this._drawCoords.length,o=t.originalEvent.changedTouches,u,a,f=0;if(this._supportTouch){if(!this._isMultiTouch&&this._mouseDown&&this._multiTouchAnchor.length>0&&o[0].identifier!==this._multiTouchAnchor[0].identifier)return this._mouseDown=!1,this._isMultiTouch=!0,this._wheelLevel=0,this._multiTouchAnchor.push(o[0]),this._multiTouchCurrentBbox=[this._multiTouchCurrentBbox[0],this._multiTouchCurrentBbox[1],this._multiTouchAnchor[1].pageX-i.left,this._multiTouchAnchor[1].pageY-i.top],this._multiTouchAnchorBbox=e.merge([],this._multiTouchCurrentBbox),this._mouseDown=!0,this._anchor=this._current=e.geo.center(this._multiTouchCurrentBbox,!0),n&&this._setInteractiveTimeout(!0),!1;if(this._isMultiTouch){for(;f<o.length;f++)o[f].identifier===this._multiTouchAnchor[0].identifier?(this._multiTouchCurrentBbox[0]=o[f].pageX-i.left,this._multiTouchCurrentBbox[1]=o[f].pageY-i.top):o[f].identifier===this._multiTouchAnchor[1].identifier&&(this._multiTouchCurrentBbox[2]=o[f].pageX-i.left,this._multiTouchCurrentBbox[3]=o[f].pageY-i.top);var l=e.geo._distancePointPoint([this._multiTouchAnchorBbox[0],this._multiTouchAnchorBbox[1]],[this._multiTouchAnchorBbox[2],this._multiTouchAnchorBbox[3]]),c=e.geo._distancePointPoint([this._multiTouchCurrentBbox[0],this._multiTouchCurrentBbox[1]],[this._multiTouchCurrentBbox[2],this._multiTouchCurrentBbox[3]]);u=e.geo.center(this._multiTouchCurrentBbox,!0);var h=(c-l)/l;h>0?h*=5:h*=10;var p=h-this._wheelLevel;this._wheelLevel=h;var d=this._getZoomCenterAndSize(this._anchor,p,!1);this._setInteractiveCenterAndSize(d.center,d.pixelSize),this._interactiveTransform(),n=!0,u=e.geo.center(this._multiTouchCurrentBbox,!0)}else u=[t.originalEvent.changedTouches[0].pageX-i.left,t.originalEvent.changedTouches[0].pageY-i.top]}else u=[t.pageX-i.left,t.pageY-i.top];if(u[0]===this._lastMove[0]&&u[1]===this._lastMove[1]&&this._inOp)return t.preventDefault(),n&&this._setInteractiveTimeout(!0),!1;r==7&&(this._isDbltap=this._isTap=!1),this._mouseDown&&(this._current=u,this._moveDate=e.now());if(this._isMultiTouch)return t.preventDefault(),this._isDbltap=this._isTap=!1,n&&this._setInteractiveTimeout(!0),!1;var v=this._options.mode,m=this._options.shift,g=v==="dragBox"?"dragBox":"zoom",y,b,w;this._shiftDown&&(v=m==="default"?g:m);switch(v){case"zoom":case"dragBox":this._mouseDown?(this._$drawContainer.geographics("clear"),this._$drawContainer.geographics("drawBbox",[this._anchor[0],this._anchor[1],u[0],u[1]])):this._trigger("move",t,{type:"Point",coordinates:this.toMap(u)});break;case"dragCircle":this._mouseDown?(y=u[0]-this._anchor[0],b=u[1]-this._anchor[1],w=Math.sqrt(y*y+b*b)*2,this._$drawContainer.geographics("clear"),this._$drawContainer.geographics("drawArc",this._anchor,0,360,{width:w,height:w})):this._trigger("move",t,{type:"Point",coordinates:this.toMap(u)});break;case"drawLineString":case"drawPolygon":case"measureLength":case"measureArea":this._mouseDown||this._toolPan?(this._panMove(),n=!0):(s>0&&(this._drawCoords[s-1]=this._toMap(u,this._centerInteractive,this._pixelSizeInteractive),this._drawPixels[s-1]=u,this._refreshDrawing()),this._trigger("move",t,{type:"Point",coordinates:this.toMap(u)}));break;default:this._mouseDown||this._toolPan?(this._panMove(),n=!0):this._trigger("move",t,{type:"Point",coordinates:this.toMap(u)})}this._lastMove=u,n&&this._setInteractiveTimeout(!0);if(this._inOp)return t.preventDefault(),!1},_dragTarget_touchstop:function(t){if(this._options.mode==="static")return;if(!this._mouseDown){if(r!=7)return;this._eventTarget_touchstart(t)}var n=this._clearInteractiveTimeout(),i=this._mouseDown,s=this._toolPan,o=this._$eventTarget.offset(),u=this._options.mode,a=this._options.shift,f=u==="dragBox"?"dragBox":"zoom",l,c,h,p,d,v,m;this._shiftDown&&(u=a==="default"?f:a),this._supportTouch?(l=[t.originalEvent.changedTouches[0].pageX-o.left,t.originalEvent.changedTouches[0].pageY-o.top],this._multiTouchAnchor=[],this._inOp=!1):l=[t.pageX-o.left,t.pageY-o.top],this._softDblClick&&this._isTap&&(p=l[0]-this._anchor[0],d=l[1]-this._anchor[1],Math.sqrt(p*p+d*d)<=8&&(l=e.merge([],this._anchor))),p=l[0]-this._anchor[0],d=l[1]-this._anchor[1],this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]),this._shiftDown=this._mouseDown=this._toolPan=!1;if(this._isMultiTouch){t.preventDefault(),this._isMultiTouch=!1,this._wheelLevel=0,n&&this._setInteractiveTimeout(!0);return}document.releaseCapture&&document.releaseCapture();if(i){h=e.now(),this._current=l;switch(u){case"zoom":case"dragBox":if(p!==0||d!==0){var g=this._pixelSize*6,y=this._toMap([[Math.min(this._anchor[0],l[0]),Math.max(this._anchor[1],l[1])],[Math.max(this._anchor[0],l[0]),Math.min(this._anchor[1],l[1])]]),b=[y[0][0],y[0][1],y[1][0],y[1][1]];u==="zoom"?(b[2]-b[0]<g&&b[3]-b[1]<g&&(b=e.geo.scaleBy(this._getBbox(e.geo.center(b,!0)),.5,!0)),this._setBbox(b,!0,!0),n=!0):(m=e.geo.polygonize(b,!0),m.bbox=b,this._userGeodetic&&(m.coordinates=e.geo.proj.toGeodetic(m.coordinates),m.bbox=e.geo.proj.toGeodetic(m.bbox)),this._trigger("shape",t,m))}else u==="dragBox"&&(v=this._toMap(l),m={type:"Point",coordinates:[v[0],v[1]],bbox:[v[0],v[1],v[0],v[1]]},this._userGeodetic&&(m.coordinates=e.geo.proj.toGeodetic(m.coordinates),m.bbox=e.geo.proj.toGeodetic(m.bbox)),this._trigger("shape",t,m));this._resetDrawing();break;case"dragCircle":if(p!==0||d!==0){var w=this._options.axisLayout==="image",E=Math.sqrt(p*p+d*d),S=180,x;this._drawPixels.length=S+1;for(c=0;c<S;c++)x=c*360/S*(Math.PI/180),this._drawPixels[c]=[this._anchor[0]+Math.cos(x)*E,this._anchor[1]+Math.sin(x)*E];this._drawPixels[S]=[this._drawPixels[0][0],this._drawPixels[0][1]],v=this._toMap([[this._anchor[0]-E,this._anchor[1]+(w?-E:E)],[this._anchor[0]+E,this._anchor[1]+(w?E:-E)]]),m={type:"Polygon",coordinates:[this._toMap(this._drawPixels)],bbox:[v[0][0],v[0][1],v[1][0],v[1][1]]},this._userGeodetic&&(m.coordinates=e.geo.proj.toGeodetic(m.coordinates),m.bbox=e.geo.proj.toGeodetic(m.bbox)),this._trigger("shape",t,m),this._resetDrawing()}else v=this._toMap(l),m={type:"Point",coordinates:[v[0],v[1]],bbox:[v[0],v[1],v[0],v[1]]},this._userGeodetic&&(m.coordinates=e.geo.proj.toGeodetic(m.coordinates),m.bbox=e.geo.proj.toGeodetic(m.bbox)),this._trigger("shape",t,m);break;case"drawPoint":this._drawTimeout&&(window.clearTimeout(this._drawTimeout),this._drawTimeout=null);if(s)this._panFinalize();else if(h-this._clickDate>100){var T=this;this._drawTimeout=setTimeout(function(){T._drawTimeout&&(T._trigger("shape",t,{type:"Point",coordinates:T.toMap(l)}),T._inOp=!1,T._drawTimeout=null)},250)}break;case"drawLineString":case"drawPolygon":case"measureLength":case"measureArea":if(s)this._panFinalize();else{c=this._drawCoords.length===0?0:this._drawCoords.length-1,this._drawCoords[c]=this._toMap(l),this._drawPixels[c]=l;if(c<2||this._drawCoords[c][0]!=this._drawCoords[c-1][0]||this._drawCoords[c][1]!=this._drawCoords[c-1][1])this._drawCoords[c+1]=this._toMap(l,this._centerInteractive,this._pixelSizeInteractive),this._drawPixels[c+1]=l;this._refreshDrawing()}break;default:s?this._panFinalize():h-this._clickDate>100&&(this._trigger("click",t,{type:"Point",coordinates:this.toMap(l)}),this._inOp=!1)}this._clickDate=h;if(this._softDblClick&&this._isDbltap)return this._isDbltap=this._isTap=!1,n&&this._setInteractiveTimeout(!0),this._$eventTarget.trigger("dblclick",t),!1}n&&this._setInteractiveTimeout(!0);if(this._inOp)return t.preventDefault(),!1},_eventTarget_mousewheel:function(t,n){if(this._options.mode==="static"||this._options.scroll==="off")return;t.preventDefault();if(this._mouseDown)return!1;if(n!==0){this._clearInteractiveTimeout(),n>0?n=Math.ceil(n):n=Math.floor(n);var r=e(t.currentTarget).offset();this._anchor=[t.pageX-r.left,t.pageY-r.top];var i=this._getZoomCenterAndSize(this._anchor,n,this._options.tilingScheme!==null),s,o=0;this._setInteractiveCenterAndSize(i.center,i.pixelSize),this._interactiveTransform(),this._setInteractiveTimeout(!0)}return!1}})}(jQuery),function(e,t){e.geo._serviceTypes.tiled=function(){return{create:function(t,n,r,i){var s=e.data(r,"geoServiceState");if(!s){s={loadCount:0,reloadTiles:!1};var o='<div data-geo-service="tiled" style="-webkit-transform:translateZ(0); position:absolute; left:0; top:0; width:8px; height:8px; margin:0; padding:0;"></div>';n.append(o),s.serviceContainer=n.children(":last"),e.data(r,"geoServiceState",s)}return s.serviceContainer},destroy:function(t,n,r){var i=e.data(r,"geoServiceState");i.serviceContainer.remove(),e.removeData(r,"geoServiceState")},interactiveTransform:function(t,n,r,i){var s=e.data(n,"geoServiceState"),o=t.options.tilingScheme;s&&(this._cancelUnloaded(t,n),s.serviceContainer.children().each(function(n){var s=e(this),u=s.data("pixelSize"),a=u/i;if(u>0){a=Math.round(a*1e3)/1e3;var f=s.data("scaleOrigin"),l=t._toPixel(f,r,i);s.css({left:Math.round(l[0])+"px",top:Math.round(l[1])+"px",width:o.tileWidth*a,height:o.tileHeight*a})}}))},refresh:function(t,n,r){var i=e.data(n,"geoServiceState");this._cancelUnloaded(t,n),i&&r&&(i.reloadTiles=!0);if(i&&n&&n.style.visibility==="visible"&&!i.serviceContainer.is(":hidden")){var s=t._getBbox(),o=t._pixelSize,u=this,a=i.serviceContainer,f=t._getContentBounds(),l=f.width,c=f.height,h=t.options.axisLayout==="image",p=h?1:-1,d=t.options.tilingScheme,v=d.tileWidth,m=d.tileHeight,g=Math.floor((s[0]-d.origin[0])/(o*v)),y=Math.max(Math.floor((h?s[1]-d.origin[1]:d.origin[1]-s[3])/(o*m)),0),b=Math.ceil((s[2]-d.origin[0])/(o*v)),w=Math.ceil((h?s[3]-d.origin[1]:d.origin[1]-s[1])/(o*m)),E=t._getBboxMax(),S=t._getPixelSize(0),x=S/o,T=Math.floor((E[0]-d.origin[0])/(S*v))*x,N=Math.floor((d.origin[1]+p*E[3])/(S*m))*x,C=d.origin[0]+T*v*o,k=d.origin[1]+p*N*m*o,L=Math.round((C-s[0])/o),A=Math.round((h?k-s[1]:s[3]-k)/o),O=a.children().show(),M=O.filter("[data-pixel-size='"+o+"']").appendTo(a),_=n.style.opacity,D,P,H=function(n){u._loadImage(e.data(this,"img"),n,o,t,i,_)},B=function(){e.data(this,"img").remove(),i.loadCount--,t._requestComplete()};i.reloadTiles&&O.find("img").attr("data-dirty","true"),M.size()?(M.css({left:L%v+"px",top:A%m+"px"}).data("scaleOrigin",t._toMap([L%v,A%m])),M.children().each(function(t){var n=e(this),r=n.attr("data-tile").split(",");n.css({left:Math.round((parseInt(r[0],10)-T)*100+(L-L%v)/v*100)+"%",top:Math.round((parseInt(r[1],10)-N)*100+(A-A%m)/m*100)+"%"}),_<1&&n.fadeTo(0,_)})):(a.append("<div style='-webkit-transform:translateZ(0);position:absolute; left:"+L%v+"px; top:"+A%m+"px; width:"+v+"px; height:"+m+"px; margin:0; padding:0;' data-pixel-size='"+o+"'></div>"),M=a.children(":last").data("scaleOrigin",t._toMap([L%v,A%m])));for(D=g;D<b;D++)for(P=y;P<w;P++){var j=""+D+","+P,F=M.children("[data-tile='"+j+"']").removeAttr("data-dirty");if(F.size()===0||i.reloadTiles){var I=[d.origin[0]+D*v*o,d.origin[1]+p*P*m*o],q=[d.origin[0]+((D+1)*v-1)*o,d.origin[1]+p*((P+1)*m-1)*o],R=[I[0],I[1],q[0],q[1]],U=n.hasOwnProperty("src")?"src":"getUrl",z={bbox:R,width:v,height:m,zoom:t._getZoom(),tile:{row:P,column:D},index:Math.abs(P+D)},W=e.isFunction(n[U]),X;W?X=n[U](z):(e.templates("geoSrc",n[U]),X=e.render.geoSrc(z)),i.loadCount++,t._requestQueued();if(i.reloadTiles&&F.size()>0)F.attr("src",X);else{var V="<img style='-webkit-transform:translateZ(0);position:absolute; left:"+((D-T)*100+(L-L%v)/v*100)+"%; "+"top:"+((P-N)*100+(A-A%m)/m*100)+"%; ";V+="width: 100%; height: 100%;",V+="margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;' unselectable='on' data-tile='"+j+"' />",M.append(V),F=M.children(":last")}typeof X=="string"?u._loadImage(F,X,o,t,i,_):X?(e.data(X,"img",F),X.done(H).fail(B)):F.remove()}}O.find("[data-dirty]").remove(),i.reloadTiles=!1}},resize:function(e,t){},opacity:function(t,n){var r=e.data(n,"geoServiceState");r.serviceContainer.find("img").stop(!0).fadeTo("fast",n.style.opacity)},toggle:function(t,n){var r=e.data(n,"geoServiceState");r.serviceContainer.css("display",n.style.visibility==="visible"?"block":"none")},_cancelUnloaded:function(t,n){var r=e.data(n,"geoServiceState");if(r&&r.loadCount>0){r.serviceContainer.find("img:hidden").remove();while(r.loadCount>0)r.loadCount--,t._requestComplete()}},_loadImage:function(t,n,r,i,s,o){var u=s.serviceContainer;t.load(function(t){o<1?e(t.target).fadeTo(0,o):e(t.target).show(),s.loadCount--,i._requestComplete(),s.loadCount<=0&&(u.children(":not([data-pixel-size='"+r+"'])").remove(),s.loadCount=0)}).error(function(t){e(t.target).remove(),s.loadCount--,i._requestComplete(),s.loadCount<=0&&(u.children(":not([data-pixel-size='"+r+"'])").remove(),s.loadCount=0)}).attr("src",n)}}}()}(jQuery),function(e,t){e.geo._serviceTypes.shingled=function(){return{create:function(t,n,r,i){var s=e.data(r,"geoServiceState");if(!s){s={loadCount:0};var o='<div data-geo-service="shingled" style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:16px; height:16px; margin:0; padding:0;"></div>';n.append(o),s.serviceContainer=n.children(":last"),e.data(r,"geoServiceState",s)}return s.serviceContainer},destroy:function(t,n,r){var i=e.data(r,"geoServiceState");i.serviceContainer.remove(),e.removeData(r,"geoServiceState")},interactiveTransform:function(t,n,r,i){var s=e.data(n,"geoServiceState"),o=t._getContentBounds(),u=o.width,a=o.height,f=u/2,l=a/2,c=[r[0]-f,r[1]-l,r[0]+f,r[1]+l];s&&(this._cancelUnloaded(t,n),s.serviceContainer.children().each(function(n){var s=e(this),o=s.data("pixelSize"),f=o/i;if(o>0){f=Math.round(f*1e3)/1e3;var l=s.data("origin"),c=t._toPixel(l,r,i);s.css({left:Math.round(c[0]),top:Math.round(c[1]),width:u*f,height:a*f})}}))},refresh:function(t,n){var r=e.data(n,"geoServiceState");this._cancelUnloaded(t,n);if(r&&n&&n.style.visibility==="visible"&&!r.serviceContainer.is(":hidden")){var i=t._getBbox(),s=t._pixelSize,o=this,u=r.serviceContainer,a=t._getContentBounds(),f=a.width,l=a.height,c=u.children('[data-pixel-size="'+s+'"]'),h=n.style.opacity,p;h<1&&u.find("img").attr("data-keep-alive","0"),c.size()||(u.append('<div style="-webkit-transform:translateZ(0);position:absolute; left:0px; top: 0px; width:'+f+"px; height:"+l+'px; margin:0; padding:0;" data-pixel-size="'+s+'" data-origin="['+t._toMap([0,0])+']"></div>'),c=u.children(":last"));var d=n.hasOwnProperty("src")?"src":"getUrl",v={bbox:i,width:f,height:l,zoom:t._getZoom(),tile:null,index:0},m=e.isFunction(n[d]),g,y=c.position();y.left=-y.left,y.top=-y.top,m?g=n[d](v):(e.templates("geoSrc",n[d]),g=e.render.geoSrc(v)),r.loadCount++,t._requestQueued(),c.append('<img style="-webkit-transform:translateZ(0);position:absolute; left:'+y.left/c.width()*100+"%; top:"+y.top/c.height()*100+'%; width:100%; height:100%; margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;" unselectable="on" />'),p=c.children(":last").data("center",t._center),typeof g=="string"?o._loadImage(p,g,s,t,r,h):g.done(function(e){o._loadImage(p,e,s,t,r,h)}).fail(function(){p.remove(),r.loadCount--,t._requestComplete()})}},resize:function(t,n){var r=e.data(n,"geoServiceState");if(r&&n&&n.style.visibility==="visible"){this._cancelUnloaded(t,n);var i=r.serviceContainer,s=t._getContentBounds(),o=s.width,u=s.height,a=i.children();a.attr("data-pixel-size","0"),a.each(function(n){var r=e(this),i=r.position(),s=r.data("origin"),a=t._toPixel(s);r.css({left:i.left+(o-r.width())/2,top:i.top+(u-r.height())/2})})}},opacity:function(t,n){var r=e.data(n,"geoServiceState");r.serviceContainer.find("img").stop(!0).fadeTo("fast",n.style.opacity)},toggle:function(t,n){var r=e.data(n,"geoServiceState");r.serviceContainer.css("display",n.style.visibility==="visible"?"block":"none")},_cancelUnloaded:function(t,n){var r=e.data(n,"geoServiceState");if(r&&r.loadCount>0){r.serviceContainer.find("img:hidden").remove();while(r.loadCount>0)r.loadCount--,t._requestComplete()}},_loadImage:function(t,n,r,i,s,o){var u=s.serviceContainer;t.load(function(t){if(!e.contains(document.body,t.target.jquery?t.target[0]:t.target))return;o<1?e(t.target).fadeTo(0,o):e(t.target).show(),s.loadCount--,i._requestComplete(),s.loadCount<=0&&(u.children(':not([data-pixel-size="'+r+'"])').remove(),u.find("img[data-keep-alive]").remove(),s.loadCount=0)}).error(function(t){if(!e.contains(document.body,t.target.jquery?t.target[0]:t.target))return;e(t.target).remove(),s.loadCount--,i._requestComplete(),s.loadCount<=0&&(u.children(":not([data-pixel-size='"+r+"'])").remove(),s.loadCount=0)}).attr("src",n)}}}()}(jQuery);