1 line
15 KiB
JSON
1 line
15 KiB
JSON
{"ast":null,"code":"import \"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 GeoModel from '../../coord/geo/GeoModel.js';\nimport geoCreator from '../../coord/geo/geoCreator.js';\nimport { each } from 'zrender/lib/core/util.js';\nimport { updateCenterAndZoom } from '../../action/roamHelper.js';\nimport GeoView from './GeoView.js';\nimport geoSourceManager from '../../coord/geo/geoSourceManager.js';\n\nfunction registerMap(mapName, geoJson, specialAreas) {\n geoSourceManager.registerMap(mapName, geoJson, specialAreas);\n}\n\nexport function install(registers) {\n registers.registerCoordinateSystem('geo', geoCreator);\n registers.registerComponentModel(GeoModel);\n registers.registerComponentView(GeoView);\n registers.registerImpl('registerMap', registerMap);\n registers.registerImpl('getMap', function (mapName) {\n return geoSourceManager.getMapForUser(mapName);\n });\n\n function makeAction(method, actionInfo) {\n actionInfo.update = 'geo:updateSelectStatus';\n registers.registerAction(actionInfo, function (payload, ecModel) {\n var selected = {};\n var allSelected = [];\n ecModel.eachComponent({\n mainType: 'geo',\n query: payload\n }, function (geoModel) {\n geoModel[method](payload.name);\n var geo = geoModel.coordinateSystem;\n each(geo.regions, function (region) {\n selected[region.name] = geoModel.isSelected(region.name) || false;\n }); // Notice: there might be duplicated name in different regions.\n\n var names = [];\n each(selected, function (v, name) {\n selected[name] && names.push(name);\n });\n allSelected.push({\n geoIndex: geoModel.componentIndex,\n // Use singular, the same naming convention as the event `selectchanged`.\n name: names\n });\n });\n return {\n selected: selected,\n allSelected: allSelected,\n name: payload.name\n };\n });\n }\n\n makeAction('toggleSelected', {\n type: 'geoToggleSelect',\n event: 'geoselectchanged'\n });\n makeAction('select', {\n type: 'geoSelect',\n event: 'geoselected'\n });\n makeAction('unSelect', {\n type: 'geoUnSelect',\n event: 'geounselected'\n });\n /**\r\n * @payload\r\n * @property {string} [componentType=series]\r\n * @property {number} [dx]\r\n * @property {number} [dy]\r\n * @property {number} [zoom]\r\n * @property {number} [originX]\r\n * @property {number} [originY]\r\n */\n\n registers.registerAction({\n type: 'geoRoam',\n event: 'geoRoam',\n update: 'updateTransform'\n }, function (payload, ecModel) {\n var componentType = payload.componentType || 'series';\n ecModel.eachComponent({\n mainType: componentType,\n query: payload\n }, function (componentModel) {\n var geo = componentModel.coordinateSystem;\n\n if (geo.type !== 'geo') {\n return;\n }\n\n var res = updateCenterAndZoom(geo, payload, componentModel.get('scaleLimit'));\n componentModel.setCenter && componentModel.setCenter(res.center);\n componentModel.setZoom && componentModel.setZoom(res.zoom); // All map series with same `map` use the same geo coordinate system\n // So the center and zoom must be in sync. Include the series not selected by legend\n\n if (componentType === 'series') {\n each(componentModel.seriesGroup, function (seriesModel) {\n seriesModel.setCenter(res.center);\n seriesModel.setZoom(res.zoom);\n });\n }\n });\n });\n}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/component/geo/install.js"],"names":["GeoModel","geoCreator","each","updateCenterAndZoom","GeoView","geoSourceManager","registerMap","mapName","geoJson","specialAreas","install","registers","registerCoordinateSystem","registerComponentModel","registerComponentView","registerImpl","getMapForUser","makeAction","method","actionInfo","update","registerAction","payload","ecModel","selected","allSelected","eachComponent","mainType","query","geoModel","name","geo","coordinateSystem","regions","region","isSelected","names","v","push","geoIndex","componentIndex","type","event","componentType","componentModel","res","get","setCenter","center","setZoom","zoom","seriesGroup","seriesModel"],"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,OAAOA,QAAP,MAAqB,6BAArB;AACA,OAAOC,UAAP,MAAuB,+BAAvB;AACA,SAASC,IAAT,QAAqB,0BAArB;AACA,SAASC,mBAAT,QAAoC,4BAApC;AACA,OAAOC,OAAP,MAAoB,cAApB;AACA,OAAOC,gBAAP,MAA6B,qCAA7B;;AAEA,SAASC,WAAT,CAAqBC,OAArB,EAA8BC,OAA9B,EAAuCC,YAAvC,EAAqD;AACnDJ,EAAAA,gBAAgB,CAACC,WAAjB,CAA6BC,OAA7B,EAAsCC,OAAtC,EAA+CC,YAA/C;AACD;;AAED,OAAO,SAASC,OAAT,CAAiBC,SAAjB,EAA4B;AACjCA,EAAAA,SAAS,CAACC,wBAAV,CAAmC,KAAnC,EAA0CX,UAA1C;AACAU,EAAAA,SAAS,CAACE,sBAAV,CAAiCb,QAAjC;AACAW,EAAAA,S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MT,OAAN,EAAesB,cAAc,CAACE,GAAf,CAAmB,YAAnB,CAAf,CAA7B;AACAF,MAAAA,cAAc,CAACG,SAAf,IAA4BH,cAAc,CAACG,SAAf,CAAyBF,GAAG,CAACG,MAA7B,CAA5B;AACAJ,MAAAA,cAAc,CAACK,OAAf,IAA0BL,cAAc,CAACK,OAAf,CAAuBJ,GAAG,CAACK,IAA3B,CAA1B,CAT2B,CASiC;AAC5D;;AAEA,UAAIP,aAAa,KAAK,QAAtB,EAAgC;AAC9BzC,QAAAA,IAAI,CAAC0C,cAAc,CAACO,WAAhB,EAA6B,UAAUC,WAAV,EAAuB;AACtDA,UAAAA,WAAW,CAACL,SAAZ,CAAsBF,GAAG,CAACG,MAA1B;AACAI,UAAAA,WAAW,CAACH,OAAZ,CAAoBJ,GAAG,CAACK,IAAxB;AACD,SAHG,CAAJ;AAID;AACF,KArBD;AAsBD,GA5BD;AA6BD","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 GeoModel from '../../coord/geo/GeoModel.js';\r\nimport geoCreator from '../../coord/geo/geoCreator.js';\r\nimport { each } from 'zrender/lib/core/util.js';\r\nimport { updateCenterAndZoom } from '../../action/roamHelper.js';\r\nimport GeoView from './GeoView.js';\r\nimport geoSourceManager from '../../coord/geo/geoSourceManager.js';\r\n\r\nfunction registerMap(mapName, geoJson, specialAreas) {\r\n geoSourceManager.registerMap(mapName, geoJson, specialAreas);\r\n}\r\n\r\nexport function install(registers) {\r\n registers.registerCoordinateSystem('geo', geoCreator);\r\n registers.registerComponentModel(GeoModel);\r\n registers.registerComponentView(GeoView);\r\n registers.registerImpl('registerMap', registerMap);\r\n registers.registerImpl('getMap', function (mapName) {\r\n return geoSourceManager.getMapForUser(mapName);\r\n });\r\n\r\n function makeAction(method, actionInfo) {\r\n actionInfo.update = 'geo:updateSelectStatus';\r\n registers.registerAction(actionInfo, function (payload, ecModel) {\r\n var selected = {};\r\n var allSelected = [];\r\n ecModel.eachComponent({\r\n mainType: 'geo',\r\n query: payload\r\n }, function (geoModel) {\r\n geoModel[method](payload.name);\r\n var geo = geoModel.coordinateSystem;\r\n each(geo.regions, function (region) {\r\n selected[region.name] = geoModel.isSelected(region.name) || false;\r\n }); // Notice: there might be duplicated name in different regions.\r\n\r\n var names = [];\r\n each(selected, function (v, name) {\r\n selected[name] && names.push(name);\r\n });\r\n allSelected.push({\r\n geoIndex: geoModel.componentIndex,\r\n // Use singular, the same naming convention as the event `selectchanged`.\r\n name: names\r\n });\r\n });\r\n return {\r\n selected: selected,\r\n allSelected: allSelected,\r\n name: payload.name\r\n };\r\n });\r\n }\r\n\r\n makeAction('toggleSelected', {\r\n type: 'geoToggleSelect',\r\n event: 'geoselectchanged'\r\n });\r\n makeAction('select', {\r\n type: 'geoSelect',\r\n event: 'geoselected'\r\n });\r\n makeAction('unSelect', {\r\n type: 'geoUnSelect',\r\n event: 'geounselected'\r\n });\r\n /**\r\n * @payload\r\n * @property {string} [componentType=series]\r\n * @property {number} [dx]\r\n * @property {number} [dy]\r\n * @property {number} [zoom]\r\n * @property {number} [originX]\r\n * @property {number} [originY]\r\n */\r\n\r\n registers.registerAction({\r\n type: 'geoRoam',\r\n event: 'geoRoam',\r\n update: 'updateTransform'\r\n }, function (payload, ecModel) {\r\n var componentType = payload.componentType || 'series';\r\n ecModel.eachComponent({\r\n mainType: componentType,\r\n query: payload\r\n }, function (componentModel) {\r\n var geo = componentModel.coordinateSystem;\r\n\r\n if (geo.type !== 'geo') {\r\n return;\r\n }\r\n\r\n var res = updateCenterAndZoom(geo, payload, componentModel.get('scaleLimit'));\r\n componentModel.setCenter && componentModel.setCenter(res.center);\r\n componentModel.setZoom && componentModel.setZoom(res.zoom); // All map series with same `map` use the same geo coordinate system\r\n // So the center and zoom must be in sync. Include the series not selected by legend\r\n\r\n if (componentType === 'series') {\r\n each(componentModel.seriesGroup, function (seriesModel) {\r\n seriesModel.setCenter(res.center);\r\n seriesModel.setZoom(res.zoom);\r\n });\r\n }\r\n });\r\n });\r\n}"]},"metadata":{},"sourceType":"module"} |