Agriculture-front-end/public/libs/openlayers/ol3-echarts/1.3.6/ol3Echarts.min.js

8 lines
11 KiB
JavaScript
Raw Normal View History

2023-06-22 06:50:23 +08:00
/*!
* author: FDD <smileFDD@gmail.com>
* ol3-echarts v1.3.6
* build-time: 2018-12-22 14:19
* LICENSE: MIT
* (c) 2017-2018 https://sakitam-fdd.github.io/ol3Echarts
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("echarts"),require("openlayers")):"function"==typeof define&&define.amd?define(["echarts","openlayers"],e):t.ol3Echarts=e(t.echarts,t.ol)}(this,function(a,h){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a,h=h&&h.hasOwnProperty("default")?h.default:h;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=function(t){var e=void 0===t?"undefined":n(t);return null!==t&&("object"===e||"function"===e)},p=function t(e,n){for(var o in n)s(n[o])&&s(e[o])?t(e[o],n[o]):e[o]=n[o];return e},c=function(t){var e,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document;return e=void 0,n&&/^#([\w-]+)$/.test(t)?(e=n.getElementById(RegExp.$1))?[e]:[]:Array.prototype.slice.call(/^\.([\w-]+)$/.test(t)?n.getElementsByClassName(RegExp.$1):/^[\w-]+$/.test(t)?n.getElementsByTagName(t):n.querySelectorAll(t))},t=function(t,e,n){if(t&&e){if(t.map&&t.map===Array.prototype.map)return t.map(e,n);for(var o=[],r=0,i=t.length;r<i;r++)o.push(e.call(n,t[r],r,t));return o}},o=function(t,e){var n=Array.prototype.slice.call(arguments,2);return function(){return t.apply(e,n.concat(Array.prototype.slice.call(arguments)))}},u=function(t,e,n){for(var o=[[],e[0],e[1]],r=o[0],i=o[1],s=o[2],a=0;a<t.length;a+=2){var h=t.charCodeAt(a)-64,p=t.charCodeAt(a+1)-64;h=h>>1^-(1&h),p=p>>1^-(1&p),i=h+=i,s=p+=s,r.push([h/n,p/n])}return r};var d=function(i){var s=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=function(){this._mapOffset=[0,0],this.dimensions=["lng","lat"],this.projCode_=this._getProjectionCode()};return n.dimensions=n.prototype.dimensions=["lng","lat"],n.prototype.getZoom=function(){return i.getView().getZoom()},n.prototype.setZoom=function(t){return i.getView().setZoom(t)},n.prototype.getViewRectAfterRoam=function(){return this.getViewRect().clone()},n.prototype.setMapOffset=function(t){this._mapOffset=t},n.prototype.dataToPoint=function(t){t&&Array.isArray(t)&&0<t.length&&(t=t.map(function(t){return"string"==typeof t&&(t=Number(t)),t}));var e=s.source||"EPSG:4326",n=s.destination||this.projCode_,o=i.getPixelFromCoordinate(h.proj.transform(t,e,n)),r=this._mapOffset;return[o[0]-r[0],o[1]-r[1]]},n.prototype._getProjectionCode=function(){return i?i.getView()&&i.getView().getProjection().getCode():"EPSG:3857"},n.prototype.pointToData=function(t){var e=this._mapOffset;return i.getCoordinateFromPixel([t[0]+e[0],t[1]+e[1]])},n.prototype.getViewRect=function(){var t=i.getSize();return new a.graphic.BoundingRect(0,0,t[0],t[1])},n.prototype.getRoamTransform=function(){return a.matrix.create()},n.prototype.prepareCustoms=function(t){var e=this.getViewRect();return{coordSys:{type:"openlayers",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:o(this.dataToPoint,this),size:o(n.dataToCoordSize,this)}}},n.dataToCoordSize=function(i,s){return s=s||[0,0],t([0,1],function(t){var e=s[t],n=i[t]/2,o=[],r=[];return o[t]=e-n,r[t]=e+n,o[1-t]=r[1-t]=s[1-t],Math.abs(this.dataToPoint(o)[t]-this.dataToPoint(r)[t])},this)},n.create=function(t,e){t.eachSeries(function(t){"openlayers"===t.get("coordinateSystem")&&(t.coordinateSystem=new n(i))})},n},l=Object.freeze({pie:function(t,e,n){return e.center=n.dataToPoint(e.coordinates),e},bar:function(o,t,r){return s(o.grid)&&!Array.isArray(o.grid)?console.log(o):Array.isArray(o.grid)&&(o.grid=o.grid.map(function(t,e){var n=r.dataToPoint(o.series[e].coordinates);return t.left=n[0]-parseFloat(t.width)/2,t.top=n[1]-parseFloat(t.height)/2,t})),t}}),f={forcedRerender:!1,forcedPrecomposeRerender:!1,hideOnZooming:!1,hideOnMoving:!1,hideOnRotating:!1,convertTypes:["pie","line","bar"]},e=function(r){function i(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super