qauMaWeb/node_modules/.cache/babel-loader/9a90334301b379232cb1e627d2f...

1 line
24 KiB
JSON

{"ast":null,"code":"import \"core-js/modules/es.array.map.js\";\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport View from '../View.js';\nimport geoSourceManager from './geoSourceManager.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nimport { warn } from '../../util/log.js';\nvar GEO_DEFAULT_PARAMS = {\n 'geoJSON': {\n aspectScale: 0.75,\n invertLongitute: true\n },\n 'geoSVG': {\n aspectScale: 1,\n invertLongitute: false\n }\n};\nexport var geo2DDimensions = ['lng', 'lat'];\n\nvar Geo =\n/** @class */\nfunction (_super) {\n __extends(Geo, _super);\n\n function Geo(name, map, opt) {\n var _this = _super.call(this, name) || this;\n\n _this.dimensions = geo2DDimensions;\n _this.type = 'geo'; // Only store specified name coord via `addGeoCoord`.\n\n _this._nameCoordMap = zrUtil.createHashMap();\n _this.map = map;\n var projection = opt.projection;\n var source = geoSourceManager.load(map, opt.nameMap, opt.nameProperty);\n var resource = geoSourceManager.getGeoResource(map);\n var resourceType = _this.resourceType = resource ? resource.type : null;\n var regions = _this.regions = source.regions;\n var defaultParams = GEO_DEFAULT_PARAMS[resource.type];\n _this._regionsMap = source.regionsMap;\n _this.regions = source.regions;\n\n if (process.env.NODE_ENV !== 'production' && projection) {\n // Do some check\n if (resourceType === 'geoSVG') {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Map \" + map + \" with SVG source can't use projection. Only GeoJSON source supports projection.\");\n }\n\n projection = null;\n }\n\n if (!(projection.project && projection.unproject)) {\n if (process.env.NODE_ENV !== 'production') {\n warn('project and unproject must be both provided in the projeciton.');\n }\n\n projection = null;\n }\n }\n\n _this.projection = projection;\n var boundingRect;\n\n if (projection) {\n // Can't reuse the raw bounding rect\n for (var i = 0; i < regions.length; i++) {\n var regionRect = regions[i].getBoundingRect(projection);\n boundingRect = boundingRect || regionRect.clone();\n boundingRect.union(regionRect);\n }\n } else {\n boundingRect = source.boundingRect;\n }\n\n _this.setBoundingRect(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height); // aspectScale and invertLongitute actually is the parameters default raw projection.\n // So we ignore them if projection is given.\n // Ignore default aspect scale if projection exits.\n\n\n _this.aspectScale = projection ? 1 : zrUtil.retrieve2(opt.aspectScale, defaultParams.aspectScale); // Not invert longitude if projection exits.\n\n _this._invertLongitute = projection ? false : defaultParams.invertLongitute;\n return _this;\n }\n\n Geo.prototype._transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var invertLongitute = this._invertLongitute;\n rect = rect.clone();\n\n if (invertLongitute) {\n // Longitude is inverted.\n rect.y = -rect.y - rect.height;\n }\n\n var rawTransformable = this._rawTransformable;\n rawTransformable.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\n var rawParent = rawTransformable.parent;\n rawTransformable.parent = null;\n rawTransformable.decomposeTransform();\n rawTransformable.parent = rawParent;\n\n if (invertLongitute) {\n rawTransformable.scaleY = -rawTransformable.scaleY;\n }\n\n this._updateTransform();\n };\n\n Geo.prototype.getRegion = function (name) {\n return this._regionsMap.get(name);\n };\n\n Geo.prototype.getRegionByCoord = function (coord) {\n var regions = this.regions;\n\n for (var i = 0; i < regions.length; i++) {\n var region = regions[i];\n\n if (region.type === 'geoJSON' && region.contain(coord)) {\n return regions[i];\n }\n }\n };\n /**\n * Add geoCoord for indexing by name\n */\n\n\n Geo.prototype.addGeoCoord = function (name, geoCoord) {\n this._nameCoordMap.set(name, geoCoord);\n };\n /**\n * Get geoCoord by name\n */\n\n\n Geo.prototype.getGeoCoord = function (name) {\n var region = this._regionsMap.get(name); // Calculate center only on demand.\n\n\n return this._nameCoordMap.get(name) || region && region.getCenter();\n };\n\n Geo.prototype.dataToPoint = function (data, noRoam, out) {\n if (zrUtil.isString(data)) {\n // Map area name to geoCoord\n data = this.getGeoCoord(data);\n }\n\n if (data) {\n var projection = this.projection;\n\n if (projection) {\n // projection may return null point.\n data = projection.project(data);\n }\n\n return data && this.projectedToPoint(data, noRoam, out);\n }\n };\n\n Geo.prototype.pointToData = function (point) {\n var projection = this.projection;\n\n if (projection) {\n // projection may return null point.\n point = projection.unproject(point);\n }\n\n return point && this.pointToProjected(point);\n };\n /**\n * Point to projected data. Same with pointToData when projection is used.\n */\n\n\n Geo.prototype.pointToProjected = function (point) {\n return _super.prototype.pointToData.call(this, point);\n };\n\n Geo.prototype.projectedToPoint = function (projected, noRoam, out) {\n return _super.prototype.dataToPoint.call(this, projected, noRoam, out);\n };\n\n Geo.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n\n Geo.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n\n return Geo;\n}(View);\n\n;\nzrUtil.mixin(Geo, View);\n\nfunction getCoordSys(finder) {\n var geoModel = finder.geoModel;\n var seriesModel = finder.seriesModel;\n return geoModel ? geoModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem // For map series.\n || (seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0] || {}).coordinateSystem : null;\n}\n\nexport default Geo;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src啊/ElectronicMallVue/node_modules/echarts/lib/coord/geo/Geo.js"],"names":["__extends","zrUtil","BoundingRect","View","geoSourceManager","SINGLE_REFERRING","warn","GEO_DEFAULT_PARAMS","aspectScale","invertLongitute","geo2DDimensions","Geo","_super","name","map","opt","_this","call","dimensions","type","_nameCoordMap","createHashMap","projection","source","load","nameMap","nameProperty","resource","getGeoResource","resourceType","regions","defaultParams","_regionsMap","regionsMap","process","env","NODE_ENV","project","unproject","boundingRect","i","length","regionRect","getBoundingRect","clone","union","setBoundingRect","x","y","width","height","retrieve2","_invertLongitute","prototype","_transformTo","rect","rawTransformable","_rawTransformable","transform","calculateTransform","rawParent","parent","decomposeTransform","scaleY","_updateTransform","getRegion","get","getRegionByCoord","coord","region","contain","addGeoCoord","geoCoord","set","getGeoCoord","getCenter","dataToPoint","data","noRoam","out","isString","projectedToPoint","pointToData","point","pointToProjected","projected","convertToPixel","ecModel","finder","value","coordSys","getCoordSys","convertFromPixel","pixel","mixin","geoModel","seriesModel","coordinateSystem","getReferringComponents","models"],"mappings":";;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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A1C,EAA4D8F,MAA5D,CAAmE,CAAnE,KAAyE,EAA1E,EAA8EF,gBADxB,GAC2C,IADpG;AAED;;AAED,eAAetF,GAAf","sourcesContent":["\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport View from '../View.js';\nimport geoSourceManager from './geoSourceManager.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nimport { warn } from '../../util/log.js';\nvar GEO_DEFAULT_PARAMS = {\n 'geoJSON': {\n aspectScale: 0.75,\n invertLongitute: true\n },\n 'geoSVG': {\n aspectScale: 1,\n invertLongitute: false\n }\n};\nexport var geo2DDimensions = ['lng', 'lat'];\n\nvar Geo =\n/** @class */\nfunction (_super) {\n __extends(Geo, _super);\n\n function Geo(name, map, opt) {\n var _this = _super.call(this, name) || this;\n\n _this.dimensions = geo2DDimensions;\n _this.type = 'geo'; // Only store specified name coord via `addGeoCoord`.\n\n _this._nameCoordMap = zrUtil.createHashMap();\n _this.map = map;\n var projection = opt.projection;\n var source = geoSourceManager.load(map, opt.nameMap, opt.nameProperty);\n var resource = geoSourceManager.getGeoResource(map);\n var resourceType = _this.resourceType = resource ? resource.type : null;\n var regions = _this.regions = source.regions;\n var defaultParams = GEO_DEFAULT_PARAMS[resource.type];\n _this._regionsMap = source.regionsMap;\n _this.regions = source.regions;\n\n if (process.env.NODE_ENV !== 'production' && projection) {\n // Do some check\n if (resourceType === 'geoSVG') {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Map \" + map + \" with SVG source can't use projection. Only GeoJSON source supports projection.\");\n }\n\n projection = null;\n }\n\n if (!(projection.project && projection.unproject)) {\n if (process.env.NODE_ENV !== 'production') {\n warn('project and unproject must be both provided in the projeciton.');\n }\n\n projection = null;\n }\n }\n\n _this.projection = projection;\n var boundingRect;\n\n if (projection) {\n // Can't reuse the raw bounding rect\n for (var i = 0; i < regions.length; i++) {\n var regionRect = regions[i].getBoundingRect(projection);\n boundingRect = boundingRect || regionRect.clone();\n boundingRect.union(regionRect);\n }\n } else {\n boundingRect = source.boundingRect;\n }\n\n _this.setBoundingRect(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height); // aspectScale and invertLongitute actually is the parameters default raw projection.\n // So we ignore them if projection is given.\n // Ignore default aspect scale if projection exits.\n\n\n _this.aspectScale = projection ? 1 : zrUtil.retrieve2(opt.aspectScale, defaultParams.aspectScale); // Not invert longitude if projection exits.\n\n _this._invertLongitute = projection ? false : defaultParams.invertLongitute;\n return _this;\n }\n\n Geo.prototype._transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var invertLongitute = this._invertLongitute;\n rect = rect.clone();\n\n if (invertLongitute) {\n // Longitude is inverted.\n rect.y = -rect.y - rect.height;\n }\n\n var rawTransformable = this._rawTransformable;\n rawTransformable.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\n var rawParent = rawTransformable.parent;\n rawTransformable.parent = null;\n rawTransformable.decomposeTransform();\n rawTransformable.parent = rawParent;\n\n if (invertLongitute) {\n rawTransformable.scaleY = -rawTransformable.scaleY;\n }\n\n this._updateTransform();\n };\n\n Geo.prototype.getRegion = function (name) {\n return this._regionsMap.get(name);\n };\n\n Geo.prototype.getRegionByCoord = function (coord) {\n var regions = this.regions;\n\n for (var i = 0; i < regions.length; i++) {\n var region = regions[i];\n\n if (region.type === 'geoJSON' && region.contain(coord)) {\n return regions[i];\n }\n }\n };\n /**\n * Add geoCoord for indexing by name\n */\n\n\n Geo.prototype.addGeoCoord = function (name, geoCoord) {\n this._nameCoordMap.set(name, geoCoord);\n };\n /**\n * Get geoCoord by name\n */\n\n\n Geo.prototype.getGeoCoord = function (name) {\n var region = this._regionsMap.get(name); // Calculate center only on demand.\n\n\n return this._nameCoordMap.get(name) || region && region.getCenter();\n };\n\n Geo.prototype.dataToPoint = function (data, noRoam, out) {\n if (zrUtil.isString(data)) {\n // Map area name to geoCoord\n data = this.getGeoCoord(data);\n }\n\n if (data) {\n var projection = this.projection;\n\n if (projection) {\n // projection may return null point.\n data = projection.project(data);\n }\n\n return data && this.projectedToPoint(data, noRoam, out);\n }\n };\n\n Geo.prototype.pointToData = function (point) {\n var projection = this.projection;\n\n if (projection) {\n // projection may return null point.\n point = projection.unproject(point);\n }\n\n return point && this.pointToProjected(point);\n };\n /**\n * Point to projected data. Same with pointToData when projection is used.\n */\n\n\n Geo.prototype.pointToProjected = function (point) {\n return _super.prototype.pointToData.call(this, point);\n };\n\n Geo.prototype.projectedToPoint = function (projected, noRoam, out) {\n return _super.prototype.dataToPoint.call(this, projected, noRoam, out);\n };\n\n Geo.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n\n Geo.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n\n return Geo;\n}(View);\n\n;\nzrUtil.mixin(Geo, View);\n\nfunction getCoordSys(finder) {\n var geoModel = finder.geoModel;\n var seriesModel = finder.seriesModel;\n return geoModel ? geoModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem // For map series.\n || (seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0] || {}).coordinateSystem : null;\n}\n\nexport default Geo;"]},"metadata":{},"sourceType":"module"}