This file is indexed.

/usr/share/javascript/jquery-geo/jquery.geo.geomap.min.js is in libjs-jquery-geo 1.0~b1+ds1-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

1
2
(function(a,b){var c=0,d=function(){var a=5,b=document.createElement("div"),c=b.all||[];do b.innerHTML="<!--[if gt IE "+ ++a+"]><br><![endif]-->";while(c[0]);return a>6?a:!a}(),e={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(a){return"http://otile"+(a.index%4+1)+".mqcdn.com/tiles/1.0.0/osm/"+a.zoom+"/"+a.tile.column+"/"+a.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};a.widget("geo.geomap",{_$elem:b,_map:b,_created:!1,_createdGraphics:!1,_widgetId:0,_tmplLengthId:"",_tmplAreaId:"",_contentBounds:{},_$resizeContainer:b,_$eventTarget:b,_$contentFrame:b,_$existingChildren:b,_$attrList:b,_$servicesContainer:b,_$shapesContainers:b,_$panContainer:b,_$shapesContainer:b,_$drawContainer:b,_$measureContainer:b,_$measureLabel:b,_dpi:96,_currentServices:[],_center:b,_pixelSize:b,_centerMax:b,_pixelSizeMax:b,_userGeodetic:!0,_centerInteractive:b,_pixelSizeInteractive:b,_timeoutInteractive:null,_triggerInteractive:!1,_loadCount:0,_wheelTimeout:null,_wheelLevel:0,_zoomFactor:2,_fullZoomFactor:2,_partialZoomFactor:1.18920711500273,_mouseDown:b,_inOp:b,_toolPan:b,_shiftDown:b,_anchor:b,_current:b,_downDate:b,_moveDate:b,_clickDate:b,_lastMove:b,_lastDrag:b,_windowHandler:null,_resizeTimeout:null,_panning:b,_velocity:b,_friction:b,_supportTouch:b,_softDblClick:b,_isTap:b,_isDbltap:b,_isMultiTouch:b,_multiTouchAnchor:[],_multiTouchAnchorBbox:b,_multiTouchCurrentBbox:b,_drawTimeout:null,_drawPixels:[],_drawCoords:[],_graphicShapes:[],_initOptions:{},_options:{},options:a.extend({},e),_createWidget:function(b,d){this._$elem=a(d);if(this._$elem.is(".geo-service")){this._graphicShapes=[],a.Widget.prototype._createWidget.apply(this,arguments);return}this._widgetId=c++,this._tmplLengthId="geoMeasureLength"+this._widgetId,this._tmplAreaId="geoMeasureArea"+this._widgetId,this._$elem.addClass("geo-map").css({webkitTransform:"translateZ(0)"}),this._initOptions=b||{},this._forcePosition(this._$elem),this._$elem.css("text-align","left");var e=this._findMapSize();this._contentBounds={x:parseInt(this._$elem.css("padding-left"),10),y:parseInt(this._$elem.css("padding-top"),10),width:e.width,height:e.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=[],a.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||d==7;var c=this,e=this._supportTouch?"touchstart":"mousedown",f=this._supportTouch?"touchend touchcancel":"mouseup",g=this._supportTouch?"touchmove":"mousemove";a(document).keydown(a.proxy(this._document_keydown,this)),this._$eventTarget.dblclick(a.proxy(this._eventTarget_dblclick,this)),this._$eventTarget.bind(e,a.proxy(this._eventTarget_touchstart,this));var h=this._$eventTarget[0].setCapture?this._$eventTarget:a(document);h.bind(g,a.proxy(this._dragTarget_touchmove,this)),h.bind(f,a.proxy(this._dragTarget_touchstop,this)),this._$eventTarget.mousewheel(a.proxy(this._eventTarget_mousewheel,this)),this._windowHandler=function(){c._resizeTimeout&&clearTimeout(c._resizeTimeout),c._resizeTimeout=setTimeout(function(){c._created&&c._$elem.geomap("resize",!0)},500)},a(window).resize(this._windowHandler),this._$drawContainer.geographics({style:this._initOptions.drawStyle||{}}),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!==b&&this._setOption("tilingScheme",this._initOptions.tilingScheme||null,!1),this._initOptions.services&&(this._options.services=a.merge([],this._initOptions.services)),this._initOptions.bboxMax&&(this._setOption("bboxMax",this._initOptions.bboxMax,!1),this._setOption("bbox",this._initOptions.bboxMax,!1)),this._initOptions.zoomMin!==b&&this._setOption("zoomMin",this._initOptions.zoomMin,!1),this._initOptions.zoomMax!==b&&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!==b&&this._setOption("zoom",this._initOptions.zoom,!1)),a.templates(this._tmplLengthId,this._options.measureLabels.length),a.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(c,d,e){if(c=="pixelSize")return;e=e===b||e,this._$elem.is(".geo-map")&&this._panFinalize();var f,g,h,i;switch(c){case"bbox":this._created&&this._clearInteractiveTimeout(),this._userGeodetic=a.geo.proj&&a.geo._isGeodetic(d),this._userGeodetic&&(d=a.geo.proj.fromGeodetic(d)),f=[d[0]+(d[2]-d[0])/2,d[1]+(d[3]-d[1])/2],g=Math.max(a.geo.width(d,!0)/this._contentBounds.width,a.geo.height(d,!0)/this._contentBounds.height),i=this._getZoom(f,g),this._options.tilingScheme?g=this._getPixelSize(Math.min(Math.max(i,this._options.zoomMin),this._options.zoomMax)):i<this._options.zoomMin?g=this._getPixelSize(this._options.zoomMin):i>this._options.zoomMax&&(g=this._getPixelSize(this._options.zoomMax)),this._created?(this._setInteractiveCenterAndSize(f,g),this._setInteractiveTimeout(!1)):this._setCenterAndSize(f,g,!1,e),d=this._getBbox();break;case"bboxMax":this._userGeodetic=a.geo.proj&&a.geo._isGeodetic(d);break;case"center":this._created&&this._clearInteractiveTimeout(),this._userGeodetic=a.geo.proj&&a.geo._isGeodetic(d),this._userGeodetic&&(d=a.geo.proj.fromGeodetic(d)),this._created?(this._setInteractiveCenterAndSize(d,this._pixelSize),this._setInteractiveTimeout(!1)):this._setCenterAndSize(d,this._pixelSize,!1,e);break;case"measureLabels":d=a.extend(this._options.measureLabels,d),a.templates(this._tmplLengthId,this._options.measureLabels.length),a.templates(this._tmplAreaId,this._options.measureLabels.area);break;case"drawStyle":this._$drawContainer&&(this._$drawContainer.geographics("option","style",d),d=this._$drawContainer.geographics("option","style"));break;case"shapeStyle":this._$elem.is(".geo-service")&&!this._createdGraphics&&this._createServiceGraphics(),this._createdGraphics&&(this._$shapesContainer.geographics("option","style",d),d=this._$shapesContainer.geographics("option","style"));break;case"mode":this._resetDrawing(),this._$eventTarget.css("cursor",this._options.cursors[d]);break;case"zoom":this._created?this._setZoom(d,!1,e):(d=Math.max(d,0),this._setCenterAndSize(this._center,this._getPixelSize(d),!1,e))}a.Widget.prototype._setOption.apply(this,arguments);switch(c){case"bbox":case"center":this._userGeodetic&&(this._options.bbox=a.geo.proj.toGeodetic(this._options.bbox),this._options.center=a.geo.proj.toGeodetic(this._center));break;case"tilingScheme":d!==null&&(this._pixelSizeMax=this._getPixelSize(0),this._centerMax=[d.origin[0]+this._pixelSizeMax*d.tileWidth/2,d.origin[1]+this._pixelSizeMax*d.tileHeight/2]);break;case"bboxMax":a.geo.proj&&a.geo._isGeodetic(d)?h=a.geo.proj.fromGeodetic(d):h=d,this._centerMax=a.geo.center(h),this._pixelSizeMax=Math.max(a.geo.width(h,!0)/this._contentBounds.width,a.geo.height(h,!0)/this._contentBounds.height);break;case"services":this._createServices(),e&&this._refresh();break;case"shapeStyle":e&&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=b,this._createdGraphics=!1);else{clearTimeout(this._timeoutInteractive),this._timeoutInteractive=null,this._created=!1,a(window).unbind("resize",this._windowHandler);for(var c=0;c<this._currentServices.length;c++)this._currentServices[c].serviceContainer.geomap("destroy"),a.geo._serviceTypes[this._currentServices[c].type].destroy(this,this._$servicesContainer,this._currentServices[c]);this._$shapesContainer.geographics("destroy"),this._$shapesContainer=b,this._createdGraphics=!1,this._$drawContainer.geographics("destroy"),this._$drawContainer=b,this._$existingChildren.detach(),this._$elem.html(""),this._$elem.append(this._$existingChildren),this._$elem.removeClass("geo-map")}a.Widget.prototype.destroy.apply(this,arguments)},toMap:function(b){return b=this._toMap(b),this._userGeodetic?a.geo.proj.toGeodetic(b):b},toPixel:function(b,c,d){return this._toPixel(a.geo.proj?a.geo.proj.fromGeodetic(b):b,c,d)},opacity:function(b,c){if(this._$elem.is(".geo-service"))this._$elem.closest(".geo-map").geomap("opacity",b,this._$elem);else if(b>=0||b<=1)for(var d=0;d<this._currentServices.length;d++){var e=this._currentServices[d];if(!c||e.serviceContainer[0]==c[0])e.style.opacity=b,e.serviceObject.style=a.extend({},e.serviceObject.style,e.style),a.geo._serviceTypes[e.type].opacity(this,e)}},toggle:function(c,d){if(this._$elem.is(".geo-service"))this._$elem.closest(".geo-map").geomap("toggle",c,this._$elem);else for(var e=0;e<this._currentServices.length;e++){var f=this._currentServices[e];if(!d||f.serviceContainer[0]==d[0])c===b&&(c=f.style.visibility!=="visible"),f.style.visibility=c?"visible":"hidden",f.serviceObject.style=a.extend({},f.serviceObject.style,f.style),f.serviceContainer.toggle(c),c&&a.geo._serviceTypes[f.type].refresh(this,f)}},zoom:function(a){a!==null&&this._setZoom(this._options.zoom+a,!1,!0)},refresh:function(a,b){this._$elem.is(".geo-service")?this._$elem.closest(".geo-map").geomap("refresh",a,this._$elem):this._refresh(a,b)},resize:function(b){var c=this._findMapSize(),d=c.width/2-this._contentBounds.width/2,e=c.height/2-this._contentBounds.height/2,f;this._contentBounds={x:parseInt(this._$elem.css("padding-left"),10),y:parseInt(this._$elem.css("padding-top"),10),width:c.width,height:c.height},this._$resizeContainer.css({width:c.width,height:c.height});for(f=0;f<this._currentServices.length;f++)a.geo._serviceTypes[this._currentServices[f].type].resize(this,this._currentServices[f]);this._$elem.find(".geo-graphics").css({width:c.width,height:c.height}).geographics("resize");for(f=0;f<this._drawPixels.length;f++)this._drawPixels[f][0]+=d,this._drawPixels[f][1]+=e;this._setCenterAndSize(this._center,this._pixelSize,b,!0)},append:function(c,d,e,f){if(c&&(a.isPlainObject(c)||a.isArray(c)&&c.length>0)){this._createdGraphics||this._createServiceGraphics();var g,h,i,j,k,l;a.isArray(c)?g=c:c.type=="FeatureCollection"?g=c.features:g=[c];for(i=1;i<arguments.length;i++)h=arguments[i],typeof h=="object"?j=h:typeof h=="number"||typeof h=="string"?k=h:typeof h=="boolean"&&(l=h);for(i=0;i<g.length;i++){if(g[i].type!="Point"){var m=a.geo.bbox(g[i]);a.geo.proj&&a.geo._isGeodetic(m)&&(m=a.geo.proj.fromGeodetic(m)),a.data(g[i],"geoBbox",m)}this._graphicShapes.push({shape:g[i],style:j,label:k})}if(l===b||l)this._$elem.is(".geo-service")?this._refresh(!1,this._$elem):this._refresh()}},empty:function(c){for(var d=0;d<this._graphicShapes.length;d++)a.removeData(this._graphicShapes[d].shape,"geoBbox");this._graphicShapes=[];if(c===b||c)this._$elem.is(".geo-service")?this._refresh(!1,this._$elem):this._refresh()},find:function(c,d){var e=a.isPlainObject(c),f=e?this._map.toPixel(c.coordinates):b,g=this._map._pixelSize*d,h=[],i,j,k,l=0;for(;l<this._graphicShapes.length;l++){i=this._graphicShapes[l];if(e)if(i.shape.type=="Point")a.geo.distance(i.shape,c)<=g&&h.push(i.shape);else{var m=a.data(i.shape,"geoBbox"),n={type:"Polygon",coordinates:[[[m[0],m[1]],[m[0],m[3]],[m[2],m[3]],[m[2],m[1]],[m[0],m[1]]]]},o={type:"Point",coordinates:a.geo.proj&&a.geo._isGeodetic(c.coordinates)?a.geo.proj.fromGeodetic(c.coordinates):c.coordinates};if(a.geo.distance(n,o,!0)<=g){j=a.geo._flatten(i.shape);for(k=0;k<j.length;k++)if(a.geo.distance(j[k],c)<=g){h.push(i.shape);break}}}else h.push(i.shape)}return this._$elem.is(".geo-map")&&this._$elem.find(".geo-service").each(function(){h=a.merge(h,a(this).geomap("find",c,d))}),h},remove:function(c,d){if(c&&(a.isPlainObject(c)||a.isArray(c)&&c.length>0)){var e=a.isArray(c)?c:[c],f;for(var g=0;g<this._graphicShapes.length;g++)a.inArray(this._graphicShapes[g].shape,e)>=0&&(a.removeData(c,"geoBbox"),f=this._graphicShapes.slice(g+1),this._graphicShapes.length=g,this._graphicShapes.push.apply(this._graphicShapes,f),g--);if(d===b||d)this._$elem.is(".geo-service")?this._refresh(!1,this._$elem):this._refresh()}},_getBbox:function(a,b){a=a||this._center,b=b||this._pixelSize;var c=this._contentBounds.width/2*b,d=this._contentBounds.height/2*b;return[a[0]-c,a[1]-d,a[0]+c,a[1]+d]},_setBbox:function(b,c,d){var e=[b[0]+(b[2]-b[0])/2,b[1]+(b[3]-b[1])/2],f=Math.max(a.geo.width(b,!0)/this._contentBounds.width,a.geo.height(b,!0)/this._contentBounds.height),g=this._getZoom(e,f);this._options.tilingScheme?f=this._getPixelSize(Math.min(Math.max(g,this._options.zoomMin),this._options.zoomMax)):g<this._options.zoomMin?f=this._getPixelSize(this._options.zoomMin):g>this._options.zoomMax&&(f=this._getPixelSize(this._options.zoomMax)),this._setInteractiveCenterAndSize(e,f),this._interactiveTransform()},_getBboxMax:function(){var a=this._contentBounds.width/2*this._pixelSizeMax,b=this._contentBounds.height/2*this._pixelSizeMax;return[this._centerMax[0]-a,this._centerMax[1]-b,this._centerMax[0]+a,this._centerMax[1]+b]},_getCenter:function(){return this._center},_getContentBounds:function(){return this._contentBounds},_getServicesContainer:function(){return this._$servicesContainer},_getZoom:function(b,c){b=b||this._center,c=c||this._pixelSize;var d=this._options.tilingScheme;if(d){if(d.pixelSizes){var e=Math.floor(c*1e3),f=d.pixelSizes.length,g=f-1;for(;g>=0;g--)if(Math.floor(d.pixelSizes[g]*1e3)>=e)return g;return 0}return Math.round(Math.log(d.basePixelSize/c)/Math.log(2))}var h=this._contentBounds.width/this._contentBounds.height,i=a.geo.reaspect(this._getBbox(b,c),h,!0),j=a.geo.reaspect(this._getBboxMax(),h,!0);return Math.round(Math.log(a.geo.width(j,!0)/a.geo.width(i,!0))/Math.log(this._zoomFactor))},_setZoom:function(a,b,c){this._clearInteractiveTimeout(),a=Math.min(Math.max(a,this._options.zoomMin),this._options.zoomMax),this._setInteractiveCenterAndSize(this._center,this._getPixelSize(a)),this._interactiveTransform(),this._setInteractiveTimeout(b)},_createChildren:function(){this._$existingChildren=this._$elem.children(),this._forcePosition(this._$existingChildren),this._$existingChildren.detach().css({mozUserSelect:"none"});var b="width:"+this._contentBounds.width+"px; height:"+this._contentBounds.height+"px; margin:0; padding:0;",c="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;"+b+'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="'+c+b+'"></div>'),this._$servicesContainer=this._$contentFrame.children(":last"),this._$contentFrame.append('<div class="geo-shapes-container" style="'+c+b+'"></div>'),this._$shapesContainer=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="'+c+b+'"></div>'),this._$drawContainer=this._$contentFrame.children(":last"),this._$contentFrame.append('<div class="geo-measure-container" style="'+c+b+'"><span class="geo-measure-label" style="'+c+'; display: none;"></span></div>'),this._$measureContainer=this._$contentFrame.children(":last"),this._$measureLabel=this._$measureContainer.children(),this._$panContainer=a([this._$shapesContainer[0],this._$drawContainer[0],this._$measureContainer[0]]),this._$resizeContainer=a([this._$contentFrame[0],this._$servicesContainer[0],this._$eventTarget[0],this._$measureContainer[0]]),this._$contentFrame.append(this._$existingChildren),a("#geo-measure-style").length||a("head").prepend('<style type="text/css" id="geo-measure-style">.geo-measure-label { margin: 4px 0 0 6px; font-family: sans-serif;'+(d?"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 b,c;for(c=0;c<this._currentServices.length;c++)this._currentServices[c].serviceContainer.geomap("destroy"),a.geo._serviceTypes[this._currentServices[c].type].destroy(this,this._$servicesContainer,this._currentServices[c]);this._currentServices=[],this._$servicesContainer.html(""),this._$attrList.html("");for(c=0;c<this._options.services.length;c++){b=this._currentServices[c]=a.extend({},this._options.services[c]),b.serviceObject=this._options.services[c],b.style=a.extend({visibility:"visible",opacity:1},b.style);var d=b.id?' id="'+b.id+'"':"",e='class="geo-service '+(b["class"]?b["class"]:"")+'"',f="<div "+d+e+' style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:32px; height:32px; margin:0; padding:0; display:'+(b.style.visibility==="visible"?"block":"none")+';"></div>',g;this._$servicesContainer.append(f),serviceContainer=this._$servicesContainer.children(":last"),b.serviceContainer=serviceContainer,a.geo._serviceTypes[b.type].create(this,serviceContainer,b,c),serviceContainer.data("geoMap",this).geomap(),b.attr&&this._$attrList.append("<li>"+b.attr+"</li>")}this._$shapesContainers=this._$shapesContainer,this._$attrList.find("a").css({position:"relative",zIndex:100})},_createServiceGraphics:function(){var a=this._$elem.closest(".geo-content-frame");this._$elem.append('<div class="geo-shapes-container" style="position:absolute; left:0; top:0; width:'+a.css("width")+"; height:"+a.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 b=this._options.mode,c=this._drawPixels,d=this._drawCoords,e,f,g,h,i;switch(b){case"measureLength":b="drawLineString",f={type:"LineString",coordinates:d},e=a.render[this._tmplLengthId]({length:a.geo.length(f,!0)}),g=a.merge([],c[c.length-1]);break;case"measureArea":b="drawPolygon",f={type:"Polygon",coordinates:[a.merge([],d)]},f.coordinates[0].push(d[0]),e=a.render[this._tmplAreaId]({area:a.geo.area(f,!0)}),g=this._toPixel(a.geo.centroid(f).coordinates),c=[c];break;case"drawPolygon":c=[c]}this._$drawContainer.geographics(b,c),e&&(this._$measureLabel.html(e),h=this._contentBounds.width-(this._$measureLabel.outerWidth(!0)+g[0]),i=this._contentBounds.height-(this._$measureLabel.outerHeight(!0)+g[1]),h<0&&(g[0]+=h),i<0&&(g[1]+=i),this._$measureLabel.css({left:Math.max(g[0],0),top:Math.max(g[1],0)}).show())}},_resetDrawing:function(){this._drawPixels=[],this._drawCoords=[],this._$drawContainer.geographics("clear"),this._$measureLabel.hide()},_refreshShapes:function(c,d,e,f,g,h){var i,j,k,l,m,n,o,p,q=this._map._getBbox(g,h);for(i=0;i<d.length;i++){k=d[i].shape||d[i],k=k.geometry||k,l=a.data(k,"geoBbox");if(l&&a.geo._bboxDisjoint(q,l))continue;m=a.isArray(e)?e[i].style:e,n=a.isArray(f)?f[i].label:f,o=n!==b,p=b;switch(k.type){case"Point":p=this._map.toPixel(k.coordinates,g,h),this._$shapesContainer.geographics("drawPoint",p,m);break;case"LineString":this._$shapesContainer.geographics("drawLineString",this._map.toPixel(k.coordinates,g,h),m),o&&(p=this._map.toPixel(a.geo.pointAlong(k,.5).coordinates,g,h));break;case"Polygon":this._$shapesContainer.geographics("drawPolygon",this._map.toPixel(k.coordinates,g,h),m),o&&(p=this._map.toPixel(a.geo.centroid(k).coordinates,g,h));break;case"MultiPoint":for(j=0;j<k.coordinates.length;j++)this._$shapesContainer.geographics("drawPoint",this._map.toPixel(k.coordinates[j],g,h),m);o&&(p=this._map.toPixel(a.geo.centroid(k).coordinates,g,h));break;case"MultiLineString":for(j=0;j<k.coordinates.length;j++)this._$shapesContainer.geographics("drawLineString",this._map.toPixel(k.coordinates[j],g,h),m);o&&(p=this._map.toPixel(a.geo.centroid(k).coordinates,g,h));break;case"MultiPolygon":for(j=0;j<k.coordinates.length;j++)this._$shapesContainer.geographics("drawPolygon",this._map.toPixel(k.coordinates[j],g,h),m);o&&(p=this._map.toPixel(a.geo.centroid(k).coordinates,g,h));break;case"GeometryCollection":this._refreshShapes(c,k.geometries,m,n,g,h)}o&&p&&this._$shapesContainer.geographics("drawLabel",p,n)}},_findMapSize:function(){var a={width:0,height:0},b=this._$elem;while(b.size()&&!(a.width>0&&a.height>0)){a={width:b.width(),height:b.height()};if(a.width<=0||a.height<=0)a={width:parseInt(b.css("width"),10),height:parseInt(b.css("height"),10)};b=b.parent()}return a},_forcePosition:function(a){var b=a.css("position");b!="relative"&&b!="absolute"&&b!="fixed"&&a.css("position","relative")},_getPixelSize:function(b){var c=this._options.tilingScheme;if(c!==null){if(b===0)return c.pixelSizes?c.pixelSizes[0]:c.basePixelSize;b=Math.round(b),b=Math.max(b,0);var d=c.pixelSizes?c.pixelSizes.length:c.levels;return b=Math.min(b,d-1),c.pixelSizes?c.pixelSizes[b]:c.basePixelSize/Math.pow(2,b)}var e=a.geo.scaleBy(this._getBboxMax(),1/Math.pow(this._zoomFactor,b),!0);return Math.max(a.geo.width(e,!0)/this._contentBounds.width,a.geo.height(e,!0)/this._contentBounds.height)},_getZoomCenterAndSize:function(a,b,c){var d=c?this._fullZoomFactor:this._partialZoomFactor,e=Math.pow(d,-b),f=this._pixelSizeInteractive*e,g=this._getZoom(this._centerInteractive,f);c&&this._options.tilingScheme?f=this._getPixelSize(Math.min(Math.max(g,this._options.zoomMin),this._options.zoomMax)):b<0&&g<this._options.zoomMin?f=this._pixelSizeInteractive:b>0&&g>this._options.zoomMax&&(f=this._pixelSizeInteractive);var h=f/this._pixelSizeInteractive,i=this._toMap(a,this._centerInteractive,this._pixelSizeInteractive),j=[(this._centerInteractive[0]-i[0])*h,(this._centerInteractive[1]-i[1])*h],k=[i[0]+j[0],i[1]+j[1]];return{pixelSize:f,center:k}},_mouseWheelFinish:function(a){this._wheelTimeout=null;if(this._wheelLevel!==0){var b=this._getZoomCenterAndSize(this._anchor,this._wheelLevel,this._options.tilingScheme!==null);this._wheelLevel=0}else a&&this._refresh()},_panFinalize:function(){if(this._panning){this._velocity=[0,0];var a=this._current[0]-this._anchor[0],b=this._current[1]-this._anchor[1],c=this._options.axisLayout==="image",d=-a*this._pixelSize,e=(c?-1:1)*b*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 a=this._current[0]-this._lastDrag[0],b=this._current[1]-this._lastDrag[1],c=0,d,e;if(this._toolPan||a>3||a<-3||b>3||b<-3){this._toolPan||(this._toolPan=!0,this._$eventTarget.css("cursor",this._options.cursors.pan)),this._mouseDown&&(this._velocity=[a,b]);if(a!==0||b!==0)this._panning=!0,this._lastDrag=this._current,this._centerInteractive[0]-=a*this._pixelSizeInteractive,this._centerInteractive[1]+=(this._options.axisLayout==="image"?-1:1)*b*this._pixelSizeInteractive,this._setInteractiveCenterAndSize(this._centerInteractive,this._pixelSizeInteractive),this._interactiveTransform()}},_clearInteractiveTimeout:function(){return 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(){this._$shapesContainers&&this._$shapesContainers.geographics("clear");for(var b=0;b<this._currentServices.length;b++)service=this._currentServices[b],a.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())},_setInteractiveTimeout:function(a){function c(){b._isMultiTouch?b._timeoutInteractive=setTimeout(c,128):b._created&&b._timeoutInteractive&&(b._setCenterAndSize(b._centerInteractive,b._pixelSizeInteractive,b._triggerInteractive,!0),b._timeoutInteractive=null,b._triggerInteractive=!1)}var b=this;this._timeoutInteractive=setTimeout(c,128),this._triggerInteractive|=a},_refresh:function(b,c){var d,e,f=0;for(;f<this._currentServices.length;f++){d=this._currentServices[f];if(!c||d.serviceContainer[0]==c[0])a.geo._serviceTypes[d.type].refresh(this,d,b),e=d.serviceContainer.data("geoService"),e._createdGraphics&&(e._$shapesContainer.geographics("clear"),e._graphicShapes.length>0&&e._refreshShapes(e._$shapesContainer,e._graphicShapes,e._graphicShapes,e._graphicShapes))}this._createdGraphics&&(this._$shapesContainer.geographics("clear"),this._graphicShapes.length>0&&this._refreshShapes(this._$shapesContainer,this._graphicShapes,this._graphicShapes,this._graphicShapes))},_setInteractiveCenterAndSize:function(b,c){this._centerInteractive[0]=b[0],this._centerInteractive[1]=b[1],this._pixelSizeInteractive=c,this._userGeodetic?(this._options.bbox=a.geo.proj.toGeodetic(this._getBbox(b,c)),this._options.center=a.geo.proj.toGeodetic(b)):(this._options.bbox=this._getBbox(b,c),this._options.center[0]=b[0],this._options.center[1]=b[1]),this._options.pixelSize=c,this._options.zoom=this._getZoom(b,c)},_setCenterAndSize:function(b,c,d,e){if(!a.isArray(b)||b.length!=2||typeof b[0]!="number"||typeof b[1]!="number")return;var f=this._getZoom(b,c);this._options.tilingScheme?this._pixelSizeInteractive=c=this._getPixelSize(Math.min(Math.max(f,this._options.zoomMin),this._options.zoomMax)):f<this._options.zoomMin?this._pixelSizeInteractive=c=this._getPixelSize(this._options.zoomMin):f>this._options.zoomMax&&(this._pixelSizeInteractive=c=this._getPixelSize(this._options.zoomMax)),this._center[0]=b[0],this._center[1]=b[1],this._options.pixelSize=this._pixelSize=c,this._userGeodetic?(this._options.bbox=a.geo.proj.toGeodetic(this._getBbox()),this._options.center=a.geo.proj.toGeodetic(this._center)):(this._options.bbox=this._getBbox(),this._options.center=a.merge([],b)),this._options.zoom=f,d&&this._trigger("bboxchange",window.event,{bbox:a.merge([],this._options.bbox)}),e&&(this._refresh(),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(b,c,d){c=c||this._center,d=d||this._pixelSize;var e=a.isArray(b[0]),f=e&&a.isArray(b[0][0]),g=f&&a.isArray(b[0][0][0]),h=this._contentBounds.width,i=this._contentBounds.height,j=h/2*d,k=i/2*d,l=[c[0]-j,c[1]-k,c[0]+j,c[1]+k],m=a.geo.width(l,!0)/h,n=a.geo.height(l,!0)/i,o,p=this._options.axisLayout==="image",q=[],r,s,t;g||(f||(e||(b=[b]),b=[b]),b=[b]);for(r=0;r<b.length;r++){q[r]=[];for(s=0;s<b[r].length;s++){q[r][s]=[];for(t=0;t<b[r][s].length;t++)o=b[r][s][t][1]*n,q[r][s][t]=[l[0]+b[r][s][t][0]*m,p?l[1]+o:l[3]-o]}}return g?q:f?q[0]:e?q[0][0]:q[0][0][0]},_toPixel:function(b,c,d){c=c||this._center,d=d||this._pixelSize;var e=a.isArray(b[0]),f=e&&a.isArray(b[0][0]),g=f&&a.isArray(b[0][0][0]),h=this._contentBounds.width,i=this._contentBounds.height,j=h/2*d,k=i/2*d,l=[c[0]-j,c[1]-k,c[0]+j,c[1]+k],m=a.geo.width(l,!0),n=a.geo.height(l,!0),o=this._options.axisLayout==="image",p=h/m,q=i/n,r=[],s,t,u;g||(f||(e||(b=[b]),b=[b]),b=[b]);for(s=0;s<b.length;s++){r[s]=[];for(t=0;t<b[s].length;t++){r[s][t]=[];for(u=0;u<b[s][t].length;u++)r[s][t][u]=[Math.round((b[s][t][u][0]-l[0])*p),Math.round((o?b[s][t][u][1]-l[1]:l[3]-b[s][t][u][1])*q)]}}return g?r:f?r[0]:e?r[0][0]:r[0][0][0]},_document_keydown:function(b){var c=this._drawCoords.length;c>0&&b.which==27&&(c<=2?(this._resetDrawing(),this._inOp=!1):(this._drawCoords[c-2]=a.merge([],this._drawCoords[c-1]),this._drawPixels[c-2]=a.merge([],this._drawPixels[c-1]),this._drawCoords.length--,this._drawPixels.length--,this._refreshDrawing()))},_eventTarget_dblclick_zoom:function(a){var b=this._clearInteractiveTimeout();this._trigger("dblclick",a,{type:"Point",coordinates:this._toMap(this._current,this._centerInteractive,this._pixelSizeInteractive)});if(!a.isDefaultPrevented()){var c=this._getZoomCenterAndSize(this._current,1,!0);this._setInteractiveCenterAndSize(c.center,c.pixelSize),this._interactiveTransform(),b=!0}b&&this._setInteractiveTimeout(!0)},_eventTarget_dblclick:function(b){if(this._options.mode==="static")return;this._drawTimeout&&(window.clearTimeout(this._drawTimeout),this._drawTimeout=null);var c=a(b.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",b,{type:"LineString",coordinates:this._userGeodetic?a.geo.proj.toGeodetic(this._drawCoords):this._drawCoords})):this._eventTarget_dblclick_zoom(b),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 d=this._drawCoords.length-1;d>2&&(this._drawCoords[d]=a.merge([],this._drawCoords[0]),this._trigger("shape",b,{type:"Polygon",coordinates:[this._userGeodetic?a.geo.proj.toGeodetic(this._drawCoords):this._drawCoords]}))}else this._eventTarget_dblclick_zoom(b);this._resetDrawing();break;default:this._eventTarget_dblclick_zoom(b)}this._inOp=!1},_eventTarget_touchstart:function(b){var c=this._options.mode,d=this._options.shift;if(c==="static")return;if(!this._supportTouch&&b.which!=1)return;var e=this._clearInteractiveTimeout(),f=a(b.currentTarget).offset(),g=b.originalEvent.changedTouches;this._supportTouch?(this._multiTouchAnchor=a.merge([],g),this._isMultiTouch=this._multiTouchAnchor.length>1,this._isMultiTouch?(this._multiTouchCurrentBbox=[g[0].pageX-f.left,g[0].pageY-f.top,g[1].pageX-f.left,g[1].pageY-f.top],this._multiTouchAnchorBbox=a.merge([],this._multiTouchCurrentBbox),this._current=a.geo.center(this._multiTouchCurrentBbox,!0)):(this._multiTouchCurrentBbox=[g[0].pageX-f.left,g[0].pageY-f.top,NaN,NaN],this._current=[g[0].pageX-f.left,g[0].pageY-f.top])):this._current=[b.pageX-f.left,b.pageY-f.top];if(this._softDblClick){var h=a.now();if(h-this._downDate<750){if(this._isTap){var i=this
._current[0]-this._anchor[0],j=this._current[1]-this._anchor[1],k=Math.sqrt(i*i+j*j);k>8?this._isTap=!1:this._current=a.merge([],this._anchor)}this._isDbltap?this._isDbltap=!1:this._isDbltap=this._isTap}else this._isDbltap=!1;this._isTap=!0,this._downDate=h}return this._mouseDown=!0,this._anchor=a.merge([],this._current),!this._inOp&&b.shiftKey&&d!=="off"?(this._shiftDown=!0,this._$eventTarget.css("cursor",this._options.cursors[d==="default"?"zoom":d])):!this._isMultiTouch&&(this._options.pannable||c==="dragBox"||c==="dragCircle")&&(this._inOp=!0,c!=="zoom"&&c!=="dragBox"&&c!=="dragCircle"&&(this._lastDrag=this._current,b.currentTarget.setCapture&&b.currentTarget.setCapture())),b.preventDefault(),e&&this._setInteractiveTimeout(!0),!1},_dragTarget_touchmove:function(b){if(this._options.mode==="static")return;var c=!1;this._mouseDown&&(c=this._clearInteractiveTimeout());var e=this._$eventTarget.offset(),f=this._drawCoords.length,g=b.originalEvent.changedTouches,h,i,j=0;if(this._supportTouch){if(!this._isMultiTouch&&this._mouseDown&&this._multiTouchAnchor.length>0&&g[0].identifier!==this._multiTouchAnchor[0].identifier)return this._mouseDown=!1,this._isMultiTouch=!0,this._wheelLevel=0,this._multiTouchAnchor.push(g[0]),this._multiTouchCurrentBbox=[this._multiTouchCurrentBbox[0],this._multiTouchCurrentBbox[1],this._multiTouchAnchor[1].pageX-e.left,this._multiTouchAnchor[1].pageY-e.top],this._multiTouchAnchorBbox=a.merge([],this._multiTouchCurrentBbox),this._mouseDown=!0,this._anchor=this._current=a.geo.center(this._multiTouchCurrentBbox,!0),c&&this._setInteractiveTimeout(!0),!1;if(this._isMultiTouch){for(;j<g.length;j++)g[j].identifier===this._multiTouchAnchor[0].identifier?(this._multiTouchCurrentBbox[0]=g[j].pageX-e.left,this._multiTouchCurrentBbox[1]=g[j].pageY-e.top):g[j].identifier===this._multiTouchAnchor[1].identifier&&(this._multiTouchCurrentBbox[2]=g[j].pageX-e.left,this._multiTouchCurrentBbox[3]=g[j].pageY-e.top);var k=a.geo._distancePointPoint([this._multiTouchAnchorBbox[0],this._multiTouchAnchorBbox[1]],[this._multiTouchAnchorBbox[2],this._multiTouchAnchorBbox[3]]),l=a.geo._distancePointPoint([this._multiTouchCurrentBbox[0],this._multiTouchCurrentBbox[1]],[this._multiTouchCurrentBbox[2],this._multiTouchCurrentBbox[3]]);h=a.geo.center(this._multiTouchCurrentBbox,!0);var m=(l-k)/k;m>0?m*=5:m*=10;var n=m-this._wheelLevel;this._wheelLevel=m;var o=this._getZoomCenterAndSize(this._anchor,n,!1);this._setInteractiveCenterAndSize(o.center,o.pixelSize),this._interactiveTransform(),c=!0,h=a.geo.center(this._multiTouchCurrentBbox,!0)}else h=[b.originalEvent.changedTouches[0].pageX-e.left,b.originalEvent.changedTouches[0].pageY-e.top]}else h=[b.pageX-e.left,b.pageY-e.top];if(h[0]===this._lastMove[0]&&h[1]===this._lastMove[1]&&this._inOp)return b.preventDefault(),c&&this._setInteractiveTimeout(!0),!1;d==7&&(this._isDbltap=this._isTap=!1),this._mouseDown&&(this._current=h,this._moveDate=a.now());if(this._isMultiTouch)return b.preventDefault(),this._isDbltap=this._isTap=!1,c&&this._setInteractiveTimeout(!0),!1;var p=this._options.shift,q=this._shiftDown?p==="default"?"zoom":p:this._options.mode,r,s,t;switch(q){case"zoom":case"dragBox":this._mouseDown?(this._$drawContainer.geographics("clear"),this._$drawContainer.geographics("drawBbox",[this._anchor[0],this._anchor[1],h[0],h[1]])):this._trigger("move",b,{type:"Point",coordinates:this.toMap(h)});break;case"dragCircle":this._mouseDown?(r=h[0]-this._anchor[0],s=h[1]-this._anchor[1],t=Math.sqrt(r*r+s*s)*2,this._$drawContainer.geographics("clear"),this._$drawContainer.geographics("drawArc",this._anchor,0,360,{width:t,height:t})):this._trigger("move",b,{type:"Point",coordinates:this.toMap(h)});break;case"drawLineString":case"drawPolygon":case"measureLength":case"measureArea":this._mouseDown||this._toolPan?(this._panMove(),c=!0):(f>0&&(this._drawCoords[f-1]=this._toMap(h,this._centerInteractive,this._pixelSizeInteractive),this._drawPixels[f-1]=h,this._refreshDrawing()),this._trigger("move",b,{type:"Point",coordinates:this.toMap(h)}));break;default:this._mouseDown||this._toolPan?(this._panMove(),c=!0):this._trigger("move",b,{type:"Point",coordinates:this.toMap(h)})}this._lastMove=h,c&&this._setInteractiveTimeout(!0);if(this._inOp)return b.preventDefault(),!1},_dragTarget_touchstop:function(b){if(this._options.mode==="static")return;if(!this._mouseDown){if(d!=7)return!1;this._eventTarget_touchstart(b)}var c=this._clearInteractiveTimeout(),e=this._mouseDown,f=this._toolPan,g=this._$eventTarget.offset(),h=this._options.shift,i=this._shiftDown?h==="default"?"zoom":h:this._options.mode,j,k,l,m,n,o,p;this._supportTouch?(j=[b.originalEvent.changedTouches[0].pageX-g.left,b.originalEvent.changedTouches[0].pageY-g.top],this._multiTouchAnchor=[],this._inOp=!1):j=[b.pageX-g.left,b.pageY-g.top],this._softDblClick&&this._isTap&&(m=j[0]-this._anchor[0],n=j[1]-this._anchor[1],Math.sqrt(m*m+n*n)<=8&&(j=a.merge([],this._anchor))),m=j[0]-this._anchor[0],n=j[1]-this._anchor[1],this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]),this._shiftDown=this._mouseDown=this._toolPan=!1;if(this._isMultiTouch){b.preventDefault(),this._isMultiTouch=!1,this._wheelLevel=0,c&&this._setInteractiveTimeout(!0);return}document.releaseCapture&&document.releaseCapture();if(e){l=a.now(),this._current=j;switch(i){case"zoom":case"dragBox":if(m!==0||n!==0){var q=this._pixelSize*6,r=this._toMap([[Math.min(this._anchor[0],j[0]),Math.max(this._anchor[1],j[1])],[Math.max(this._anchor[0],j[0]),Math.min(this._anchor[1],j[1])]]),s=[r[0][0],r[0][1],r[1][0],r[1][1]];i==="zoom"?(s[2]-s[0]<q&&s[3]-s[1]<q&&(s=a.geo.scaleBy(this._getBbox(a.geo.center(s,!0)),.5,!0)),this._setBbox(s,!0,!0),c=!0):(p=a.geo.polygonize(s,!0),p.bbox=s,this._userGeodetic&&(p.coordinates=a.geo.proj.toGeodetic(p.coordinates),p.bbox=a.geo.proj.toGeodetic(p.bbox)),this._trigger("shape",b,p))}else i==="dragBox"&&(o=this._toMap(j),p={type:"Point",coordinates:[o[0],o[1]],bbox:[o[0],o[1],o[0],o[1]]},this._userGeodetic&&(p.coordinates=a.geo.proj.toGeodetic(p.coordinates),p.bbox=a.geo.proj.toGeodetic(p.bbox)),this._trigger("shape",b,p));this._resetDrawing();break;case"dragCircle":if(m!==0||n!==0){var t=this._options.axisLayout==="image",u=Math.sqrt(m*m+n*n),v=180,w;this._drawPixels.length=v+1;for(k=0;k<v;k++)w=k*360/v*(Math.PI/180),this._drawPixels[k]=[this._anchor[0]+Math.cos(w)*u,this._anchor[1]+Math.sin(w)*u];this._drawPixels[v]=[this._drawPixels[0][0],this._drawPixels[0][1]],o=this._toMap([[this._anchor[0]-u,this._anchor[1]+(t?-u:u)],[this._anchor[0]+u,this._anchor[1]+(t?u:-u)]]),p={type:"Polygon",coordinates:[this._toMap(this._drawPixels)],bbox:[o[0][0],o[0][1],o[1][0],o[1][1]]},this._userGeodetic&&(p.coordinates=a.geo.proj.toGeodetic(p.coordinates),p.bbox=a.geo.proj.toGeodetic(p.bbox)),this._trigger("shape",b,p),this._resetDrawing()}else o=this._toMap(j),p={type:"Point",coordinates:[o[0],o[1]],bbox:[o[0],o[1],o[0],o[1]]},this._userGeodetic&&(p.coordinates=a.geo.proj.toGeodetic(p.coordinates),p.bbox=a.geo.proj.toGeodetic(p.bbox)),this._trigger("shape",b,p);break;case"drawPoint":this._drawTimeout&&(window.clearTimeout(this._drawTimeout),this._drawTimeout=null);if(f)this._panFinalize();else if(l-this._clickDate>100){var x=this;this._drawTimeout=setTimeout(function(){x._drawTimeout&&(x._trigger("shape",b,{type:"Point",coordinates:x.toMap(j)}),x._inOp=!1,x._drawTimeout=null)},250)}break;case"drawLineString":case"drawPolygon":case"measureLength":case"measureArea":if(f)this._panFinalize();else{k=this._drawCoords.length===0?0:this._drawCoords.length-1,this._drawCoords[k]=this._toMap(j),this._drawPixels[k]=j;if(k<2||this._drawCoords[k][0]!=this._drawCoords[k-1][0]||this._drawCoords[k][1]!=this._drawCoords[k-1][1])this._drawCoords[k+1]=this._toMap(j,this._centerInteractive,this._pixelSizeInteractive),this._drawPixels[k+1]=j;this._refreshDrawing()}break;default:f?this._panFinalize():l-this._clickDate>100&&(this._trigger("click",b,{type:"Point",coordinates:this.toMap(j)}),this._inOp=!1)}this._clickDate=l;if(this._softDblClick&&this._isDbltap)return this._isDbltap=this._isTap=!1,c&&this._setInteractiveTimeout(!0),this._$eventTarget.trigger("dblclick",b),!1}c&&this._setInteractiveTimeout(!0);if(this._inOp)return b.preventDefault(),!1},_eventTarget_mousewheel:function(b,c){if(this._options.mode==="static"||this._options.scroll==="off")return;b.preventDefault();if(this._mouseDown)return!1;if(c!==0){this._clearInteractiveTimeout(),c>0?c=Math.ceil(c):c=Math.floor(c);var d=a(b.currentTarget).offset();this._anchor=[b.pageX-d.left,b.pageY-d.top];var e=this._getZoomCenterAndSize(this._anchor,c,this._options.tilingScheme!==null),f,g=0;this._setInteractiveCenterAndSize(e.center,e.pixelSize),this._interactiveTransform(),this._setInteractiveTimeout(!0)}return!1}})})(jQuery);