{"ast":null,"code":"import \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * AUTO-GENERATED FILE. DO NOT MODIFY.\r\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Geo, { geo2DDimensions } from './Geo.js';\nimport * as layout from '../../util/layout.js';\nimport * as numberUtil from '../../util/number.js';\nimport geoSourceManager from './geoSourceManager.js';\nimport * as vector from 'zrender/lib/core/vector.js';\n/**\r\n * Resize method bound to the geo\r\n */\n\nfunction resizeGeo(geoModel, api) {\n var boundingCoords = geoModel.get('boundingCoords');\n\n if (boundingCoords != null) {\n var leftTop_1 = boundingCoords[0];\n var rightBottom_1 = boundingCoords[1];\n\n if (!(isFinite(leftTop_1[0]) && isFinite(leftTop_1[1]) && isFinite(rightBottom_1[0]) && isFinite(rightBottom_1[1]))) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Invalid boundingCoords');\n }\n } else {\n // Sample around the lng/lat rect and use projection to calculate actual bounding rect.\n var projection_1 = this.projection;\n\n if (projection_1) {\n var xMin = leftTop_1[0];\n var yMin = leftTop_1[1];\n var xMax = rightBottom_1[0];\n var yMax = rightBottom_1[1];\n leftTop_1 = [Infinity, Infinity];\n rightBottom_1 = [-Infinity, -Infinity]; // TODO better way?\n\n var sampleLine = function sampleLine(x0, y0, x1, y1) {\n var dx = x1 - x0;\n var dy = y1 - y0;\n\n for (var i = 0; i <= 100; i++) {\n var p = i / 100;\n var pt = projection_1.project([x0 + dx * p, y0 + dy * p]);\n vector.min(leftTop_1, leftTop_1, pt);\n vector.max(rightBottom_1, rightBottom_1, pt);\n }\n }; // Top\n\n\n sampleLine(xMin, yMin, xMax, yMin); // Right\n\n sampleLine(xMax, yMin, xMax, yMax); // Bottom\n\n sampleLine(xMax, yMax, xMin, yMax); // Left\n\n sampleLine(xMin, yMax, xMax, yMin);\n }\n\n this.setBoundingRect(leftTop_1[0], leftTop_1[1], rightBottom_1[0] - leftTop_1[0], rightBottom_1[1] - leftTop_1[1]);\n }\n }\n\n var rect = this.getBoundingRect();\n var centerOption = geoModel.get('layoutCenter');\n var sizeOption = geoModel.get('layoutSize');\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n var aspect = rect.width / rect.height * this.aspectScale;\n var useCenterAndSize = false;\n var center;\n var size;\n\n if (centerOption && sizeOption) {\n center = [numberUtil.parsePercent(centerOption[0], viewWidth), numberUtil.parsePercent(centerOption[1], viewHeight)];\n size = numberUtil.parsePercent(sizeOption, Math.min(viewWidth, viewHeight));\n\n if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) {\n useCenterAndSize = true;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.');\n }\n }\n }\n\n var viewRect;\n\n if (useCenterAndSize) {\n viewRect = {};\n\n if (aspect > 1) {\n // Width is same with size\n viewRect.width = size;\n viewRect.height = size / aspect;\n } else {\n viewRect.height = size;\n viewRect.width = size * aspect;\n }\n\n viewRect.y = center[1] - viewRect.height / 2;\n viewRect.x = center[0] - viewRect.width / 2;\n } else {\n // Use left/top/width/height\n var boxLayoutOption = geoModel.getBoxLayoutParams();\n boxLayoutOption.aspect = aspect;\n viewRect = layout.getLayoutRect(boxLayoutOption, {\n width: viewWidth,\n height: viewHeight\n });\n }\n\n this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);\n this.setCenter(geoModel.get('center'));\n this.setZoom(geoModel.get('zoom'));\n} // Back compat for ECharts2, where the coord map is set on map series:\n// {type: 'map', geoCoord: {'cityA': [116.46,39.92], 'cityA': [119.12,24.61]}},\n\n\nfunction setGeoCoords(geo, model) {\n zrUtil.each(model.get('geoCoord'), function (geoCoord, name) {\n geo.addGeoCoord(name, geoCoord);\n });\n}\n\nvar GeoCreator =\n/** @class */\nfunction () {\n function GeoCreator() {\n // For deciding which dimensions to use when creating list data\n this.dimensions = geo2DDimensions;\n }\n\n GeoCreator.prototype.create = function (ecModel, api) {\n var geoList = [];\n\n function getCommonGeoProperties(model) {\n return {\n nameProperty: model.get('nameProperty'),\n aspectScale: model.get('aspectScale'),\n projection: model.get('projection')\n };\n } // FIXME Create each time may be slow\n\n\n ecModel.eachComponent('geo', function (geoModel, idx) {\n var mapName = geoModel.get('map');\n var geo = new Geo(mapName + idx, mapName, zrUtil.extend({\n nameMap: geoModel.get('nameMap')\n }, getCommonGeoProperties(geoModel)));\n geo.zoomLimit = geoModel.get('scaleLimit');\n geoList.push(geo); // setGeoCoords(geo, geoModel);\n\n geoModel.coordinateSystem = geo;\n geo.model = geoModel; // Inject resize method\n\n geo.resize = resizeGeo;\n geo.resize(geoModel, api);\n });\n ecModel.eachSeries(function (seriesModel) {\n var coordSys = seriesModel.get('coordinateSystem');\n\n if (coordSys === 'geo') {\n var geoIndex = seriesModel.get('geoIndex') || 0;\n seriesModel.coordinateSystem = geoList[geoIndex];\n }\n }); // If has map series\n\n var mapModelGroupBySeries = {};\n ecModel.eachSeriesByType('map', function (seriesModel) {\n if (!seriesModel.getHostGeoModel()) {\n var mapType = seriesModel.getMapType();\n mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || [];\n mapModelGroupBySeries[mapType].push(seriesModel);\n }\n });\n zrUtil.each(mapModelGroupBySeries, function (mapSeries, mapType) {\n var nameMapList = zrUtil.map(mapSeries, function (singleMapSeries) {\n return singleMapSeries.get('nameMap');\n });\n var geo = new Geo(mapType, mapType, zrUtil.extend({\n nameMap: zrUtil.mergeAll(nameMapList)\n }, getCommonGeoProperties(mapSeries[0])));\n geo.zoomLimit = zrUtil.retrieve.apply(null, zrUtil.map(mapSeries, function (singleMapSeries) {\n return singleMapSeries.get('scaleLimit');\n }));\n geoList.push(geo); // Inject resize method\n\n geo.resize = resizeGeo;\n geo.resize(mapSeries[0], api);\n zrUtil.each(mapSeries, function (singleMapSeries) {\n singleMapSeries.coordinateSystem = geo;\n setGeoCoords(geo, singleMapSeries);\n });\n });\n return geoList;\n };\n /**\r\n * Fill given regions array\r\n */\n\n\n GeoCreator.prototype.getFilledRegions = function (originRegionArr, mapName, nameMap, nameProperty) {\n // Not use the original\n var regionsArr = (originRegionArr || []).slice();\n var dataNameMap = zrUtil.createHashMap();\n\n for (var i = 0; i < regionsArr.length; i++) {\n dataNameMap.set(regionsArr[i].name, regionsArr[i]);\n }\n\n var source = geoSourceManager.load(mapName, nameMap, nameProperty);\n zrUtil.each(source.regions, function (region) {\n var name = region.name;\n !dataNameMap.get(name) && regionsArr.push({\n name: name\n });\n });\n return regionsArr;\n };\n\n return GeoCreator;\n}();\n\nvar geoCreator = new GeoCreator();\nexport default geoCreator;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/coord/geo/geoCreator.js"],"names":["zrUtil","Geo","geo2DDimensions","layout","numberUtil","geoSourceManager","vector","resizeGeo","geoModel","api","boundingCoords","get","leftTop_1","rightBottom_1","isFinite","process","env","NODE_ENV","console","error","projection_1","projection","xMin","yMin","xMax","yMax","Infinity","sampleLine","x0","y0","x1","y1","dx","dy","i","p","pt","project","min","max","setBoundingRect","rect","getBoundingRect","centerOption","sizeOption","viewWidth","getWidth","viewHeight","getHeight","aspect","width","height","aspectScale","useCenterAndSize","center","size","parsePercent","Math","isNaN","warn","viewRect","y","x","boxLayoutOption","getBoxLayoutParams","getLayoutRect","setViewRect","setCenter","setZoom","setGeoCoords","geo","model","each","geoCoord","name","addGeoCoord","GeoCreator","dimensions","prototype","create","ecModel","geoList","getCommonGeoProperties","nameProperty","eachComponent","idx","mapName","extend","nameMap","zoomLimit","push","coordinateSystem","resize","eachSeries","seriesModel","coordSys","geoIndex","mapModelGroupBySeries","eachSeriesByType","getHostGeoModel","mapType","getMapType","mapSeries","nameMapList","map","singleMapSeries","mergeAll","retrieve","apply","getFilledRegions","originRegionArr","regionsArr","slice","dataNameMap","createHashMap","length","set","source","load","regions","region","geoCreator"],"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;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,MAAZ,MAAwB,0BAAxB;AACA,OAAOC,GAAP,IAAcC,eAAd,QAAqC,UAArC;AACA,OAAO,KAAKC,MAAZ,MAAwB,sBAAxB;AACA,OAAO,KAAKC,UAAZ,MAA4B,sBAA5B;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,OAAO,KAAKC,MAAZ,MAAwB,4B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AAC7E,CAAD,CAAV,CAAcwC,IAA9B,EAAoCqC,UAAU,CAAC7E,CAAD,CAA9C;AACD;;AAED,QAAImF,MAAM,GAAGhH,gBAAgB,CAACiH,IAAjB,CAAsBhC,OAAtB,EAA+BE,OAA/B,EAAwCL,YAAxC,CAAb;AACAnF,IAAAA,MAAM,CAACwE,IAAP,CAAY6C,MAAM,CAACE,OAAnB,EAA4B,UAAUC,MAAV,EAAkB;AAC5C,UAAI9C,IAAI,GAAG8C,MAAM,CAAC9C,IAAlB;AACA,OAACuC,WAAW,CAACtG,GAAZ,CAAgB+D,IAAhB,CAAD,IAA0BqC,UAAU,CAACrB,IAAX,CAAgB;AACxChB,QAAAA,IAAI,EAAEA;AADkC,OAAhB,CAA1B;AAGD,KALD;AAMA,WAAOqC,UAAP;AACD,GAjBD;;AAmBA,SAAOnC,UAAP;AACD,CA/FD,EAFA;;AAmGA,IAAI6C,UAAU,GAAG,IAAI7C,UAAJ,EAAjB;AACA,eAAe6C,UAAf","sourcesContent":["\r\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\n/**\r\n * AUTO-GENERATED FILE. DO NOT MODIFY.\r\n */\r\n\r\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\nimport * as zrUtil from 'zrender/lib/core/util.js';\r\nimport Geo, { geo2DDimensions } from './Geo.js';\r\nimport * as layout from '../../util/layout.js';\r\nimport * as numberUtil from '../../util/number.js';\r\nimport geoSourceManager from './geoSourceManager.js';\r\nimport * as vector from 'zrender/lib/core/vector.js';\r\n/**\r\n * Resize method bound to the geo\r\n */\r\n\r\nfunction resizeGeo(geoModel, api) {\r\n var boundingCoords = geoModel.get('boundingCoords');\r\n\r\n if (boundingCoords != null) {\r\n var leftTop_1 = boundingCoords[0];\r\n var rightBottom_1 = boundingCoords[1];\r\n\r\n if (!(isFinite(leftTop_1[0]) && isFinite(leftTop_1[1]) && isFinite(rightBottom_1[0]) && isFinite(rightBottom_1[1]))) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n console.error('Invalid boundingCoords');\r\n }\r\n } else {\r\n // Sample around the lng/lat rect and use projection to calculate actual bounding rect.\r\n var projection_1 = this.projection;\r\n\r\n if (projection_1) {\r\n var xMin = leftTop_1[0];\r\n var yMin = leftTop_1[1];\r\n var xMax = rightBottom_1[0];\r\n var yMax = rightBottom_1[1];\r\n leftTop_1 = [Infinity, Infinity];\r\n rightBottom_1 = [-Infinity, -Infinity]; // TODO better way?\r\n\r\n var sampleLine = function (x0, y0, x1, y1) {\r\n var dx = x1 - x0;\r\n var dy = y1 - y0;\r\n\r\n for (var i = 0; i <= 100; i++) {\r\n var p = i / 100;\r\n var pt = projection_1.project([x0 + dx * p, y0 + dy * p]);\r\n vector.min(leftTop_1, leftTop_1, pt);\r\n vector.max(rightBottom_1, rightBottom_1, pt);\r\n }\r\n }; // Top\r\n\r\n\r\n sampleLine(xMin, yMin, xMax, yMin); // Right\r\n\r\n sampleLine(xMax, yMin, xMax, yMax); // Bottom\r\n\r\n sampleLine(xMax, yMax, xMin, yMax); // Left\r\n\r\n sampleLine(xMin, yMax, xMax, yMin);\r\n }\r\n\r\n this.setBoundingRect(leftTop_1[0], leftTop_1[1], rightBottom_1[0] - leftTop_1[0], rightBottom_1[1] - leftTop_1[1]);\r\n }\r\n }\r\n\r\n var rect = this.getBoundingRect();\r\n var centerOption = geoModel.get('layoutCenter');\r\n var sizeOption = geoModel.get('layoutSize');\r\n var viewWidth = api.getWidth();\r\n var viewHeight = api.getHeight();\r\n var aspect = rect.width / rect.height * this.aspectScale;\r\n var useCenterAndSize = false;\r\n var center;\r\n var size;\r\n\r\n if (centerOption && sizeOption) {\r\n center = [numberUtil.parsePercent(centerOption[0], viewWidth), numberUtil.parsePercent(centerOption[1], viewHeight)];\r\n size = numberUtil.parsePercent(sizeOption, Math.min(viewWidth, viewHeight));\r\n\r\n if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) {\r\n useCenterAndSize = true;\r\n } else {\r\n if (process.env.NODE_ENV !== 'production') {\r\n console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.');\r\n }\r\n }\r\n }\r\n\r\n var viewRect;\r\n\r\n if (useCenterAndSize) {\r\n viewRect = {};\r\n\r\n if (aspect > 1) {\r\n // Width is same with size\r\n viewRect.width = size;\r\n viewRect.height = size / aspect;\r\n } else {\r\n viewRect.height = size;\r\n viewRect.width = size * aspect;\r\n }\r\n\r\n viewRect.y = center[1] - viewRect.height / 2;\r\n viewRect.x = center[0] - viewRect.width / 2;\r\n } else {\r\n // Use left/top/width/height\r\n var boxLayoutOption = geoModel.getBoxLayoutParams();\r\n boxLayoutOption.aspect = aspect;\r\n viewRect = layout.getLayoutRect(boxLayoutOption, {\r\n width: viewWidth,\r\n height: viewHeight\r\n });\r\n }\r\n\r\n this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);\r\n this.setCenter(geoModel.get('center'));\r\n this.setZoom(geoModel.get('zoom'));\r\n} // Back compat for ECharts2, where the coord map is set on map series:\r\n// {type: 'map', geoCoord: {'cityA': [116.46,39.92], 'cityA': [119.12,24.61]}},\r\n\r\n\r\nfunction setGeoCoords(geo, model) {\r\n zrUtil.each(model.get('geoCoord'), function (geoCoord, name) {\r\n geo.addGeoCoord(name, geoCoord);\r\n });\r\n}\r\n\r\nvar GeoCreator =\r\n/** @class */\r\nfunction () {\r\n function GeoCreator() {\r\n // For deciding which dimensions to use when creating list data\r\n this.dimensions = geo2DDimensions;\r\n }\r\n\r\n GeoCreator.prototype.create = function (ecModel, api) {\r\n var geoList = [];\r\n\r\n function getCommonGeoProperties(model) {\r\n return {\r\n nameProperty: model.get('nameProperty'),\r\n aspectScale: model.get('aspectScale'),\r\n projection: model.get('projection')\r\n };\r\n } // FIXME Create each time may be slow\r\n\r\n\r\n ecModel.eachComponent('geo', function (geoModel, idx) {\r\n var mapName = geoModel.get('map');\r\n var geo = new Geo(mapName + idx, mapName, zrUtil.extend({\r\n nameMap: geoModel.get('nameMap')\r\n }, getCommonGeoProperties(geoModel)));\r\n geo.zoomLimit = geoModel.get('scaleLimit');\r\n geoList.push(geo); // setGeoCoords(geo, geoModel);\r\n\r\n geoModel.coordinateSystem = geo;\r\n geo.model = geoModel; // Inject resize method\r\n\r\n geo.resize = resizeGeo;\r\n geo.resize(geoModel, api);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var coordSys = seriesModel.get('coordinateSystem');\r\n\r\n if (coordSys === 'geo') {\r\n var geoIndex = seriesModel.get('geoIndex') || 0;\r\n seriesModel.coordinateSystem = geoList[geoIndex];\r\n }\r\n }); // If has map series\r\n\r\n var mapModelGroupBySeries = {};\r\n ecModel.eachSeriesByType('map', function (seriesModel) {\r\n if (!seriesModel.getHostGeoModel()) {\r\n var mapType = seriesModel.getMapType();\r\n mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || [];\r\n mapModelGroupBySeries[mapType].push(seriesModel);\r\n }\r\n });\r\n zrUtil.each(mapModelGroupBySeries, function (mapSeries, mapType) {\r\n var nameMapList = zrUtil.map(mapSeries, function (singleMapSeries) {\r\n return singleMapSeries.get('nameMap');\r\n });\r\n var geo = new Geo(mapType, mapType, zrUtil.extend({\r\n nameMap: zrUtil.mergeAll(nameMapList)\r\n }, getCommonGeoProperties(mapSeries[0])));\r\n geo.zoomLimit = zrUtil.retrieve.apply(null, zrUtil.map(mapSeries, function (singleMapSeries) {\r\n return singleMapSeries.get('scaleLimit');\r\n }));\r\n geoList.push(geo); // Inject resize method\r\n\r\n geo.resize = resizeGeo;\r\n geo.resize(mapSeries[0], api);\r\n zrUtil.each(mapSeries, function (singleMapSeries) {\r\n singleMapSeries.coordinateSystem = geo;\r\n setGeoCoords(geo, singleMapSeries);\r\n });\r\n });\r\n return geoList;\r\n };\r\n /**\r\n * Fill given regions array\r\n */\r\n\r\n\r\n GeoCreator.prototype.getFilledRegions = function (originRegionArr, mapName, nameMap, nameProperty) {\r\n // Not use the original\r\n var regionsArr = (originRegionArr || []).slice();\r\n var dataNameMap = zrUtil.createHashMap();\r\n\r\n for (var i = 0; i < regionsArr.length; i++) {\r\n dataNameMap.set(regionsArr[i].name, regionsArr[i]);\r\n }\r\n\r\n var source = geoSourceManager.load(mapName, nameMap, nameProperty);\r\n zrUtil.each(source.regions, function (region) {\r\n var name = region.name;\r\n !dataNameMap.get(name) && regionsArr.push({\r\n name: name\r\n });\r\n });\r\n return regionsArr;\r\n };\r\n\r\n return GeoCreator;\r\n}();\r\n\r\nvar geoCreator = new GeoCreator();\r\nexport default geoCreator;"]},"metadata":{},"sourceType":"module"}