From 18afa7a6c20640f4172f58bbcfc43f73cb29015e Mon Sep 17 00:00:00 2001 From: plainheart Date: Mon, 8 Jan 2024 00:01:33 +0800 Subject: [PATCH] release: 1.12.0 --- dist/echarts-extension-amap.cjs.js | 220 ++++++++++--------------- dist/echarts-extension-amap.esm.js | 218 ++++++++++-------------- dist/echarts-extension-amap.js | 220 ++++++++++--------------- dist/echarts-extension-amap.js.map | 2 +- dist/echarts-extension-amap.min.js | 6 +- dist/echarts-extension-amap.min.js.map | 2 +- examples/heatmap.html | 2 +- examples/heatmap_zh_CN.html | 2 +- examples/lines.html | 2 +- examples/lines_zh_CN.html | 2 +- examples/pie.html | 2 +- examples/pie_zh_CN.html | 2 +- examples/scatter.html | 2 +- examples/scatter_zh_CN.html | 2 +- package-lock.json | 4 +- package.json | 2 +- types.d.ts | 2 +- 17 files changed, 278 insertions(+), 414 deletions(-) diff --git a/dist/echarts-extension-amap.cjs.js b/dist/echarts-extension-amap.cjs.js index 55a3e0e..0ef6c3e 100644 --- a/dist/echarts-extension-amap.cjs.js +++ b/dist/echarts-extension-amap.cjs.js @@ -1,11 +1,11 @@ /*! * echarts-extension-amap - * @version 1.11.0 + * @version 1.12.0 * @author plainheart * * MIT License * - * Copyright (c) 2019-2022 Zhongxiang.Wang + * Copyright (c) 2019-2024 Zhongxiang Wang * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -28,19 +28,20 @@ */ 'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); - var echarts = require('echarts/lib/echarts'); var ecVer = echarts.version.split('.'); var isNewEC = ecVer[0] > 4; +var COMPONENT_TYPE = 'amap'; + /* global AMap */ -// `AMap.version` only exists in AMap 2.x -// For AMap 1.x, it's `AMap.v` -// use function instead of constant to allow importing the plugin before AMap is loaded +// The version property is `AMap.v` in AMap 1.x, +// but `AMap.version` may also exist (See #51) +// In AMap 2.x, it's `AMap.version` (Not sure if `AMap.v` exists) +// use function instead of constant to allow importing the plugin before AMap is loaded var isAMap2X = function isAMap2X() { - return AMap.version >= 2; + return !AMap.v && AMap.version && AMap.version.split('.')[0] >= 2; }; function v2Equal(a, b) { return a && b && a[0] === b[0] && a[1] === b[1]; @@ -67,73 +68,58 @@ function dataToCoordSize(dataSize, dataItem) { p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx]; return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]); }, this); -} // exclude private and unsupported options - +} -var excludedOptions = ['echartsLayerZIndex', // DEPRECATED since v1.9.0 +// exclude private and unsupported options +var excludedOptions = ['echartsLayerZIndex', +// DEPRECATED since v1.9.0 'echartsLayerInteractive', 'renderOnMoving', 'largeMode', 'returnMapCameraState', 'layers']; - function AMapCoordSys(amap, api) { this._amap = amap; this._api = api; - this._mapOffset = [0, 0]; // this.dimensions = ['lng', 'lat'] + this._mapOffset = [0, 0]; + // this.dimensions = ['lng', 'lat'] } - var AMapCoordSysProto = AMapCoordSys.prototype; - AMapCoordSysProto.setZoom = function (zoom) { this._zoom = zoom; }; - AMapCoordSysProto.setCenter = function (center) { var lnglat = new AMap.LngLat(center[0], center[1]); this._center = this._amap.lngLatToContainer(lnglat); }; - AMapCoordSysProto.setMapOffset = function (mapOffset) { this._mapOffset = mapOffset; }; - AMapCoordSysProto.setAMap = function (amap) { this._amap = amap; }; - AMapCoordSysProto.getAMap = function () { return this._amap; }; - AMapCoordSysProto.dataToPoint = function (data) { var lnglat = new AMap.LngLat(data[0], data[1]); - var px = this._amap.lngLatToContainer(lnglat); - var mapOffset = this._mapOffset; return [px.x - mapOffset[0], px.y - mapOffset[1]]; }; - AMapCoordSysProto.pointToData = function (pt) { var mapOffset = this._mapOffset; - var lnglat = this._amap.containerToLngLat(new AMap.Pixel(pt[0] + mapOffset[0], pt[1] + mapOffset[1])); - return [lnglat.lng, lnglat.lat]; }; - AMapCoordSysProto.getViewRect = function () { var api = this._api; return new echarts.graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight()); }; - AMapCoordSysProto.getRoamTransform = function () { return echarts.matrix.create(); }; - AMapCoordSysProto.prepareCustoms = function () { var rect = this.getViewRect(); return { coordSys: { - // The name exposed to user is always 'cartesian2d' but not 'grid'. - type: 'amap', + type: COMPONENT_TYPE, x: rect.x, y: rect.y, width: rect.width, @@ -145,45 +131,41 @@ AMapCoordSysProto.prepareCustoms = function () { } }; }; - AMapCoordSysProto.convertToPixel = function (ecModel, finder, value) { // here we don't use finder as only one amap component is allowed return this.dataToPoint(value); }; - AMapCoordSysProto.convertFromPixel = function (ecModel, finder, value) { // here we don't use finder as only one amap component is allowed return this.pointToData(value); -}; // less useful +}; + +// less useful // AMapCoordSysProto.containPoint = function(point) { // return this._amap.getBounds().contains(this.pointToData(point)); // } - AMapCoordSys.create = function (ecModel, api) { var amapCoordSys; - ecModel.eachComponent('amap', function (amapModel) { + ecModel.eachComponent(COMPONENT_TYPE, function (amapModel) { if (typeof AMap === 'undefined') { throw new Error('AMap api is not loaded'); } - if (amapCoordSys) { throw new Error('Only one amap component is allowed'); } - var amap = amapModel.getAMap(); var echartsLayerInteractive = amapModel.get('echartsLayerInteractive'); - if (!amap) { var root = api.getDom(); var painter = api.getZr().painter; var viewportRoot = painter.getViewportRoot(); - viewportRoot.className = 'amap-ec-layer'; // PENDING not hidden? - - viewportRoot.style.visibility = 'hidden'; // Not support IE8 - - var amapRoot = root.querySelector('.ec-extension-amap'); - + viewportRoot.className = COMPONENT_TYPE + '-ec-layer'; + // PENDING not hidden? + viewportRoot.style.visibility = 'hidden'; + var className = 'ec-extension-' + COMPONENT_TYPE; + // Not support IE8 + var amapRoot = root.querySelector('.' + className); if (amapRoot) { // Reset viewport left and top, which will be changed // in moving handler in AMapView @@ -191,44 +173,47 @@ AMapCoordSys.create = function (ecModel, api) { viewportRoot.style.top = '0px'; root.removeChild(amapRoot); } - amapRoot = document.createElement('div'); - amapRoot.className = 'ec-extension-amap'; + amapRoot.className = className; amapRoot.style.cssText = 'position:absolute;top:0;left:0;bottom:0;right:0;'; root.appendChild(amapRoot); var options = echarts.util.clone(amapModel.get()); - if ('echartsLayerZIndex' in options) { logWarn('DEPRECATED', 'the option `echartsLayerZIndex` has been removed since v1.9.0, use `echartsLayerInteractive` instead.'); - } // delete excluded options - - + } + // delete excluded options echarts.util.each(excludedOptions, function (key) { delete options[key]; }); - amap = new AMap.Map(amapRoot, options); // PENDING: should update the model option when the user call map.setXXX? + amap = new AMap.Map(amapRoot, options); + + // PENDING: should update the model option when the user call map.setXXX? + // const nativeSetMapStyle = amap.setMapStyle // const nativeSetLang = amap.setLang + // // PENDING // amap.setMapStyle = function () { // nativeSetMapStyle.apply(this, arguments) // amapModel.__mapStyle = amap.getMapStyle() // } + // // PENDING // nativeSetLang && (amap.setLang = function() { // nativeSetLang.apply(this, arguments) // amapModel.__mapLang = amap.getLang() // }) - // use `complete` callback to avoid NPE when first load amap + // use `complete` callback to avoid NPE when first load amap amap.on('complete', function () { - amapRoot.querySelector('.amap-maps').appendChild(viewportRoot); // PENDING - + amapRoot.querySelector('.amap-maps').appendChild(viewportRoot); + // PENDING viewportRoot.style.visibility = ''; }); amapModel.setAMap(amap); - amapModel.setEChartsLayer(viewportRoot); // Override + amapModel.setEChartsLayer(viewportRoot); + // Override painter.getViewportRootOffset = function () { return { offsetLeft: 0, @@ -236,48 +221,40 @@ AMapCoordSys.create = function (ecModel, api) { }; }; } - var oldEChartsLayerInteractive = amapModel.__echartsLayerInteractive; - if (oldEChartsLayerInteractive !== echartsLayerInteractive) { amapModel.setEChartsLayerInteractive(echartsLayerInteractive); amapModel.__echartsLayerInteractive = echartsLayerInteractive; } - var center = amapModel.get('center'); var zoom = amapModel.get('zoom'); - if (center && zoom) { var amapCenter = amap.getCenter(); var amapZoom = amap.getZoom(); var centerOrZoomChanged = amapModel.centerOrZoomChanged([amapCenter.lng, amapCenter.lat], amapZoom); - if (centerOrZoomChanged) { amap.setZoomAndCenter(zoom, new AMap.LngLat(center[0], center[1])); } - } // update map style(#13) - + } + // update map style(#13) var originalMapStyle = amapModel.__mapStyle; var newMapStyle = amapModel.get('mapStyle'); - if (originalMapStyle !== newMapStyle) { amap.setMapStyle(amapModel.__mapStyle = newMapStyle); - } // update map lang - // PENDING: AMap 2.x does not support `setLang` yet - + } + // update map lang + // PENDING: AMap 2.x does not support `setLang` yet if (amap.setLang) { var originalMapLang = amapModel.__mapLang; var newMapLang = amapModel.get('lang'); - if (originalMapLang !== newMapLang) { amap.setLang(amapModel.__mapLang = newMapLang); } } else { logWarn('CAVEAT', 'The current map doesn\'t support `setLang` API!', true); } - amapCoordSys = new AMapCoordSys(amap, api); amapCoordSys.setMapOffset(amapModel.__mapOffset || [0, 0]); amapCoordSys.setZoom(zoom); @@ -285,20 +262,20 @@ AMapCoordSys.create = function (ecModel, api) { amapModel.coordinateSystem = amapCoordSys; }); ecModel.eachSeries(function (seriesModel) { - if (seriesModel.get('coordinateSystem') === 'amap') { + if (seriesModel.get('coordinateSystem') === COMPONENT_TYPE) { // inject coordinate system seriesModel.coordinateSystem = amapCoordSys; } - }); // return created coordinate systems + }); + // return created coordinate systems return amapCoordSys && [amapCoordSys]; }; - AMapCoordSysProto.dimensions = AMapCoordSys.dimensions = ['lng', 'lat']; -AMapCoordSysProto.type = 'amap'; +AMapCoordSysProto.type = COMPONENT_TYPE; var AMapModel = { - type: 'amap', + type: COMPONENT_TYPE, setAMap: function setAMap(amap) { this.__amap = amap; }, @@ -311,7 +288,7 @@ var AMapModel = { getEChartsLayer: function getEChartsLayer() { return this.__echartsLayer; }, - setEChartsLayerVisiblity: function setEChartsLayerVisiblity(visible) { + setEChartsLayerVisibility: function setEChartsLayerVisibility(visible) { this.__echartsLayer.style.display = visible ? 'block' : 'none'; }, // FIXME: NOT SUPPORT <= IE 10 @@ -344,14 +321,14 @@ var AMapModel = { var AMapModel$1 = isNewEC ? echarts.ComponentModel.extend(AMapModel) : AMapModel; var _isAMap2X; - var AMapView = { - type: 'amap', + type: COMPONENT_TYPE, init: function init() { this._isFirstRender = true; _isAMap2X = isAMap2X(); }, render: function render(amapModel, ecModel, api) { + var _this = this; var rendering = true; var amap = amapModel.getAMap(); var viewportRoot = api.getZr().painter.getViewportRoot(); @@ -363,27 +340,22 @@ var AMapView = { var returnMapCameraState = amapModel.get('returnMapCameraState'); var viewMode = amap.getViewMode_(); var is3DMode = viewMode === '3D'; - var moveHandler = function moveHandler(e) { if (rendering) { return; } - var offsetElStyle = offsetEl.style; - var mapOffset = [-parseInt(offsetElStyle.left, 10) || 0, -parseInt(offsetElStyle.top, 10) || 0]; // only update style when map offset changed - + var mapOffset = [-parseInt(offsetElStyle.left, 10) || 0, -parseInt(offsetElStyle.top, 10) || 0]; + // only update style when map offset changed var viewportRootStyle = viewportRoot.style; var offsetLeft = mapOffset[0] + 'px'; var offsetTop = mapOffset[1] + 'px'; - if (viewportRootStyle.left !== offsetLeft) { viewportRootStyle.left = offsetLeft; } - if (viewportRootStyle.top !== offsetTop) { viewportRootStyle.top = offsetTop; } - coordSys.setMapOffset(amapModel.__mapOffset = mapOffset); var actionParams = { type: 'amapRoam', @@ -393,17 +365,14 @@ var AMapView = { duration: 0 } }; - if (returnMapCameraState) { e = e || {}; var center = e.center; - if (!center) { // normalize center LngLat to Array center = amap.getCenter(); center = [center.lng, center.lat]; } - actionParams.camera = { viewMode: viewMode, center: center, @@ -414,117 +383,105 @@ var AMapView = { bounds: amap.getBounds() }; } - api.dispatchAction(actionParams); }; - amap.off('mapmove', this._moveHandler); amap.off('moveend', this._moveHandler); amap.off('viewchange', this._moveHandler); amap.off('camerachange', this._moveHandler); amap.off('zoom', this._moveHandler); - if (this._resizeHandler) { amap.off('resize', this._resizeHandler); } - if (this._moveStartHandler) { amap.off('movestart', this._moveStartHandler); } - if (this._moveEndHandler) { amap.off('moveend', this._moveEndHandler); amap.off('zoomend', this._moveEndHandler); } - - amap.on(renderOnMoving ? _isAMap2X ? 'viewchange' : is3DMode ? 'camerachange' : 'mapmove' : 'moveend', // FIXME: bad performance in 1.x in the cases with large data, use debounce? + amap.on(renderOnMoving ? _isAMap2X ? 'viewchange' : is3DMode ? 'camerachange' : 'mapmove' : 'moveend', + // FIXME: bad performance in 1.x in the cases with large data, use debounce? // moveHandler !_isAMap2X && largeMode ? moveHandler = echarts.throttle(moveHandler, 20, true) : moveHandler); this._moveHandler = moveHandler; - if (renderOnMoving && !(_isAMap2X && is3DMode)) { // need to listen to zoom if 1.x & 2D mode // FIXME: unnecessary `mapmove` event triggered when zooming amap.on('zoom', moveHandler); } - if (!renderOnMoving) { amap.on('movestart', this._moveStartHandler = function () { setTimeout(function () { - amapModel.setEChartsLayerVisiblity(false); + amapModel.setEChartsLayerVisibility(false); }, 0); }); - var moveEndHandler = this._moveEndHandler = function (e) { (!e || e.type !== 'moveend') && moveHandler(e); setTimeout(function () { - amapModel.setEChartsLayerVisiblity(true); + amapModel.setEChartsLayerVisibility(true); }, _isAMap2X || !largeMode ? 0 : 20); }; - amap.on('moveend', moveEndHandler); amap.on('zoomend', moveEndHandler); - if (this._isFirstRender && is3DMode) { // FIXME: not rewrite AMap instance method - var nativeSetPicth = amap.setPitch; + var nativeSetPitch = amap.setPitch; var nativeSetRotation = amap.setRotation; - amap.setPitch = function () { - nativeSetPicth.apply(this, arguments); + nativeSetPitch.apply(this, arguments); moveEndHandler(); }; - amap.setRotation = function () { nativeSetRotation.apply(this, arguments); moveEndHandler(); }; } } - if (resizeEnable) { var resizeHandler = function resizeHandler() { - echarts.getInstanceByDom(api.getDom()).resize(); + clearTimeout(_this._resizeTimeout); + _this._resizeTimeout = setTimeout(function () { + return echarts.getInstanceByDom(api.getDom()).resize(); + }, 0); }; - if (!_isAMap2X && largeMode) { resizeHandler = echarts.throttle(resizeHandler, 20, true); } - amap.on('resize', this._resizeHandler = resizeHandler); } - this._isFirstRender = rendering = false; }, dispose: function dispose() { + clearTimeout(this._resizeTimeout); clearLogMap(); var component = this.__model; - if (component) { component.getAMap().destroy(); component.setAMap(null); component.setEChartsLayer(null); - if (component.coordinateSystem) { component.coordinateSystem.setAMap(null); component.coordinateSystem = null; } - - delete this._moveHandler; - delete this._resizeHandler; - delete this._moveStartHandler; - delete this._moveEndHandler; } + delete this._moveHandler; + delete this._moveStartHandler; + delete this._moveEndHandler; + delete this._resizeHandler; + delete this._resizeTimeout; } }; var AMapView$1 = isNewEC ? echarts.ComponentView.extend(AMapView) : AMapView; var name = "echarts-extension-amap"; -var version = "1.11.0"; +var version = "1.12.0"; /** * AMap component extension */ + + /** * @typedef {import('../export').EChartsExtensionRegisters} EChartsExtensionRegisters */ @@ -533,17 +490,15 @@ var version = "1.11.0"; * AMap extension installer * @param {EChartsExtensionRegisters} registers */ - function install(registers) { // add coordinate system support for pie series for ECharts < 5.4.0 if (!isNewEC || ecVer[0] == 5 && ecVer[1] < 4) { - registers.registerLayout(function (ecModel, api) { + registers.registerLayout(function (ecModel) { ecModel.eachSeriesByType('pie', function (seriesModel) { var coordSys = seriesModel.coordinateSystem; var data = seriesModel.getData(); var valueDim = data.mapDimension('value'); - - if (coordSys && coordSys.type === 'amap') { + if (coordSys && coordSys.type === COMPONENT_TYPE) { var center = seriesModel.get('center'); var point = coordSys.dataToPoint(center); var cx = point[0]; @@ -556,21 +511,20 @@ function install(registers) { } }); }); - } // Model - - - isNewEC ? registers.registerComponentModel(AMapModel$1) : registers.extendComponentModel(AMapModel$1); // View - - isNewEC ? registers.registerComponentView(AMapView$1) : registers.extendComponentView(AMapView$1); // Coordinate System - - registers.registerCoordinateSystem('amap', AMapCoordSys); // Action - + } + // Model + isNewEC ? registers.registerComponentModel(AMapModel$1) : registers.extendComponentModel(AMapModel$1); + // View + isNewEC ? registers.registerComponentView(AMapView$1) : registers.extendComponentView(AMapView$1); + // Coordinate System + registers.registerCoordinateSystem(COMPONENT_TYPE, AMapCoordSys); + // Action registers.registerAction({ - type: 'amapRoam', - event: 'amapRoam', + type: COMPONENT_TYPE + 'Roam', + event: COMPONENT_TYPE + 'Roam', update: 'updateLayout' }, function (payload, ecModel) { - ecModel.eachComponent('amap', function (amapModel) { + ecModel.eachComponent(COMPONENT_TYPE, function (amapModel) { var amap = amapModel.getAMap(); var center = amap.getCenter(); amapModel.setCenterAndZoom([center.lng, center.lat], amap.getZoom()); diff --git a/dist/echarts-extension-amap.esm.js b/dist/echarts-extension-amap.esm.js index f29f45b..5d559ff 100644 --- a/dist/echarts-extension-amap.esm.js +++ b/dist/echarts-extension-amap.esm.js @@ -1,11 +1,11 @@ /*! * echarts-extension-amap - * @version 1.11.0 + * @version 1.12.0 * @author plainheart * * MIT License * - * Copyright (c) 2019-2022 Zhongxiang.Wang + * Copyright (c) 2019-2024 Zhongxiang Wang * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,13 +31,16 @@ import { version as version$1, graphic, matrix, util, ComponentModel, ComponentV var ecVer = version$1.split('.'); var isNewEC = ecVer[0] > 4; +var COMPONENT_TYPE = 'amap'; + /* global AMap */ -// `AMap.version` only exists in AMap 2.x -// For AMap 1.x, it's `AMap.v` -// use function instead of constant to allow importing the plugin before AMap is loaded +// The version property is `AMap.v` in AMap 1.x, +// but `AMap.version` may also exist (See #51) +// In AMap 2.x, it's `AMap.version` (Not sure if `AMap.v` exists) +// use function instead of constant to allow importing the plugin before AMap is loaded var isAMap2X = function isAMap2X() { - return AMap.version >= 2; + return !AMap.v && AMap.version && AMap.version.split('.')[0] >= 2; }; function v2Equal(a, b) { return a && b && a[0] === b[0] && a[1] === b[1]; @@ -64,73 +67,58 @@ function dataToCoordSize(dataSize, dataItem) { p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx]; return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]); }, this); -} // exclude private and unsupported options - +} -var excludedOptions = ['echartsLayerZIndex', // DEPRECATED since v1.9.0 +// exclude private and unsupported options +var excludedOptions = ['echartsLayerZIndex', +// DEPRECATED since v1.9.0 'echartsLayerInteractive', 'renderOnMoving', 'largeMode', 'returnMapCameraState', 'layers']; - function AMapCoordSys(amap, api) { this._amap = amap; this._api = api; - this._mapOffset = [0, 0]; // this.dimensions = ['lng', 'lat'] + this._mapOffset = [0, 0]; + // this.dimensions = ['lng', 'lat'] } - var AMapCoordSysProto = AMapCoordSys.prototype; - AMapCoordSysProto.setZoom = function (zoom) { this._zoom = zoom; }; - AMapCoordSysProto.setCenter = function (center) { var lnglat = new AMap.LngLat(center[0], center[1]); this._center = this._amap.lngLatToContainer(lnglat); }; - AMapCoordSysProto.setMapOffset = function (mapOffset) { this._mapOffset = mapOffset; }; - AMapCoordSysProto.setAMap = function (amap) { this._amap = amap; }; - AMapCoordSysProto.getAMap = function () { return this._amap; }; - AMapCoordSysProto.dataToPoint = function (data) { var lnglat = new AMap.LngLat(data[0], data[1]); - var px = this._amap.lngLatToContainer(lnglat); - var mapOffset = this._mapOffset; return [px.x - mapOffset[0], px.y - mapOffset[1]]; }; - AMapCoordSysProto.pointToData = function (pt) { var mapOffset = this._mapOffset; - var lnglat = this._amap.containerToLngLat(new AMap.Pixel(pt[0] + mapOffset[0], pt[1] + mapOffset[1])); - return [lnglat.lng, lnglat.lat]; }; - AMapCoordSysProto.getViewRect = function () { var api = this._api; return new graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight()); }; - AMapCoordSysProto.getRoamTransform = function () { return matrix.create(); }; - AMapCoordSysProto.prepareCustoms = function () { var rect = this.getViewRect(); return { coordSys: { - // The name exposed to user is always 'cartesian2d' but not 'grid'. - type: 'amap', + type: COMPONENT_TYPE, x: rect.x, y: rect.y, width: rect.width, @@ -142,45 +130,41 @@ AMapCoordSysProto.prepareCustoms = function () { } }; }; - AMapCoordSysProto.convertToPixel = function (ecModel, finder, value) { // here we don't use finder as only one amap component is allowed return this.dataToPoint(value); }; - AMapCoordSysProto.convertFromPixel = function (ecModel, finder, value) { // here we don't use finder as only one amap component is allowed return this.pointToData(value); -}; // less useful +}; + +// less useful // AMapCoordSysProto.containPoint = function(point) { // return this._amap.getBounds().contains(this.pointToData(point)); // } - AMapCoordSys.create = function (ecModel, api) { var amapCoordSys; - ecModel.eachComponent('amap', function (amapModel) { + ecModel.eachComponent(COMPONENT_TYPE, function (amapModel) { if (typeof AMap === 'undefined') { throw new Error('AMap api is not loaded'); } - if (amapCoordSys) { throw new Error('Only one amap component is allowed'); } - var amap = amapModel.getAMap(); var echartsLayerInteractive = amapModel.get('echartsLayerInteractive'); - if (!amap) { var root = api.getDom(); var painter = api.getZr().painter; var viewportRoot = painter.getViewportRoot(); - viewportRoot.className = 'amap-ec-layer'; // PENDING not hidden? - - viewportRoot.style.visibility = 'hidden'; // Not support IE8 - - var amapRoot = root.querySelector('.ec-extension-amap'); - + viewportRoot.className = COMPONENT_TYPE + '-ec-layer'; + // PENDING not hidden? + viewportRoot.style.visibility = 'hidden'; + var className = 'ec-extension-' + COMPONENT_TYPE; + // Not support IE8 + var amapRoot = root.querySelector('.' + className); if (amapRoot) { // Reset viewport left and top, which will be changed // in moving handler in AMapView @@ -188,44 +172,47 @@ AMapCoordSys.create = function (ecModel, api) { viewportRoot.style.top = '0px'; root.removeChild(amapRoot); } - amapRoot = document.createElement('div'); - amapRoot.className = 'ec-extension-amap'; + amapRoot.className = className; amapRoot.style.cssText = 'position:absolute;top:0;left:0;bottom:0;right:0;'; root.appendChild(amapRoot); var options = util.clone(amapModel.get()); - if ('echartsLayerZIndex' in options) { logWarn('DEPRECATED', 'the option `echartsLayerZIndex` has been removed since v1.9.0, use `echartsLayerInteractive` instead.'); - } // delete excluded options - - + } + // delete excluded options util.each(excludedOptions, function (key) { delete options[key]; }); - amap = new AMap.Map(amapRoot, options); // PENDING: should update the model option when the user call map.setXXX? + amap = new AMap.Map(amapRoot, options); + + // PENDING: should update the model option when the user call map.setXXX? + // const nativeSetMapStyle = amap.setMapStyle // const nativeSetLang = amap.setLang + // // PENDING // amap.setMapStyle = function () { // nativeSetMapStyle.apply(this, arguments) // amapModel.__mapStyle = amap.getMapStyle() // } + // // PENDING // nativeSetLang && (amap.setLang = function() { // nativeSetLang.apply(this, arguments) // amapModel.__mapLang = amap.getLang() // }) - // use `complete` callback to avoid NPE when first load amap + // use `complete` callback to avoid NPE when first load amap amap.on('complete', function () { - amapRoot.querySelector('.amap-maps').appendChild(viewportRoot); // PENDING - + amapRoot.querySelector('.amap-maps').appendChild(viewportRoot); + // PENDING viewportRoot.style.visibility = ''; }); amapModel.setAMap(amap); - amapModel.setEChartsLayer(viewportRoot); // Override + amapModel.setEChartsLayer(viewportRoot); + // Override painter.getViewportRootOffset = function () { return { offsetLeft: 0, @@ -233,48 +220,40 @@ AMapCoordSys.create = function (ecModel, api) { }; }; } - var oldEChartsLayerInteractive = amapModel.__echartsLayerInteractive; - if (oldEChartsLayerInteractive !== echartsLayerInteractive) { amapModel.setEChartsLayerInteractive(echartsLayerInteractive); amapModel.__echartsLayerInteractive = echartsLayerInteractive; } - var center = amapModel.get('center'); var zoom = amapModel.get('zoom'); - if (center && zoom) { var amapCenter = amap.getCenter(); var amapZoom = amap.getZoom(); var centerOrZoomChanged = amapModel.centerOrZoomChanged([amapCenter.lng, amapCenter.lat], amapZoom); - if (centerOrZoomChanged) { amap.setZoomAndCenter(zoom, new AMap.LngLat(center[0], center[1])); } - } // update map style(#13) - + } + // update map style(#13) var originalMapStyle = amapModel.__mapStyle; var newMapStyle = amapModel.get('mapStyle'); - if (originalMapStyle !== newMapStyle) { amap.setMapStyle(amapModel.__mapStyle = newMapStyle); - } // update map lang - // PENDING: AMap 2.x does not support `setLang` yet - + } + // update map lang + // PENDING: AMap 2.x does not support `setLang` yet if (amap.setLang) { var originalMapLang = amapModel.__mapLang; var newMapLang = amapModel.get('lang'); - if (originalMapLang !== newMapLang) { amap.setLang(amapModel.__mapLang = newMapLang); } } else { logWarn('CAVEAT', 'The current map doesn\'t support `setLang` API!', true); } - amapCoordSys = new AMapCoordSys(amap, api); amapCoordSys.setMapOffset(amapModel.__mapOffset || [0, 0]); amapCoordSys.setZoom(zoom); @@ -282,20 +261,20 @@ AMapCoordSys.create = function (ecModel, api) { amapModel.coordinateSystem = amapCoordSys; }); ecModel.eachSeries(function (seriesModel) { - if (seriesModel.get('coordinateSystem') === 'amap') { + if (seriesModel.get('coordinateSystem') === COMPONENT_TYPE) { // inject coordinate system seriesModel.coordinateSystem = amapCoordSys; } - }); // return created coordinate systems + }); + // return created coordinate systems return amapCoordSys && [amapCoordSys]; }; - AMapCoordSysProto.dimensions = AMapCoordSys.dimensions = ['lng', 'lat']; -AMapCoordSysProto.type = 'amap'; +AMapCoordSysProto.type = COMPONENT_TYPE; var AMapModel = { - type: 'amap', + type: COMPONENT_TYPE, setAMap: function setAMap(amap) { this.__amap = amap; }, @@ -308,7 +287,7 @@ var AMapModel = { getEChartsLayer: function getEChartsLayer() { return this.__echartsLayer; }, - setEChartsLayerVisiblity: function setEChartsLayerVisiblity(visible) { + setEChartsLayerVisibility: function setEChartsLayerVisibility(visible) { this.__echartsLayer.style.display = visible ? 'block' : 'none'; }, // FIXME: NOT SUPPORT <= IE 10 @@ -341,14 +320,14 @@ var AMapModel = { var AMapModel$1 = isNewEC ? ComponentModel.extend(AMapModel) : AMapModel; var _isAMap2X; - var AMapView = { - type: 'amap', + type: COMPONENT_TYPE, init: function init() { this._isFirstRender = true; _isAMap2X = isAMap2X(); }, render: function render(amapModel, ecModel, api) { + var _this = this; var rendering = true; var amap = amapModel.getAMap(); var viewportRoot = api.getZr().painter.getViewportRoot(); @@ -360,27 +339,22 @@ var AMapView = { var returnMapCameraState = amapModel.get('returnMapCameraState'); var viewMode = amap.getViewMode_(); var is3DMode = viewMode === '3D'; - var moveHandler = function moveHandler(e) { if (rendering) { return; } - var offsetElStyle = offsetEl.style; - var mapOffset = [-parseInt(offsetElStyle.left, 10) || 0, -parseInt(offsetElStyle.top, 10) || 0]; // only update style when map offset changed - + var mapOffset = [-parseInt(offsetElStyle.left, 10) || 0, -parseInt(offsetElStyle.top, 10) || 0]; + // only update style when map offset changed var viewportRootStyle = viewportRoot.style; var offsetLeft = mapOffset[0] + 'px'; var offsetTop = mapOffset[1] + 'px'; - if (viewportRootStyle.left !== offsetLeft) { viewportRootStyle.left = offsetLeft; } - if (viewportRootStyle.top !== offsetTop) { viewportRootStyle.top = offsetTop; } - coordSys.setMapOffset(amapModel.__mapOffset = mapOffset); var actionParams = { type: 'amapRoam', @@ -390,17 +364,14 @@ var AMapView = { duration: 0 } }; - if (returnMapCameraState) { e = e || {}; var center = e.center; - if (!center) { // normalize center LngLat to Array center = amap.getCenter(); center = [center.lng, center.lat]; } - actionParams.camera = { viewMode: viewMode, center: center, @@ -411,117 +382,105 @@ var AMapView = { bounds: amap.getBounds() }; } - api.dispatchAction(actionParams); }; - amap.off('mapmove', this._moveHandler); amap.off('moveend', this._moveHandler); amap.off('viewchange', this._moveHandler); amap.off('camerachange', this._moveHandler); amap.off('zoom', this._moveHandler); - if (this._resizeHandler) { amap.off('resize', this._resizeHandler); } - if (this._moveStartHandler) { amap.off('movestart', this._moveStartHandler); } - if (this._moveEndHandler) { amap.off('moveend', this._moveEndHandler); amap.off('zoomend', this._moveEndHandler); } - - amap.on(renderOnMoving ? _isAMap2X ? 'viewchange' : is3DMode ? 'camerachange' : 'mapmove' : 'moveend', // FIXME: bad performance in 1.x in the cases with large data, use debounce? + amap.on(renderOnMoving ? _isAMap2X ? 'viewchange' : is3DMode ? 'camerachange' : 'mapmove' : 'moveend', + // FIXME: bad performance in 1.x in the cases with large data, use debounce? // moveHandler !_isAMap2X && largeMode ? moveHandler = throttle(moveHandler, 20, true) : moveHandler); this._moveHandler = moveHandler; - if (renderOnMoving && !(_isAMap2X && is3DMode)) { // need to listen to zoom if 1.x & 2D mode // FIXME: unnecessary `mapmove` event triggered when zooming amap.on('zoom', moveHandler); } - if (!renderOnMoving) { amap.on('movestart', this._moveStartHandler = function () { setTimeout(function () { - amapModel.setEChartsLayerVisiblity(false); + amapModel.setEChartsLayerVisibility(false); }, 0); }); - var moveEndHandler = this._moveEndHandler = function (e) { (!e || e.type !== 'moveend') && moveHandler(e); setTimeout(function () { - amapModel.setEChartsLayerVisiblity(true); + amapModel.setEChartsLayerVisibility(true); }, _isAMap2X || !largeMode ? 0 : 20); }; - amap.on('moveend', moveEndHandler); amap.on('zoomend', moveEndHandler); - if (this._isFirstRender && is3DMode) { // FIXME: not rewrite AMap instance method - var nativeSetPicth = amap.setPitch; + var nativeSetPitch = amap.setPitch; var nativeSetRotation = amap.setRotation; - amap.setPitch = function () { - nativeSetPicth.apply(this, arguments); + nativeSetPitch.apply(this, arguments); moveEndHandler(); }; - amap.setRotation = function () { nativeSetRotation.apply(this, arguments); moveEndHandler(); }; } } - if (resizeEnable) { var resizeHandler = function resizeHandler() { - getInstanceByDom(api.getDom()).resize(); + clearTimeout(_this._resizeTimeout); + _this._resizeTimeout = setTimeout(function () { + return getInstanceByDom(api.getDom()).resize(); + }, 0); }; - if (!_isAMap2X && largeMode) { resizeHandler = throttle(resizeHandler, 20, true); } - amap.on('resize', this._resizeHandler = resizeHandler); } - this._isFirstRender = rendering = false; }, dispose: function dispose() { + clearTimeout(this._resizeTimeout); clearLogMap(); var component = this.__model; - if (component) { component.getAMap().destroy(); component.setAMap(null); component.setEChartsLayer(null); - if (component.coordinateSystem) { component.coordinateSystem.setAMap(null); component.coordinateSystem = null; } - - delete this._moveHandler; - delete this._resizeHandler; - delete this._moveStartHandler; - delete this._moveEndHandler; } + delete this._moveHandler; + delete this._moveStartHandler; + delete this._moveEndHandler; + delete this._resizeHandler; + delete this._resizeTimeout; } }; var AMapView$1 = isNewEC ? ComponentView.extend(AMapView) : AMapView; var name = "echarts-extension-amap"; -var version = "1.11.0"; +var version = "1.12.0"; /** * AMap component extension */ + + /** * @typedef {import('../export').EChartsExtensionRegisters} EChartsExtensionRegisters */ @@ -530,17 +489,15 @@ var version = "1.11.0"; * AMap extension installer * @param {EChartsExtensionRegisters} registers */ - function install(registers) { // add coordinate system support for pie series for ECharts < 5.4.0 if (!isNewEC || ecVer[0] == 5 && ecVer[1] < 4) { - registers.registerLayout(function (ecModel, api) { + registers.registerLayout(function (ecModel) { ecModel.eachSeriesByType('pie', function (seriesModel) { var coordSys = seriesModel.coordinateSystem; var data = seriesModel.getData(); var valueDim = data.mapDimension('value'); - - if (coordSys && coordSys.type === 'amap') { + if (coordSys && coordSys.type === COMPONENT_TYPE) { var center = seriesModel.get('center'); var point = coordSys.dataToPoint(center); var cx = point[0]; @@ -553,21 +510,20 @@ function install(registers) { } }); }); - } // Model - - - isNewEC ? registers.registerComponentModel(AMapModel$1) : registers.extendComponentModel(AMapModel$1); // View - - isNewEC ? registers.registerComponentView(AMapView$1) : registers.extendComponentView(AMapView$1); // Coordinate System - - registers.registerCoordinateSystem('amap', AMapCoordSys); // Action - + } + // Model + isNewEC ? registers.registerComponentModel(AMapModel$1) : registers.extendComponentModel(AMapModel$1); + // View + isNewEC ? registers.registerComponentView(AMapView$1) : registers.extendComponentView(AMapView$1); + // Coordinate System + registers.registerCoordinateSystem(COMPONENT_TYPE, AMapCoordSys); + // Action registers.registerAction({ - type: 'amapRoam', - event: 'amapRoam', + type: COMPONENT_TYPE + 'Roam', + event: COMPONENT_TYPE + 'Roam', update: 'updateLayout' }, function (payload, ecModel) { - ecModel.eachComponent('amap', function (amapModel) { + ecModel.eachComponent(COMPONENT_TYPE, function (amapModel) { var amap = amapModel.getAMap(); var center = amap.getCenter(); amapModel.setCenterAndZoom([center.lng, center.lat], amap.getZoom()); diff --git a/dist/echarts-extension-amap.js b/dist/echarts-extension-amap.js index f896be5..a0e2369 100644 --- a/dist/echarts-extension-amap.js +++ b/dist/echarts-extension-amap.js @@ -1,11 +1,11 @@ /*! * echarts-extension-amap - * @version 1.11.0 + * @version 1.12.0 * @author plainheart * * MIT License * - * Copyright (c) 2019-2022 Zhongxiang.Wang + * Copyright (c) 2019-2024 Zhongxiang Wang * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,13 +34,16 @@ var ecVer = echarts.version.split('.'); var isNewEC = ecVer[0] > 4; + var COMPONENT_TYPE = 'amap'; + /* global AMap */ - // `AMap.version` only exists in AMap 2.x - // For AMap 1.x, it's `AMap.v` - // use function instead of constant to allow importing the plugin before AMap is loaded + // The version property is `AMap.v` in AMap 1.x, + // but `AMap.version` may also exist (See #51) + // In AMap 2.x, it's `AMap.version` (Not sure if `AMap.v` exists) + // use function instead of constant to allow importing the plugin before AMap is loaded var isAMap2X = function isAMap2X() { - return AMap.version >= 2; + return !AMap.v && AMap.version && AMap.version.split('.')[0] >= 2; }; function v2Equal(a, b) { return a && b && a[0] === b[0] && a[1] === b[1]; @@ -67,73 +70,58 @@ p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx]; return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]); }, this); - } // exclude private and unsupported options - + } - var excludedOptions = ['echartsLayerZIndex', // DEPRECATED since v1.9.0 + // exclude private and unsupported options + var excludedOptions = ['echartsLayerZIndex', + // DEPRECATED since v1.9.0 'echartsLayerInteractive', 'renderOnMoving', 'largeMode', 'returnMapCameraState', 'layers']; - function AMapCoordSys(amap, api) { this._amap = amap; this._api = api; - this._mapOffset = [0, 0]; // this.dimensions = ['lng', 'lat'] + this._mapOffset = [0, 0]; + // this.dimensions = ['lng', 'lat'] } - var AMapCoordSysProto = AMapCoordSys.prototype; - AMapCoordSysProto.setZoom = function (zoom) { this._zoom = zoom; }; - AMapCoordSysProto.setCenter = function (center) { var lnglat = new AMap.LngLat(center[0], center[1]); this._center = this._amap.lngLatToContainer(lnglat); }; - AMapCoordSysProto.setMapOffset = function (mapOffset) { this._mapOffset = mapOffset; }; - AMapCoordSysProto.setAMap = function (amap) { this._amap = amap; }; - AMapCoordSysProto.getAMap = function () { return this._amap; }; - AMapCoordSysProto.dataToPoint = function (data) { var lnglat = new AMap.LngLat(data[0], data[1]); - var px = this._amap.lngLatToContainer(lnglat); - var mapOffset = this._mapOffset; return [px.x - mapOffset[0], px.y - mapOffset[1]]; }; - AMapCoordSysProto.pointToData = function (pt) { var mapOffset = this._mapOffset; - var lnglat = this._amap.containerToLngLat(new AMap.Pixel(pt[0] + mapOffset[0], pt[1] + mapOffset[1])); - return [lnglat.lng, lnglat.lat]; }; - AMapCoordSysProto.getViewRect = function () { var api = this._api; return new echarts.graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight()); }; - AMapCoordSysProto.getRoamTransform = function () { return echarts.matrix.create(); }; - AMapCoordSysProto.prepareCustoms = function () { var rect = this.getViewRect(); return { coordSys: { - // The name exposed to user is always 'cartesian2d' but not 'grid'. - type: 'amap', + type: COMPONENT_TYPE, x: rect.x, y: rect.y, width: rect.width, @@ -145,45 +133,41 @@ } }; }; - AMapCoordSysProto.convertToPixel = function (ecModel, finder, value) { // here we don't use finder as only one amap component is allowed return this.dataToPoint(value); }; - AMapCoordSysProto.convertFromPixel = function (ecModel, finder, value) { // here we don't use finder as only one amap component is allowed return this.pointToData(value); - }; // less useful + }; + + // less useful // AMapCoordSysProto.containPoint = function(point) { // return this._amap.getBounds().contains(this.pointToData(point)); // } - AMapCoordSys.create = function (ecModel, api) { var amapCoordSys; - ecModel.eachComponent('amap', function (amapModel) { + ecModel.eachComponent(COMPONENT_TYPE, function (amapModel) { if (typeof AMap === 'undefined') { throw new Error('AMap api is not loaded'); } - if (amapCoordSys) { throw new Error('Only one amap component is allowed'); } - var amap = amapModel.getAMap(); var echartsLayerInteractive = amapModel.get('echartsLayerInteractive'); - if (!amap) { var root = api.getDom(); var painter = api.getZr().painter; var viewportRoot = painter.getViewportRoot(); - viewportRoot.className = 'amap-ec-layer'; // PENDING not hidden? - - viewportRoot.style.visibility = 'hidden'; // Not support IE8 - - var amapRoot = root.querySelector('.ec-extension-amap'); - + viewportRoot.className = COMPONENT_TYPE + '-ec-layer'; + // PENDING not hidden? + viewportRoot.style.visibility = 'hidden'; + var className = 'ec-extension-' + COMPONENT_TYPE; + // Not support IE8 + var amapRoot = root.querySelector('.' + className); if (amapRoot) { // Reset viewport left and top, which will be changed // in moving handler in AMapView @@ -191,44 +175,47 @@ viewportRoot.style.top = '0px'; root.removeChild(amapRoot); } - amapRoot = document.createElement('div'); - amapRoot.className = 'ec-extension-amap'; + amapRoot.className = className; amapRoot.style.cssText = 'position:absolute;top:0;left:0;bottom:0;right:0;'; root.appendChild(amapRoot); var options = echarts.util.clone(amapModel.get()); - if ('echartsLayerZIndex' in options) { logWarn('DEPRECATED', 'the option `echartsLayerZIndex` has been removed since v1.9.0, use `echartsLayerInteractive` instead.'); - } // delete excluded options - - + } + // delete excluded options echarts.util.each(excludedOptions, function (key) { delete options[key]; }); - amap = new AMap.Map(amapRoot, options); // PENDING: should update the model option when the user call map.setXXX? + amap = new AMap.Map(amapRoot, options); + + // PENDING: should update the model option when the user call map.setXXX? + // const nativeSetMapStyle = amap.setMapStyle // const nativeSetLang = amap.setLang + // // PENDING // amap.setMapStyle = function () { // nativeSetMapStyle.apply(this, arguments) // amapModel.__mapStyle = amap.getMapStyle() // } + // // PENDING // nativeSetLang && (amap.setLang = function() { // nativeSetLang.apply(this, arguments) // amapModel.__mapLang = amap.getLang() // }) - // use `complete` callback to avoid NPE when first load amap + // use `complete` callback to avoid NPE when first load amap amap.on('complete', function () { - amapRoot.querySelector('.amap-maps').appendChild(viewportRoot); // PENDING - + amapRoot.querySelector('.amap-maps').appendChild(viewportRoot); + // PENDING viewportRoot.style.visibility = ''; }); amapModel.setAMap(amap); - amapModel.setEChartsLayer(viewportRoot); // Override + amapModel.setEChartsLayer(viewportRoot); + // Override painter.getViewportRootOffset = function () { return { offsetLeft: 0, @@ -236,48 +223,40 @@ }; }; } - var oldEChartsLayerInteractive = amapModel.__echartsLayerInteractive; - if (oldEChartsLayerInteractive !== echartsLayerInteractive) { amapModel.setEChartsLayerInteractive(echartsLayerInteractive); amapModel.__echartsLayerInteractive = echartsLayerInteractive; } - var center = amapModel.get('center'); var zoom = amapModel.get('zoom'); - if (center && zoom) { var amapCenter = amap.getCenter(); var amapZoom = amap.getZoom(); var centerOrZoomChanged = amapModel.centerOrZoomChanged([amapCenter.lng, amapCenter.lat], amapZoom); - if (centerOrZoomChanged) { amap.setZoomAndCenter(zoom, new AMap.LngLat(center[0], center[1])); } - } // update map style(#13) - + } + // update map style(#13) var originalMapStyle = amapModel.__mapStyle; var newMapStyle = amapModel.get('mapStyle'); - if (originalMapStyle !== newMapStyle) { amap.setMapStyle(amapModel.__mapStyle = newMapStyle); - } // update map lang - // PENDING: AMap 2.x does not support `setLang` yet - + } + // update map lang + // PENDING: AMap 2.x does not support `setLang` yet if (amap.setLang) { var originalMapLang = amapModel.__mapLang; var newMapLang = amapModel.get('lang'); - if (originalMapLang !== newMapLang) { amap.setLang(amapModel.__mapLang = newMapLang); } } else { logWarn('CAVEAT', 'The current map doesn\'t support `setLang` API!', true); } - amapCoordSys = new AMapCoordSys(amap, api); amapCoordSys.setMapOffset(amapModel.__mapOffset || [0, 0]); amapCoordSys.setZoom(zoom); @@ -285,20 +264,20 @@ amapModel.coordinateSystem = amapCoordSys; }); ecModel.eachSeries(function (seriesModel) { - if (seriesModel.get('coordinateSystem') === 'amap') { + if (seriesModel.get('coordinateSystem') === COMPONENT_TYPE) { // inject coordinate system seriesModel.coordinateSystem = amapCoordSys; } - }); // return created coordinate systems + }); + // return created coordinate systems return amapCoordSys && [amapCoordSys]; }; - AMapCoordSysProto.dimensions = AMapCoordSys.dimensions = ['lng', 'lat']; - AMapCoordSysProto.type = 'amap'; + AMapCoordSysProto.type = COMPONENT_TYPE; var AMapModel = { - type: 'amap', + type: COMPONENT_TYPE, setAMap: function setAMap(amap) { this.__amap = amap; }, @@ -311,7 +290,7 @@ getEChartsLayer: function getEChartsLayer() { return this.__echartsLayer; }, - setEChartsLayerVisiblity: function setEChartsLayerVisiblity(visible) { + setEChartsLayerVisibility: function setEChartsLayerVisibility(visible) { this.__echartsLayer.style.display = visible ? 'block' : 'none'; }, // FIXME: NOT SUPPORT <= IE 10 @@ -344,14 +323,14 @@ var AMapModel$1 = isNewEC ? echarts.ComponentModel.extend(AMapModel) : AMapModel; var _isAMap2X; - var AMapView = { - type: 'amap', + type: COMPONENT_TYPE, init: function init() { this._isFirstRender = true; _isAMap2X = isAMap2X(); }, render: function render(amapModel, ecModel, api) { + var _this = this; var rendering = true; var amap = amapModel.getAMap(); var viewportRoot = api.getZr().painter.getViewportRoot(); @@ -363,27 +342,22 @@ var returnMapCameraState = amapModel.get('returnMapCameraState'); var viewMode = amap.getViewMode_(); var is3DMode = viewMode === '3D'; - var moveHandler = function moveHandler(e) { if (rendering) { return; } - var offsetElStyle = offsetEl.style; - var mapOffset = [-parseInt(offsetElStyle.left, 10) || 0, -parseInt(offsetElStyle.top, 10) || 0]; // only update style when map offset changed - + var mapOffset = [-parseInt(offsetElStyle.left, 10) || 0, -parseInt(offsetElStyle.top, 10) || 0]; + // only update style when map offset changed var viewportRootStyle = viewportRoot.style; var offsetLeft = mapOffset[0] + 'px'; var offsetTop = mapOffset[1] + 'px'; - if (viewportRootStyle.left !== offsetLeft) { viewportRootStyle.left = offsetLeft; } - if (viewportRootStyle.top !== offsetTop) { viewportRootStyle.top = offsetTop; } - coordSys.setMapOffset(amapModel.__mapOffset = mapOffset); var actionParams = { type: 'amapRoam', @@ -393,17 +367,14 @@ duration: 0 } }; - if (returnMapCameraState) { e = e || {}; var center = e.center; - if (!center) { // normalize center LngLat to Array center = amap.getCenter(); center = [center.lng, center.lat]; } - actionParams.camera = { viewMode: viewMode, center: center, @@ -414,117 +385,105 @@ bounds: amap.getBounds() }; } - api.dispatchAction(actionParams); }; - amap.off('mapmove', this._moveHandler); amap.off('moveend', this._moveHandler); amap.off('viewchange', this._moveHandler); amap.off('camerachange', this._moveHandler); amap.off('zoom', this._moveHandler); - if (this._resizeHandler) { amap.off('resize', this._resizeHandler); } - if (this._moveStartHandler) { amap.off('movestart', this._moveStartHandler); } - if (this._moveEndHandler) { amap.off('moveend', this._moveEndHandler); amap.off('zoomend', this._moveEndHandler); } - - amap.on(renderOnMoving ? _isAMap2X ? 'viewchange' : is3DMode ? 'camerachange' : 'mapmove' : 'moveend', // FIXME: bad performance in 1.x in the cases with large data, use debounce? + amap.on(renderOnMoving ? _isAMap2X ? 'viewchange' : is3DMode ? 'camerachange' : 'mapmove' : 'moveend', + // FIXME: bad performance in 1.x in the cases with large data, use debounce? // moveHandler !_isAMap2X && largeMode ? moveHandler = echarts.throttle(moveHandler, 20, true) : moveHandler); this._moveHandler = moveHandler; - if (renderOnMoving && !(_isAMap2X && is3DMode)) { // need to listen to zoom if 1.x & 2D mode // FIXME: unnecessary `mapmove` event triggered when zooming amap.on('zoom', moveHandler); } - if (!renderOnMoving) { amap.on('movestart', this._moveStartHandler = function () { setTimeout(function () { - amapModel.setEChartsLayerVisiblity(false); + amapModel.setEChartsLayerVisibility(false); }, 0); }); - var moveEndHandler = this._moveEndHandler = function (e) { (!e || e.type !== 'moveend') && moveHandler(e); setTimeout(function () { - amapModel.setEChartsLayerVisiblity(true); + amapModel.setEChartsLayerVisibility(true); }, _isAMap2X || !largeMode ? 0 : 20); }; - amap.on('moveend', moveEndHandler); amap.on('zoomend', moveEndHandler); - if (this._isFirstRender && is3DMode) { // FIXME: not rewrite AMap instance method - var nativeSetPicth = amap.setPitch; + var nativeSetPitch = amap.setPitch; var nativeSetRotation = amap.setRotation; - amap.setPitch = function () { - nativeSetPicth.apply(this, arguments); + nativeSetPitch.apply(this, arguments); moveEndHandler(); }; - amap.setRotation = function () { nativeSetRotation.apply(this, arguments); moveEndHandler(); }; } } - if (resizeEnable) { var resizeHandler = function resizeHandler() { - echarts.getInstanceByDom(api.getDom()).resize(); + clearTimeout(_this._resizeTimeout); + _this._resizeTimeout = setTimeout(function () { + return echarts.getInstanceByDom(api.getDom()).resize(); + }, 0); }; - if (!_isAMap2X && largeMode) { resizeHandler = echarts.throttle(resizeHandler, 20, true); } - amap.on('resize', this._resizeHandler = resizeHandler); } - this._isFirstRender = rendering = false; }, dispose: function dispose() { + clearTimeout(this._resizeTimeout); clearLogMap(); var component = this.__model; - if (component) { component.getAMap().destroy(); component.setAMap(null); component.setEChartsLayer(null); - if (component.coordinateSystem) { component.coordinateSystem.setAMap(null); component.coordinateSystem = null; } - - delete this._moveHandler; - delete this._resizeHandler; - delete this._moveStartHandler; - delete this._moveEndHandler; } + delete this._moveHandler; + delete this._moveStartHandler; + delete this._moveEndHandler; + delete this._resizeHandler; + delete this._resizeTimeout; } }; var AMapView$1 = isNewEC ? echarts.ComponentView.extend(AMapView) : AMapView; var name = "echarts-extension-amap"; - var version = "1.11.0"; + var version = "1.12.0"; /** * AMap component extension */ + + /** * @typedef {import('../export').EChartsExtensionRegisters} EChartsExtensionRegisters */ @@ -533,17 +492,15 @@ * AMap extension installer * @param {EChartsExtensionRegisters} registers */ - function install(registers) { // add coordinate system support for pie series for ECharts < 5.4.0 if (!isNewEC || ecVer[0] == 5 && ecVer[1] < 4) { - registers.registerLayout(function (ecModel, api) { + registers.registerLayout(function (ecModel) { ecModel.eachSeriesByType('pie', function (seriesModel) { var coordSys = seriesModel.coordinateSystem; var data = seriesModel.getData(); var valueDim = data.mapDimension('value'); - - if (coordSys && coordSys.type === 'amap') { + if (coordSys && coordSys.type === COMPONENT_TYPE) { var center = seriesModel.get('center'); var point = coordSys.dataToPoint(center); var cx = point[0]; @@ -556,21 +513,20 @@ } }); }); - } // Model - - - isNewEC ? registers.registerComponentModel(AMapModel$1) : registers.extendComponentModel(AMapModel$1); // View - - isNewEC ? registers.registerComponentView(AMapView$1) : registers.extendComponentView(AMapView$1); // Coordinate System - - registers.registerCoordinateSystem('amap', AMapCoordSys); // Action - + } + // Model + isNewEC ? registers.registerComponentModel(AMapModel$1) : registers.extendComponentModel(AMapModel$1); + // View + isNewEC ? registers.registerComponentView(AMapView$1) : registers.extendComponentView(AMapView$1); + // Coordinate System + registers.registerCoordinateSystem(COMPONENT_TYPE, AMapCoordSys); + // Action registers.registerAction({ - type: 'amapRoam', - event: 'amapRoam', + type: COMPONENT_TYPE + 'Roam', + event: COMPONENT_TYPE + 'Roam', update: 'updateLayout' }, function (payload, ecModel) { - ecModel.eachComponent('amap', function (amapModel) { + ecModel.eachComponent(COMPONENT_TYPE, function (amapModel) { var amap = amapModel.getAMap(); var center = amap.getCenter(); amapModel.setCenterAndZoom([center.lng, center.lat], amap.getZoom()); @@ -588,7 +544,5 @@ exports.name = name; exports.version = version; - Object.defineProperty(exports, '__esModule', { value: true }); - })); //# sourceMappingURL=echarts-extension-amap.js.map diff --git a/dist/echarts-extension-amap.js.map b/dist/echarts-extension-amap.js.map index f36548e..e839697 100644 --- a/dist/echarts-extension-amap.js.map +++ b/dist/echarts-extension-amap.js.map @@ -1 +1 @@ -{"version":3,"file":"echarts-extension-amap.js","sources":["../src/helper.js","../src/AMapCoordSys.js","../src/AMapModel.js","../src/AMapView.js","../src/index.js","../index.js"],"sourcesContent":["import { version } from 'echarts/lib/echarts'\n\nexport const ecVer = version.split('.')\n\nexport const isNewEC = ecVer[0] > 4\n\n/* global AMap */\n\n// `AMap.version` only exists in AMap 2.x\n// For AMap 1.x, it's `AMap.v`\n// use function instead of constant to allow importing the plugin before AMap is loaded\nexport const isAMap2X = () => AMap.version >= 2\n\nexport function v2Equal(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1]\n}\n\nlet logMap = {}\n\nexport function logWarn(tag, msg, once) {\n const log = `[ECharts][Extension][AMap]${tag ? ' ' + tag + ':' : ''} ${msg}`\n once && logMap[log] || console.warn(log)\n once && (logMap[log] = true)\n}\n\nexport function clearLogMap() {\n logMap = {}\n}\n","import { util as zrUtil, graphic, matrix } from 'echarts/lib/echarts'\nimport { logWarn } from './helper'\n\nfunction dataToCoordSize(dataSize, dataItem) {\n dataItem = dataItem || [0, 0];\n return zrUtil.map(\n [0, 1],\n function(dimIdx) {\n const val = dataItem[dimIdx]\n const halfSize = dataSize[dimIdx] / 2\n const p1 = []\n const p2 = []\n p1[dimIdx] = val - halfSize\n p2[dimIdx] = val + halfSize\n p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx]\n return Math.abs(\n this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]\n )\n },\n this\n )\n}\n\n// exclude private and unsupported options\nconst excludedOptions = [\n 'echartsLayerZIndex', // DEPRECATED since v1.9.0\n 'echartsLayerInteractive',\n 'renderOnMoving',\n 'largeMode',\n 'returnMapCameraState',\n 'layers'\n]\n\nfunction AMapCoordSys(amap, api) {\n this._amap = amap\n this._api = api\n this._mapOffset = [0, 0]\n // this.dimensions = ['lng', 'lat']\n}\n\nconst AMapCoordSysProto = AMapCoordSys.prototype\n\nAMapCoordSysProto.setZoom = function(zoom) {\n this._zoom = zoom\n}\n\nAMapCoordSysProto.setCenter = function(center) {\n const lnglat = new AMap.LngLat(center[0], center[1])\n this._center = this._amap.lngLatToContainer(lnglat)\n}\n\nAMapCoordSysProto.setMapOffset = function(mapOffset) {\n this._mapOffset = mapOffset\n}\n\nAMapCoordSysProto.setAMap = function(amap) {\n this._amap = amap\n}\n\nAMapCoordSysProto.getAMap = function() {\n return this._amap\n}\n\nAMapCoordSysProto.dataToPoint = function(data) {\n const lnglat = new AMap.LngLat(data[0], data[1])\n const px = this._amap.lngLatToContainer(lnglat)\n const mapOffset = this._mapOffset\n return [px.x - mapOffset[0], px.y - mapOffset[1]]\n}\n\nAMapCoordSysProto.pointToData = function(pt) {\n const mapOffset = this._mapOffset\n const lnglat = this._amap.containerToLngLat(\n new AMap.Pixel(\n pt[0] + mapOffset[0],\n pt[1] + mapOffset[1]\n )\n )\n return [lnglat.lng, lnglat.lat]\n}\n\nAMapCoordSysProto.getViewRect = function() {\n const api = this._api\n return new graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight())\n}\n\nAMapCoordSysProto.getRoamTransform = function() {\n return matrix.create()\n}\n\nAMapCoordSysProto.prepareCustoms = function() {\n const rect = this.getViewRect()\n return {\n coordSys: {\n // The name exposed to user is always 'cartesian2d' but not 'grid'.\n type: 'amap',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n api: {\n coord: zrUtil.bind(this.dataToPoint, this),\n size: zrUtil.bind(dataToCoordSize, this)\n }\n }\n}\n\nAMapCoordSysProto.convertToPixel = function(ecModel, finder, value) {\n // here we don't use finder as only one amap component is allowed\n return this.dataToPoint(value);\n}\n\nAMapCoordSysProto.convertFromPixel = function(ecModel, finder, value) {\n // here we don't use finder as only one amap component is allowed\n return this.pointToData(value);\n}\n\n// less useful\n// AMapCoordSysProto.containPoint = function(point) {\n// return this._amap.getBounds().contains(this.pointToData(point));\n// }\n\nAMapCoordSys.create = function(ecModel, api) {\n let amapCoordSys\n ecModel.eachComponent('amap', function(amapModel) {\n if (typeof AMap === 'undefined') {\n throw new Error('AMap api is not loaded')\n }\n if (amapCoordSys) {\n throw new Error('Only one amap component is allowed')\n }\n let amap = amapModel.getAMap()\n const echartsLayerInteractive = amapModel.get('echartsLayerInteractive')\n if (!amap) {\n const root = api.getDom()\n const painter = api.getZr().painter\n const viewportRoot = painter.getViewportRoot()\n viewportRoot.className = 'amap-ec-layer'\n // PENDING not hidden?\n viewportRoot.style.visibility = 'hidden'\n // Not support IE8\n let amapRoot = root.querySelector('.ec-extension-amap')\n if (amapRoot) {\n // Reset viewport left and top, which will be changed\n // in moving handler in AMapView\n viewportRoot.style.left = '0px'\n viewportRoot.style.top = '0px'\n root.removeChild(amapRoot)\n }\n amapRoot = document.createElement('div')\n amapRoot.className = 'ec-extension-amap'\n amapRoot.style.cssText = 'position:absolute;top:0;left:0;bottom:0;right:0;'\n root.appendChild(amapRoot)\n\n const options = zrUtil.clone(amapModel.get())\n if ('echartsLayerZIndex' in options) {\n logWarn('DEPRECATED', 'the option `echartsLayerZIndex` has been removed since v1.9.0, use `echartsLayerInteractive` instead.')\n }\n // delete excluded options\n zrUtil.each(excludedOptions, function(key) {\n delete options[key]\n })\n\n amap = new AMap.Map(amapRoot, options)\n\n // PENDING: should update the model option when the user call map.setXXX?\n\n // const nativeSetMapStyle = amap.setMapStyle\n // const nativeSetLang = amap.setLang\n\n // // PENDING\n // amap.setMapStyle = function () {\n // nativeSetMapStyle.apply(this, arguments)\n // amapModel.__mapStyle = amap.getMapStyle()\n // }\n\n // // PENDING\n // nativeSetLang && (amap.setLang = function() {\n // nativeSetLang.apply(this, arguments)\n // amapModel.__mapLang = amap.getLang()\n // })\n\n // use `complete` callback to avoid NPE when first load amap\n amap.on('complete', function() {\n amapRoot.querySelector('.amap-maps').appendChild(viewportRoot)\n // PENDING\n viewportRoot.style.visibility = ''\n })\n\n amapModel.setAMap(amap)\n amapModel.setEChartsLayer(viewportRoot)\n\n // Override\n painter.getViewportRootOffset = function() {\n return { offsetLeft: 0, offsetTop: 0 }\n }\n }\n\n const oldEChartsLayerInteractive = amapModel.__echartsLayerInteractive\n if (oldEChartsLayerInteractive !== echartsLayerInteractive) {\n amapModel.setEChartsLayerInteractive(echartsLayerInteractive)\n amapModel.__echartsLayerInteractive = echartsLayerInteractive\n }\n\n const center = amapModel.get('center')\n const zoom = amapModel.get('zoom')\n if (center && zoom) {\n const amapCenter = amap.getCenter()\n const amapZoom = amap.getZoom()\n const centerOrZoomChanged = amapModel.centerOrZoomChanged(\n [amapCenter.lng, amapCenter.lat],\n amapZoom\n )\n if (centerOrZoomChanged) {\n amap.setZoomAndCenter(zoom, new AMap.LngLat(center[0], center[1]))\n }\n }\n\n // update map style(#13)\n const originalMapStyle = amapModel.__mapStyle\n const newMapStyle = amapModel.get('mapStyle')\n if (originalMapStyle !== newMapStyle) {\n amap.setMapStyle(amapModel.__mapStyle = newMapStyle)\n }\n\n // update map lang\n // PENDING: AMap 2.x does not support `setLang` yet\n if (amap.setLang) {\n const originalMapLang = amapModel.__mapLang\n const newMapLang = amapModel.get('lang')\n if (originalMapLang !== newMapLang) {\n amap.setLang(amapModel.__mapLang = newMapLang)\n }\n }\n else {\n logWarn('CAVEAT', 'The current map doesn\\'t support `setLang` API!', true)\n }\n\n amapCoordSys = new AMapCoordSys(amap, api)\n amapCoordSys.setMapOffset(amapModel.__mapOffset || [0, 0])\n amapCoordSys.setZoom(zoom)\n amapCoordSys.setCenter(center)\n\n amapModel.coordinateSystem = amapCoordSys\n })\n\n ecModel.eachSeries(function(seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'amap') {\n // inject coordinate system\n seriesModel.coordinateSystem = amapCoordSys\n }\n })\n\n // return created coordinate systems\n return amapCoordSys && [amapCoordSys]\n}\n\nAMapCoordSysProto.dimensions = AMapCoordSys.dimensions = ['lng', 'lat']\n\nAMapCoordSysProto.type = 'amap'\n\n\nexport default AMapCoordSys\n","import { ComponentModel } from 'echarts/lib/echarts'\nimport { isNewEC, v2Equal } from './helper'\n\nconst AMapModel = {\n type: 'amap',\n\n setAMap(amap) {\n this.__amap = amap\n },\n\n getAMap() {\n return this.__amap\n },\n\n setEChartsLayer(layer) {\n this.__echartsLayer = layer\n },\n\n getEChartsLayer() {\n return this.__echartsLayer\n },\n\n setEChartsLayerVisiblity(visible) {\n this.__echartsLayer.style.display = visible ? 'block' : 'none'\n },\n\n // FIXME: NOT SUPPORT <= IE 10\n setEChartsLayerInteractive(interactive) {\n this.option.echartsLayerInteractive = !!interactive\n this.__echartsLayer.style.pointerEvents = interactive ? 'auto' : 'none'\n },\n\n setCenterAndZoom(center, zoom) {\n this.option.center = center\n this.option.zoom = zoom\n },\n\n centerOrZoomChanged(center, zoom) {\n const option = this.option\n return !(v2Equal(center, option.center) && zoom === option.zoom)\n },\n\n defaultOption: {\n center: [116.397428, 39.90923],\n zoom: 5,\n isHotspot: false,\n resizeEnable: true,\n\n // extension specific options\n // echartsLayerZIndex: 2000, // DEPRECATED since v1.9.0\n echartsLayerInteractive: true,\n renderOnMoving: true,\n largeMode: false,\n // since v1.10.0\n returnMapCameraState: false\n }\n}\n\nexport default isNewEC\n ? ComponentModel.extend(AMapModel)\n : AMapModel\n","import { ComponentView, getInstanceByDom, throttle } from 'echarts/lib/echarts'\nimport { isNewEC, isAMap2X, clearLogMap } from './helper'\n\nlet _isAMap2X\n\nconst AMapView = {\n type: 'amap',\n\n init() {\n this._isFirstRender = true\n\n _isAMap2X = isAMap2X()\n },\n\n render(amapModel, ecModel, api) {\n let rendering = true\n\n const amap = amapModel.getAMap()\n const viewportRoot = api.getZr().painter.getViewportRoot()\n const offsetEl = amap.getContainer()\n const coordSys = amapModel.coordinateSystem\n\n const renderOnMoving = amapModel.get('renderOnMoving')\n const resizeEnable = amapModel.get('resizeEnable')\n const largeMode = amapModel.get('largeMode')\n const returnMapCameraState = amapModel.get('returnMapCameraState')\n\n const viewMode = amap.getViewMode_()\n const is3DMode = viewMode === '3D'\n\n let moveHandler = function(e) {\n if (rendering) {\n return\n }\n\n const offsetElStyle = offsetEl.style\n const mapOffset = [\n -parseInt(offsetElStyle.left, 10) || 0,\n -parseInt(offsetElStyle.top, 10) || 0\n ]\n // only update style when map offset changed\n const viewportRootStyle = viewportRoot.style\n const offsetLeft = mapOffset[0] + 'px'\n const offsetTop = mapOffset[1] + 'px'\n if (viewportRootStyle.left !== offsetLeft) {\n viewportRootStyle.left = offsetLeft\n }\n if (viewportRootStyle.top !== offsetTop) {\n viewportRootStyle.top = offsetTop\n }\n\n coordSys.setMapOffset(amapModel.__mapOffset = mapOffset)\n\n const actionParams = {\n type: 'amapRoam',\n animation: {\n // compatible with ECharts 5.x\n // no delay for rendering but remain animation of elements\n duration: 0\n }\n }\n\n if (returnMapCameraState) {\n e = e || {}\n let center = e.center\n if (!center) {\n // normalize center LngLat to Array\n center = amap.getCenter()\n center = [center.lng, center.lat]\n }\n actionParams.camera = {\n viewMode,\n center,\n zoom: e.zoom || amap.getZoom(),\n rotation: e.rotation == null ? amap.getRotation() : e.rotation,\n pitch: e.pitch == null ? amap.getPitch() : e.pitch,\n scale: amap.getScale(),\n bounds: amap.getBounds()\n }\n }\n\n api.dispatchAction(actionParams)\n }\n\n amap.off('mapmove', this._moveHandler)\n amap.off('moveend', this._moveHandler)\n amap.off('viewchange', this._moveHandler)\n amap.off('camerachange', this._moveHandler)\n amap.off('zoom', this._moveHandler)\n\n if (this._resizeHandler) {\n amap.off('resize', this._resizeHandler)\n }\n if (this._moveStartHandler) {\n amap.off('movestart', this._moveStartHandler)\n }\n if (this._moveEndHandler) {\n amap.off('moveend', this._moveEndHandler)\n amap.off('zoomend', this._moveEndHandler)\n }\n\n amap.on(\n renderOnMoving\n ? (_isAMap2X\n ? 'viewchange'\n : is3DMode\n ? 'camerachange'\n : 'mapmove')\n : 'moveend',\n // FIXME: bad performance in 1.x in the cases with large data, use debounce?\n // moveHandler\n (!_isAMap2X && largeMode) ? (moveHandler = throttle(moveHandler, 20, true)) : moveHandler\n )\n\n this._moveHandler = moveHandler\n\n if (renderOnMoving && !(_isAMap2X && is3DMode)) {\n // need to listen to zoom if 1.x & 2D mode\n // FIXME: unnecessary `mapmove` event triggered when zooming\n amap.on('zoom', moveHandler)\n }\n\n if (!renderOnMoving) {\n amap.on('movestart', this._moveStartHandler = function() {\n setTimeout(function() {\n amapModel.setEChartsLayerVisiblity(false)\n }, 0)\n })\n const moveEndHandler = this._moveEndHandler = function(e) {\n ;(!e || e.type !== 'moveend') && moveHandler(e)\n setTimeout(function() {\n amapModel.setEChartsLayerVisiblity(true)\n }, _isAMap2X || !largeMode ? 0 : 20)\n }\n amap.on('moveend', moveEndHandler)\n amap.on('zoomend', moveEndHandler)\n if (this._isFirstRender && is3DMode) {\n // FIXME: not rewrite AMap instance method\n const nativeSetPicth = amap.setPitch\n const nativeSetRotation = amap.setRotation\n amap.setPitch = function() {\n nativeSetPicth.apply(this, arguments)\n moveEndHandler()\n }\n amap.setRotation = function() {\n nativeSetRotation.apply(this, arguments)\n moveEndHandler()\n }\n }\n }\n\n if (resizeEnable) {\n let resizeHandler = function() {\n getInstanceByDom(api.getDom()).resize()\n }\n if (!_isAMap2X && largeMode) {\n resizeHandler = throttle(resizeHandler, 20, true)\n }\n amap.on('resize', this._resizeHandler = resizeHandler)\n }\n\n this._isFirstRender = rendering = false\n },\n\n dispose() {\n clearLogMap()\n const component = this.__model\n if (component) {\n component.getAMap().destroy()\n component.setAMap(null)\n component.setEChartsLayer(null)\n if (component.coordinateSystem) {\n component.coordinateSystem.setAMap(null)\n component.coordinateSystem = null\n }\n delete this._moveHandler\n delete this._resizeHandler\n delete this._moveStartHandler\n delete this._moveEndHandler\n }\n }\n}\n\nexport default isNewEC\n ? ComponentView.extend(AMapView)\n : AMapView\n","/**\n * AMap component extension\n */\n\nimport AMapCoordSys from './AMapCoordSys'\nimport AMapModel from './AMapModel'\nimport AMapView from './AMapView'\nimport { isNewEC, ecVer } from './helper'\n\nexport { version, name } from '../package.json'\n\n/**\n * @typedef {import('../export').EChartsExtensionRegisters} EChartsExtensionRegisters\n */\n\n/**\n * AMap extension installer\n * @param {EChartsExtensionRegisters} registers\n */\nexport function install(registers) {\n // add coordinate system support for pie series for ECharts < 5.4.0\n if (!isNewEC || (ecVer[0] == 5 && ecVer[1] < 4)) {\n registers.registerLayout(function(ecModel, api) {\n ecModel.eachSeriesByType('pie', function (seriesModel) {\n const coordSys = seriesModel.coordinateSystem\n const data = seriesModel.getData()\n const valueDim = data.mapDimension('value')\n if (coordSys && coordSys.type === 'amap') {\n const center = seriesModel.get('center')\n const point = coordSys.dataToPoint(center)\n const cx = point[0]\n const cy = point[1]\n data.each(valueDim, function (value, idx) {\n const layout = data.getItemLayout(idx)\n layout.cx = cx\n layout.cy = cy\n })\n }\n })\n })\n }\n // Model\n isNewEC\n ? registers.registerComponentModel(AMapModel)\n : registers.extendComponentModel(AMapModel)\n // View\n isNewEC\n ? registers.registerComponentView(AMapView)\n : registers.extendComponentView(AMapView)\n // Coordinate System\n registers.registerCoordinateSystem('amap', AMapCoordSys)\n // Action\n registers.registerAction(\n {\n type: 'amapRoam',\n event: 'amapRoam',\n update: 'updateLayout'\n },\n function(payload, ecModel) {\n ecModel.eachComponent('amap', function(amapModel) {\n const amap = amapModel.getAMap()\n const center = amap.getCenter()\n amapModel.setCenterAndZoom([center.lng, center.lat], amap.getZoom())\n })\n }\n )\n}\n","/**\n * TODO use `echarts/core` rather than `echarts/lib/echarts`\n * to avoid self-registered `CanvasRenderer` and `DataSetComponent` in Apache ECharts 5\n * but it's not compatible with echarts v4. Leave it to 2.0.\n */\nimport * as echarts from 'echarts/lib/echarts'\nimport { install } from './src/index'\nimport { isNewEC } from './src/helper'\n\nisNewEC ? echarts.use(install) : install(echarts)\n\nexport { name, version } from './src/index'\n"],"names":["ecVer","version","split","isNewEC","isAMap2X","AMap","v2Equal","a","b","logMap","logWarn","tag","msg","once","log","console","warn","clearLogMap","dataToCoordSize","dataSize","dataItem","zrUtil","map","dimIdx","val","halfSize","p1","p2","Math","abs","dataToPoint","excludedOptions","AMapCoordSys","amap","api","_amap","_api","_mapOffset","AMapCoordSysProto","prototype","setZoom","zoom","_zoom","setCenter","center","lnglat","LngLat","_center","lngLatToContainer","setMapOffset","mapOffset","setAMap","getAMap","data","px","x","y","pointToData","pt","containerToLngLat","Pixel","lng","lat","getViewRect","graphic","BoundingRect","getWidth","getHeight","getRoamTransform","matrix","create","prepareCustoms","rect","coordSys","type","width","height","coord","bind","size","convertToPixel","ecModel","finder","value","convertFromPixel","amapCoordSys","eachComponent","amapModel","Error","echartsLayerInteractive","get","root","getDom","painter","getZr","viewportRoot","getViewportRoot","className","style","visibility","amapRoot","querySelector","left","top","removeChild","document","createElement","cssText","appendChild","options","clone","each","key","Map","on","setEChartsLayer","getViewportRootOffset","offsetLeft","offsetTop","oldEChartsLayerInteractive","__echartsLayerInteractive","setEChartsLayerInteractive","amapCenter","getCenter","amapZoom","getZoom","centerOrZoomChanged","setZoomAndCenter","originalMapStyle","__mapStyle","newMapStyle","setMapStyle","setLang","originalMapLang","__mapLang","newMapLang","__mapOffset","coordinateSystem","eachSeries","seriesModel","dimensions","AMapModel","__amap","layer","__echartsLayer","getEChartsLayer","setEChartsLayerVisiblity","visible","display","interactive","option","pointerEvents","setCenterAndZoom","defaultOption","isHotspot","resizeEnable","renderOnMoving","largeMode","returnMapCameraState","ComponentModel","extend","_isAMap2X","AMapView","init","_isFirstRender","render","rendering","offsetEl","getContainer","viewMode","getViewMode_","is3DMode","moveHandler","e","offsetElStyle","parseInt","viewportRootStyle","actionParams","animation","duration","camera","rotation","getRotation","pitch","getPitch","scale","getScale","bounds","getBounds","dispatchAction","off","_moveHandler","_resizeHandler","_moveStartHandler","_moveEndHandler","throttle","setTimeout","moveEndHandler","nativeSetPicth","setPitch","nativeSetRotation","setRotation","apply","arguments","resizeHandler","getInstanceByDom","resize","dispose","component","__model","destroy","ComponentView","install","registers","registerLayout","eachSeriesByType","getData","valueDim","mapDimension","point","cx","cy","idx","layout","getItemLayout","registerComponentModel","extendComponentModel","registerComponentView","extendComponentView","registerCoordinateSystem","registerAction","event","update","payload","echarts","use"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEO,IAAMA,KAAK,GAAGC,eAAO,CAACC,KAAR,CAAc,GAAd,CAAd,CAAA;EAEA,IAAMC,OAAO,GAAGH,KAAK,CAAC,CAAD,CAAL,GAAW,CAA3B,CAAA;EAEP;EAEA;EACA;EACA;;EACO,IAAMI,QAAQ,GAAG,SAAXA,QAAW,GAAA;EAAA,EAAA,OAAMC,IAAI,CAACJ,OAAL,IAAgB,CAAtB,CAAA;EAAA,CAAjB,CAAA;EAEA,SAASK,OAAT,CAAiBC,CAAjB,EAAoBC,CAApB,EAAuB;IAC5B,OAAOD,CAAC,IAAIC,CAAL,IAAUD,CAAC,CAAC,CAAD,CAAD,KAASC,CAAC,CAAC,CAAD,CAApB,IAA2BD,CAAC,CAAC,CAAD,CAAD,KAASC,CAAC,CAAC,CAAD,CAA5C,CAAA;EACD,CAAA;EAED,IAAIC,MAAM,GAAG,EAAb,CAAA;EAEO,SAASC,OAAT,CAAiBC,GAAjB,EAAsBC,GAAtB,EAA2BC,IAA3B,EAAiC;EACtC,EAAA,IAAMC,GAAG,GAAA,4BAAA,CAAA,MAAA,CAAgCH,GAAG,GAAG,GAAMA,GAAAA,GAAN,GAAY,GAAf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qD7B,IAAI,CAAC4F,OAAL,EAArD,CAAA,CAAA;OAHF,CAAA,CAAA;KAPJ,CAAA,CAAA;EAcD;;EClED;EACA;EACA;EACA;EACA;EAKA1H,OAAO,GAAGuO,OAAO,CAACC,GAAR,CAAYvB,OAAZ,CAAH,GAA0BA,OAAO,CAACsB,OAAD,CAAxC;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"echarts-extension-amap.js","sources":["../src/helper.js","../src/AMapCoordSys.js","../src/AMapModel.js","../src/AMapView.js","../src/index.js","../index.js"],"sourcesContent":["import { version } from 'echarts/lib/echarts'\n\nexport const ecVer = version.split('.')\n\nexport const isNewEC = ecVer[0] > 4\n\nexport const COMPONENT_TYPE = 'amap'\n\n/* global AMap */\n\n// The version property is `AMap.v` in AMap 1.x,\n// but `AMap.version` may also exist (See #51)\n// In AMap 2.x, it's `AMap.version` (Not sure if `AMap.v` exists)\n// use function instead of constant to allow importing the plugin before AMap is loaded\nexport const isAMap2X = () => !AMap.v && AMap.version && AMap.version.split('.')[0] >= 2\n\nexport function v2Equal(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1]\n}\n\nlet logMap = {}\n\nexport function logWarn(tag, msg, once) {\n const log = `[ECharts][Extension][AMap]${tag ? ' ' + tag + ':' : ''} ${msg}`\n once && logMap[log] || console.warn(log)\n once && (logMap[log] = true)\n}\n\nexport function clearLogMap() {\n logMap = {}\n}\n","import { util as zrUtil, graphic, matrix } from 'echarts/lib/echarts'\nimport { COMPONENT_TYPE, logWarn } from './helper'\n\nfunction dataToCoordSize(dataSize, dataItem) {\n dataItem = dataItem || [0, 0];\n return zrUtil.map(\n [0, 1],\n function(dimIdx) {\n const val = dataItem[dimIdx]\n const halfSize = dataSize[dimIdx] / 2\n const p1 = []\n const p2 = []\n p1[dimIdx] = val - halfSize\n p2[dimIdx] = val + halfSize\n p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx]\n return Math.abs(\n this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]\n )\n },\n this\n )\n}\n\n// exclude private and unsupported options\nconst excludedOptions = [\n 'echartsLayerZIndex', // DEPRECATED since v1.9.0\n 'echartsLayerInteractive',\n 'renderOnMoving',\n 'largeMode',\n 'returnMapCameraState',\n 'layers'\n]\n\nfunction AMapCoordSys(amap, api) {\n this._amap = amap\n this._api = api\n this._mapOffset = [0, 0]\n // this.dimensions = ['lng', 'lat']\n}\n\nconst AMapCoordSysProto = AMapCoordSys.prototype\n\nAMapCoordSysProto.setZoom = function(zoom) {\n this._zoom = zoom\n}\n\nAMapCoordSysProto.setCenter = function(center) {\n const lnglat = new AMap.LngLat(center[0], center[1])\n this._center = this._amap.lngLatToContainer(lnglat)\n}\n\nAMapCoordSysProto.setMapOffset = function(mapOffset) {\n this._mapOffset = mapOffset\n}\n\nAMapCoordSysProto.setAMap = function(amap) {\n this._amap = amap\n}\n\nAMapCoordSysProto.getAMap = function() {\n return this._amap\n}\n\nAMapCoordSysProto.dataToPoint = function(data) {\n const lnglat = new AMap.LngLat(data[0], data[1])\n const px = this._amap.lngLatToContainer(lnglat)\n const mapOffset = this._mapOffset\n return [px.x - mapOffset[0], px.y - mapOffset[1]]\n}\n\nAMapCoordSysProto.pointToData = function(pt) {\n const mapOffset = this._mapOffset\n const lnglat = this._amap.containerToLngLat(\n new AMap.Pixel(\n pt[0] + mapOffset[0],\n pt[1] + mapOffset[1]\n )\n )\n return [lnglat.lng, lnglat.lat]\n}\n\nAMapCoordSysProto.getViewRect = function() {\n const api = this._api\n return new graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight())\n}\n\nAMapCoordSysProto.getRoamTransform = function() {\n return matrix.create()\n}\n\nAMapCoordSysProto.prepareCustoms = function() {\n const rect = this.getViewRect()\n return {\n coordSys: {\n type: COMPONENT_TYPE,\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n api: {\n coord: zrUtil.bind(this.dataToPoint, this),\n size: zrUtil.bind(dataToCoordSize, this)\n }\n }\n}\n\nAMapCoordSysProto.convertToPixel = function(ecModel, finder, value) {\n // here we don't use finder as only one amap component is allowed\n return this.dataToPoint(value);\n}\n\nAMapCoordSysProto.convertFromPixel = function(ecModel, finder, value) {\n // here we don't use finder as only one amap component is allowed\n return this.pointToData(value);\n}\n\n// less useful\n// AMapCoordSysProto.containPoint = function(point) {\n// return this._amap.getBounds().contains(this.pointToData(point));\n// }\n\nAMapCoordSys.create = function(ecModel, api) {\n let amapCoordSys\n ecModel.eachComponent(COMPONENT_TYPE, function(amapModel) {\n if (typeof AMap === 'undefined') {\n throw new Error('AMap api is not loaded')\n }\n if (amapCoordSys) {\n throw new Error('Only one amap component is allowed')\n }\n let amap = amapModel.getAMap()\n const echartsLayerInteractive = amapModel.get('echartsLayerInteractive')\n if (!amap) {\n const root = api.getDom()\n const painter = api.getZr().painter\n const viewportRoot = painter.getViewportRoot()\n viewportRoot.className = COMPONENT_TYPE + '-ec-layer'\n // PENDING not hidden?\n viewportRoot.style.visibility = 'hidden'\n const className = 'ec-extension-' + COMPONENT_TYPE\n // Not support IE8\n let amapRoot = root.querySelector('.' + className)\n if (amapRoot) {\n // Reset viewport left and top, which will be changed\n // in moving handler in AMapView\n viewportRoot.style.left = '0px'\n viewportRoot.style.top = '0px'\n root.removeChild(amapRoot)\n }\n amapRoot = document.createElement('div')\n amapRoot.className = className\n amapRoot.style.cssText = 'position:absolute;top:0;left:0;bottom:0;right:0;'\n root.appendChild(amapRoot)\n\n const options = zrUtil.clone(amapModel.get())\n if ('echartsLayerZIndex' in options) {\n logWarn('DEPRECATED', 'the option `echartsLayerZIndex` has been removed since v1.9.0, use `echartsLayerInteractive` instead.')\n }\n // delete excluded options\n zrUtil.each(excludedOptions, function(key) {\n delete options[key]\n })\n\n amap = new AMap.Map(amapRoot, options)\n\n // PENDING: should update the model option when the user call map.setXXX?\n\n // const nativeSetMapStyle = amap.setMapStyle\n // const nativeSetLang = amap.setLang\n\n // // PENDING\n // amap.setMapStyle = function () {\n // nativeSetMapStyle.apply(this, arguments)\n // amapModel.__mapStyle = amap.getMapStyle()\n // }\n\n // // PENDING\n // nativeSetLang && (amap.setLang = function() {\n // nativeSetLang.apply(this, arguments)\n // amapModel.__mapLang = amap.getLang()\n // })\n\n // use `complete` callback to avoid NPE when first load amap\n amap.on('complete', function() {\n amapRoot.querySelector('.amap-maps').appendChild(viewportRoot)\n // PENDING\n viewportRoot.style.visibility = ''\n })\n\n amapModel.setAMap(amap)\n amapModel.setEChartsLayer(viewportRoot)\n\n // Override\n painter.getViewportRootOffset = function() {\n return { offsetLeft: 0, offsetTop: 0 }\n }\n }\n\n const oldEChartsLayerInteractive = amapModel.__echartsLayerInteractive\n if (oldEChartsLayerInteractive !== echartsLayerInteractive) {\n amapModel.setEChartsLayerInteractive(echartsLayerInteractive)\n amapModel.__echartsLayerInteractive = echartsLayerInteractive\n }\n\n const center = amapModel.get('center')\n const zoom = amapModel.get('zoom')\n if (center && zoom) {\n const amapCenter = amap.getCenter()\n const amapZoom = amap.getZoom()\n const centerOrZoomChanged = amapModel.centerOrZoomChanged(\n [amapCenter.lng, amapCenter.lat],\n amapZoom\n )\n if (centerOrZoomChanged) {\n amap.setZoomAndCenter(zoom, new AMap.LngLat(center[0], center[1]))\n }\n }\n\n // update map style(#13)\n const originalMapStyle = amapModel.__mapStyle\n const newMapStyle = amapModel.get('mapStyle')\n if (originalMapStyle !== newMapStyle) {\n amap.setMapStyle(amapModel.__mapStyle = newMapStyle)\n }\n\n // update map lang\n // PENDING: AMap 2.x does not support `setLang` yet\n if (amap.setLang) {\n const originalMapLang = amapModel.__mapLang\n const newMapLang = amapModel.get('lang')\n if (originalMapLang !== newMapLang) {\n amap.setLang(amapModel.__mapLang = newMapLang)\n }\n }\n else {\n logWarn('CAVEAT', 'The current map doesn\\'t support `setLang` API!', true)\n }\n\n amapCoordSys = new AMapCoordSys(amap, api)\n amapCoordSys.setMapOffset(amapModel.__mapOffset || [0, 0])\n amapCoordSys.setZoom(zoom)\n amapCoordSys.setCenter(center)\n\n amapModel.coordinateSystem = amapCoordSys\n })\n\n ecModel.eachSeries(function(seriesModel) {\n if (seriesModel.get('coordinateSystem') === COMPONENT_TYPE) {\n // inject coordinate system\n seriesModel.coordinateSystem = amapCoordSys\n }\n })\n\n // return created coordinate systems\n return amapCoordSys && [amapCoordSys]\n}\n\nAMapCoordSysProto.dimensions = AMapCoordSys.dimensions = ['lng', 'lat']\n\nAMapCoordSysProto.type = COMPONENT_TYPE\n\n\nexport default AMapCoordSys\n","import { ComponentModel } from 'echarts/lib/echarts'\nimport { COMPONENT_TYPE, isNewEC, v2Equal } from './helper'\n\nconst AMapModel = {\n type: COMPONENT_TYPE,\n\n setAMap(amap) {\n this.__amap = amap\n },\n\n getAMap() {\n return this.__amap\n },\n\n setEChartsLayer(layer) {\n this.__echartsLayer = layer\n },\n\n getEChartsLayer() {\n return this.__echartsLayer\n },\n\n setEChartsLayerVisibility(visible) {\n this.__echartsLayer.style.display = visible ? 'block' : 'none'\n },\n\n // FIXME: NOT SUPPORT <= IE 10\n setEChartsLayerInteractive(interactive) {\n this.option.echartsLayerInteractive = !!interactive\n this.__echartsLayer.style.pointerEvents = interactive ? 'auto' : 'none'\n },\n\n setCenterAndZoom(center, zoom) {\n this.option.center = center\n this.option.zoom = zoom\n },\n\n centerOrZoomChanged(center, zoom) {\n const option = this.option\n return !(v2Equal(center, option.center) && zoom === option.zoom)\n },\n\n defaultOption: {\n center: [116.397428, 39.90923],\n zoom: 5,\n isHotspot: false,\n resizeEnable: true,\n\n // extension specific options\n // echartsLayerZIndex: 2000, // DEPRECATED since v1.9.0\n echartsLayerInteractive: true,\n renderOnMoving: true,\n largeMode: false,\n // since v1.10.0\n returnMapCameraState: false\n }\n}\n\nexport default isNewEC\n ? ComponentModel.extend(AMapModel)\n : AMapModel\n","import { ComponentView, getInstanceByDom, throttle } from 'echarts/lib/echarts'\nimport { COMPONENT_TYPE, isNewEC, isAMap2X, clearLogMap } from './helper'\n\nlet _isAMap2X\n\nconst AMapView = {\n type: COMPONENT_TYPE,\n\n init() {\n this._isFirstRender = true\n\n _isAMap2X = isAMap2X()\n },\n\n render(amapModel, ecModel, api) {\n let rendering = true\n\n const amap = amapModel.getAMap()\n const viewportRoot = api.getZr().painter.getViewportRoot()\n const offsetEl = amap.getContainer()\n const coordSys = amapModel.coordinateSystem\n\n const renderOnMoving = amapModel.get('renderOnMoving')\n const resizeEnable = amapModel.get('resizeEnable')\n const largeMode = amapModel.get('largeMode')\n const returnMapCameraState = amapModel.get('returnMapCameraState')\n\n const viewMode = amap.getViewMode_()\n const is3DMode = viewMode === '3D'\n\n let moveHandler = function(e) {\n if (rendering) {\n return\n }\n\n const offsetElStyle = offsetEl.style\n const mapOffset = [\n -parseInt(offsetElStyle.left, 10) || 0,\n -parseInt(offsetElStyle.top, 10) || 0\n ]\n // only update style when map offset changed\n const viewportRootStyle = viewportRoot.style\n const offsetLeft = mapOffset[0] + 'px'\n const offsetTop = mapOffset[1] + 'px'\n if (viewportRootStyle.left !== offsetLeft) {\n viewportRootStyle.left = offsetLeft\n }\n if (viewportRootStyle.top !== offsetTop) {\n viewportRootStyle.top = offsetTop\n }\n\n coordSys.setMapOffset(amapModel.__mapOffset = mapOffset)\n\n const actionParams = {\n type: 'amapRoam',\n animation: {\n // compatible with ECharts 5.x\n // no delay for rendering but remain animation of elements\n duration: 0\n }\n }\n\n if (returnMapCameraState) {\n e = e || {}\n let center = e.center\n if (!center) {\n // normalize center LngLat to Array\n center = amap.getCenter()\n center = [center.lng, center.lat]\n }\n actionParams.camera = {\n viewMode,\n center,\n zoom: e.zoom || amap.getZoom(),\n rotation: e.rotation == null ? amap.getRotation() : e.rotation,\n pitch: e.pitch == null ? amap.getPitch() : e.pitch,\n scale: amap.getScale(),\n bounds: amap.getBounds()\n }\n }\n\n api.dispatchAction(actionParams)\n }\n\n amap.off('mapmove', this._moveHandler)\n amap.off('moveend', this._moveHandler)\n amap.off('viewchange', this._moveHandler)\n amap.off('camerachange', this._moveHandler)\n amap.off('zoom', this._moveHandler)\n\n if (this._resizeHandler) {\n amap.off('resize', this._resizeHandler)\n }\n if (this._moveStartHandler) {\n amap.off('movestart', this._moveStartHandler)\n }\n if (this._moveEndHandler) {\n amap.off('moveend', this._moveEndHandler)\n amap.off('zoomend', this._moveEndHandler)\n }\n\n amap.on(\n renderOnMoving\n ? (_isAMap2X\n ? 'viewchange'\n : is3DMode\n ? 'camerachange'\n : 'mapmove')\n : 'moveend',\n // FIXME: bad performance in 1.x in the cases with large data, use debounce?\n // moveHandler\n (!_isAMap2X && largeMode) ? (moveHandler = throttle(moveHandler, 20, true)) : moveHandler\n )\n\n this._moveHandler = moveHandler\n\n if (renderOnMoving && !(_isAMap2X && is3DMode)) {\n // need to listen to zoom if 1.x & 2D mode\n // FIXME: unnecessary `mapmove` event triggered when zooming\n amap.on('zoom', moveHandler)\n }\n\n if (!renderOnMoving) {\n amap.on('movestart', this._moveStartHandler = function() {\n setTimeout(function() {\n amapModel.setEChartsLayerVisibility(false)\n }, 0)\n })\n const moveEndHandler = this._moveEndHandler = function(e) {\n ;(!e || e.type !== 'moveend') && moveHandler(e)\n setTimeout(function() {\n amapModel.setEChartsLayerVisibility(true)\n }, _isAMap2X || !largeMode ? 0 : 20)\n }\n amap.on('moveend', moveEndHandler)\n amap.on('zoomend', moveEndHandler)\n if (this._isFirstRender && is3DMode) {\n // FIXME: not rewrite AMap instance method\n const nativeSetPitch = amap.setPitch\n const nativeSetRotation = amap.setRotation\n amap.setPitch = function() {\n nativeSetPitch.apply(this, arguments)\n moveEndHandler()\n }\n amap.setRotation = function() {\n nativeSetRotation.apply(this, arguments)\n moveEndHandler()\n }\n }\n }\n\n if (resizeEnable) {\n let resizeHandler = () => {\n clearTimeout(this._resizeTimeout)\n this._resizeTimeout = setTimeout(() => getInstanceByDom(api.getDom()).resize(), 0)\n }\n if (!_isAMap2X && largeMode) {\n resizeHandler = throttle(resizeHandler, 20, true)\n }\n amap.on('resize', this._resizeHandler = resizeHandler)\n }\n\n this._isFirstRender = rendering = false\n },\n\n dispose() {\n clearTimeout(this._resizeTimeout)\n clearLogMap()\n const component = this.__model\n if (component) {\n component.getAMap().destroy()\n component.setAMap(null)\n component.setEChartsLayer(null)\n if (component.coordinateSystem) {\n component.coordinateSystem.setAMap(null)\n component.coordinateSystem = null\n }\n }\n delete this._moveHandler\n delete this._moveStartHandler\n delete this._moveEndHandler\n delete this._resizeHandler\n delete this._resizeTimeout\n }\n}\n\nexport default isNewEC\n ? ComponentView.extend(AMapView)\n : AMapView\n","/**\n * AMap component extension\n */\n\nimport AMapCoordSys from './AMapCoordSys'\nimport AMapModel from './AMapModel'\nimport AMapView from './AMapView'\nimport { isNewEC, ecVer, COMPONENT_TYPE } from './helper'\n\nexport { version, name } from '../package.json'\n\n/**\n * @typedef {import('../export').EChartsExtensionRegisters} EChartsExtensionRegisters\n */\n\n/**\n * AMap extension installer\n * @param {EChartsExtensionRegisters} registers\n */\nexport function install(registers) {\n // add coordinate system support for pie series for ECharts < 5.4.0\n if (!isNewEC || (ecVer[0] == 5 && ecVer[1] < 4)) {\n registers.registerLayout(function(ecModel) {\n ecModel.eachSeriesByType('pie', function (seriesModel) {\n const coordSys = seriesModel.coordinateSystem\n const data = seriesModel.getData()\n const valueDim = data.mapDimension('value')\n if (coordSys && coordSys.type === COMPONENT_TYPE) {\n const center = seriesModel.get('center')\n const point = coordSys.dataToPoint(center)\n const cx = point[0]\n const cy = point[1]\n data.each(valueDim, function (value, idx) {\n const layout = data.getItemLayout(idx)\n layout.cx = cx\n layout.cy = cy\n })\n }\n })\n })\n }\n // Model\n isNewEC\n ? registers.registerComponentModel(AMapModel)\n : registers.extendComponentModel(AMapModel)\n // View\n isNewEC\n ? registers.registerComponentView(AMapView)\n : registers.extendComponentView(AMapView)\n // Coordinate System\n registers.registerCoordinateSystem(COMPONENT_TYPE, AMapCoordSys)\n // Action\n registers.registerAction(\n {\n type: COMPONENT_TYPE + 'Roam',\n event: COMPONENT_TYPE + 'Roam',\n update: 'updateLayout'\n },\n function(payload, ecModel) {\n ecModel.eachComponent(COMPONENT_TYPE, function(amapModel) {\n const amap = amapModel.getAMap()\n const center = amap.getCenter()\n amapModel.setCenterAndZoom([center.lng, center.lat], amap.getZoom())\n })\n }\n )\n}\n","/**\n * TODO use `echarts/core` rather than `echarts/lib/echarts`\n * to avoid self-registered `CanvasRenderer` and `DataSetComponent` in Apache ECharts 5\n * but it's not compatible with echarts v4. Leave it to 2.0.\n */\nimport * as echarts from 'echarts/lib/echarts'\nimport { install } from './src/index'\nimport { isNewEC } from './src/helper'\n\nisNewEC ? echarts.use(install) : install(echarts)\n\nexport { name, version } from './src/index'\n"],"names":["ecVer","version","split","isNewEC","COMPONENT_TYPE","isAMap2X","AMap","v","v2Equal","a","b","logMap","logWarn","tag","msg","once","log","concat","console","warn","clearLogMap","dataToCoordSize","dataSize","dataItem","zrUtil","map","dimIdx","val","halfSize","p1","p2","Math","abs","dataToPoint","excludedOptions","AMapCoordSys","amap","api","_amap","_api","_mapOffset","AMapCoordSysProto","prototype","setZoom","zoom","_zoom","setCenter","center","lnglat","LngLat","_center","lngLatToContainer","setMapOffset","mapOffset","setAMap","getAMap","data","px","x","y","pointToData","pt","containerToLngLat","Pixel","lng","lat","getViewRect","graphic","BoundingRect","getWidth","getHeight","getRoamTransform","matrix","create","prepareCustoms","rect","coordSys","type","width","height","coord","bind","size","convertToPixel","ecModel","finder","value","convertFromPixel","amapCoordSys","eachComponent","amapModel","Error","echartsLayerInteractive","get","root","getDom","painter","getZr","viewportRoot","getViewportRoot","className","style","visibility","amapRoot","querySelector","left","top","removeChild","document","createElement","cssText","appendChild","options","clone","each","key","Map","on","setEChartsLayer","getViewportRootOffset","offsetLeft","offsetTop","oldEChartsLayerInteractive","__echartsLayerInteractive","setEChartsLayerInteractive","amapCenter","getCenter","amapZoom","getZoom","centerOrZoomChanged","setZoomAndCenter","originalMapStyle","__mapStyle","newMapStyle","setMapStyle","setLang","originalMapLang","__mapLang","newMapLang","__mapOffset","coordinateSystem","eachSeries","seriesModel","dimensions","AMapModel","__amap","layer","__echartsLayer","getEChartsLayer","setEChartsLayerVisibility","visible","display","interactive","option","pointerEvents","setCenterAndZoom","defaultOption","isHotspot","resizeEnable","renderOnMoving","largeMode","returnMapCameraState","ComponentModel","extend","_isAMap2X","AMapView","init","_isFirstRender","render","_this","rendering","offsetEl","getContainer","viewMode","getViewMode_","is3DMode","moveHandler","e","offsetElStyle","parseInt","viewportRootStyle","actionParams","animation","duration","camera","rotation","getRotation","pitch","getPitch","scale","getScale","bounds","getBounds","dispatchAction","off","_moveHandler","_resizeHandler","_moveStartHandler","_moveEndHandler","throttle","setTimeout","moveEndHandler","nativeSetPitch","setPitch","nativeSetRotation","setRotation","apply","arguments","resizeHandler","clearTimeout","_resizeTimeout","getInstanceByDom","resize","dispose","component","__model","destroy","ComponentView","install","registers","registerLayout","eachSeriesByType","getData","valueDim","mapDimension","point","cx","cy","idx","layout","getItemLayout","registerComponentModel","extendComponentModel","registerComponentView","extendComponentView","registerCoordinateSystem","registerAction","event","update","payload","echarts","use"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEO,IAAMA,KAAK,GAAGC,eAAO,CAACC,KAAK,CAAC,GAAG,CAAC,CAAA;EAEhC,IAAMC,OAAO,GAAGH,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;EAE5B,IAAMI,cAAc,GAAG,MAAM,CAAA;;EAEpC;;EAEA;EACA;EACA;EACA;EACO,IAAMC,QAAQ,GAAG,SAAXA,QAAQA,GAAA;IAAA,OAAS,CAACC,IAAI,CAACC,CAAC,IAAID,IAAI,CAACL,OAAO,IAAIK,IAAI,CAACL,OAAO,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;EAAA,CAAA,CAAA;EAEjF,SAASM,OAAOA,CAACC,CAAC,EAAEC,CAAC,EAAE;IAC5B,OAAOD,CAAC,IAAIC,CAAC,IAAID,C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AAO,EAAE;EACzBA,IAAAA,OAAO,CAACK,aAAa,CAACrF,cAAc,EAAE,UAASsF,SAAS,EAAE;EACxD,MAAA,IAAMtD,IAAI,GAAGsD,SAAS,CAACnC,OAAO,EAAE,CAAA;EAChC,MAAA,IAAMR,MAAM,GAAGX,IAAI,CAAC0F,SAAS,EAAE,CAAA;EAC/BpC,MAAAA,SAAS,CAACiE,gBAAgB,CAAC,CAAC5G,MAAM,CAACiB,GAAG,EAAEjB,MAAM,CAACkB,GAAG,CAAC,EAAE7B,IAAI,CAAC4F,OAAO,EAAE,CAAC,CAAA;EACtE,KAAC,CAAC,CAAA;EACJ,GACF,CAAC,CAAA;EACH;;EClEA;EACA;EACA;EACA;EACA;EAKA7H,OAAO,GAAG6O,OAAO,CAACC,GAAG,CAACvB,OAAO,CAAC,GAAGA,OAAO,CAACsB,OAAO,CAAC;;;;;;;;;"} \ No newline at end of file diff --git a/dist/echarts-extension-amap.min.js b/dist/echarts-extension-amap.min.js index d47536c..e5c06f5 100644 --- a/dist/echarts-extension-amap.min.js +++ b/dist/echarts-extension-amap.min.js @@ -1,11 +1,11 @@ /*! * echarts-extension-amap - * @version 1.11.0 + * @version 1.12.0 * @author plainheart * * MIT License * - * Copyright (c) 2019-2022 Zhongxiang.Wang + * Copyright (c) 2019-2024 Zhongxiang Wang * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,5 +26,5 @@ * SOFTWARE. * */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("echarts/lib/echarts")):"function"==typeof define&&define.amd?define(["exports","echarts"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).echarts=e.echarts||{},e.echarts.amap={}),e.echarts)}(this,(function(e,t){"use strict";var n=t.version.split("."),a=n[0]>4;var o={};function i(e,t,n){var a="[ECharts][Extension][AMap]".concat(e?" "+e+":":""," ").concat(t);n&&o[a]||console.warn(a),n&&(o[a]=!0)}function r(e,n){return n=n||[0,0],t.util.map([0,1],(function(t){var a=n[t],o=e[t]/2,i=[],r=[];return i[t]=a-o,r[t]=a+o,i[1-t]=r[1-t]=n[1-t],Math.abs(this.dataToPoint(i)[t]-this.dataToPoint(r)[t])}),this)}var s=["echartsLayerZIndex","echartsLayerInteractive","renderOnMoving","largeMode","returnMapCameraState","layers"];function c(e,t){this._amap=e,this._api=t,this._mapOffset=[0,0]}var p=c.prototype;p.setZoom=function(e){this._zoom=e},p.setCenter=function(e){var t=new AMap.LngLat(e[0],e[1]);this._center=this._amap.lngLatToContainer(t)},p.setMapOffset=function(e){this._mapOffset=e},p.setAMap=function(e){this._amap=e},p.getAMap=function(){return this._amap},p.dataToPoint=function(e){var t=new AMap.LngLat(e[0],e[1]),n=this._amap.lngLatToContainer(t),a=this._mapOffset;return[n.x-a[0],n.y-a[1]]},p.pointToData=function(e){var t=this._mapOffset,n=this._amap.containerToLngLat(new AMap.Pixel(e[0]+t[0],e[1]+t[1]));return[n.lng,n.lat]},p.getViewRect=function(){var e=this._api;return new t.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},p.getRoamTransform=function(){return t.matrix.create()},p.prepareCustoms=function(){var e=this.getViewRect();return{coordSys:{type:"amap",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:t.util.bind(this.dataToPoint,this),size:t.util.bind(r,this)}}},p.convertToPixel=function(e,t,n){return this.dataToPoint(n)},p.convertFromPixel=function(e,t,n){return this.pointToData(n)},c.create=function(e,n){var a;return e.eachComponent("amap",(function(e){if("undefined"==typeof AMap)throw new Error("AMap api is not loaded");if(a)throw new Error("Only one amap component is allowed");var o=e.getAMap(),r=e.get("echartsLayerInteractive");if(!o){var p=n.getDom(),m=n.getZr().painter,h=m.getViewportRoot();h.className="amap-ec-layer",h.style.visibility="hidden";var l=p.querySelector(".ec-extension-amap");l&&(h.style.left="0px",h.style.top="0px",p.removeChild(l)),(l=document.createElement("div")).className="ec-extension-amap",l.style.cssText="position:absolute;top:0;left:0;bottom:0;right:0;",p.appendChild(l);var d=t.util.clone(e.get());"echartsLayerZIndex"in d&&i("DEPRECATED","the option `echartsLayerZIndex` has been removed since v1.9.0, use `echartsLayerInteractive` instead."),t.util.each(s,(function(e){delete d[e]})),(o=new AMap.Map(l,d)).on("complete",(function(){l.querySelector(".amap-maps").appendChild(h),h.style.visibility=""})),e.setAMap(o),e.setEChartsLayer(h),m.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}e.__echartsLayerInteractive!==r&&(e.setEChartsLayerInteractive(r),e.__echartsLayerInteractive=r);var f=e.get("center"),u=e.get("zoom");if(f&&u){var v=o.getCenter(),g=o.getZoom();e.centerOrZoomChanged([v.lng,v.lat],g)&&o.setZoomAndCenter(u,new AMap.LngLat(f[0],f[1]))}var y=e.__mapStyle,_=e.get("mapStyle");if(y!==_&&o.setMapStyle(e.__mapStyle=_),o.setLang){var L=e.__mapLang,C=e.get("lang");L!==C&&o.setLang(e.__mapLang=C)}else i("CAVEAT","The current map doesn't support `setLang` API!",!0);(a=new c(o,n)).setMapOffset(e.__mapOffset||[0,0]),a.setZoom(u),a.setCenter(f),e.coordinateSystem=a})),e.eachSeries((function(e){"amap"===e.get("coordinateSystem")&&(e.coordinateSystem=a)})),a&&[a]},p.dimensions=c.dimensions=["lng","lat"],p.type="amap";var m,h={type:"amap",setAMap:function(e){this.__amap=e},getAMap:function(){return this.__amap},setEChartsLayer:function(e){this.__echartsLayer=e},getEChartsLayer:function(){return this.__echartsLayer},setEChartsLayerVisiblity:function(e){this.__echartsLayer.style.display=e?"block":"none"},setEChartsLayerInteractive:function(e){this.option.echartsLayerInteractive=!!e,this.__echartsLayer.style.pointerEvents=e?"auto":"none"},setCenterAndZoom:function(e,t){this.option.center=e,this.option.zoom=t},centerOrZoomChanged:function(e,t){var n,a,o=this.option;return a=o.center,!((n=e)&&a&&n[0]===a[0]&&n[1]===a[1]&&t===o.zoom)},defaultOption:{center:[116.397428,39.90923],zoom:5,isHotspot:!1,resizeEnable:!0,echartsLayerInteractive:!0,renderOnMoving:!0,largeMode:!1,returnMapCameraState:!1}},l=a?t.ComponentModel.extend(h):h,d={type:"amap",init:function(){this._isFirstRender=!0,m=AMap.version>=2},render:function(e,n,a){var o=!0,i=e.getAMap(),r=a.getZr().painter.getViewportRoot(),s=i.getContainer(),c=e.coordinateSystem,p=e.get("renderOnMoving"),h=e.get("resizeEnable"),l=e.get("largeMode"),d=e.get("returnMapCameraState"),f=i.getViewMode_(),u="3D"===f,v=function(t){if(!o){var n=s.style,p=[-parseInt(n.left,10)||0,-parseInt(n.top,10)||0],m=r.style,h=p[0]+"px",l=p[1]+"px";m.left!==h&&(m.left=h),m.top!==l&&(m.top=l),c.setMapOffset(e.__mapOffset=p);var u={type:"amapRoam",animation:{duration:0}};if(d){var v=(t=t||{}).center;v||(v=[(v=i.getCenter()).lng,v.lat]),u.camera={viewMode:f,center:v,zoom:t.zoom||i.getZoom(),rotation:null==t.rotation?i.getRotation():t.rotation,pitch:null==t.pitch?i.getPitch():t.pitch,scale:i.getScale(),bounds:i.getBounds()}}a.dispatchAction(u)}};if(i.off("mapmove",this._moveHandler),i.off("moveend",this._moveHandler),i.off("viewchange",this._moveHandler),i.off("camerachange",this._moveHandler),i.off("zoom",this._moveHandler),this._resizeHandler&&i.off("resize",this._resizeHandler),this._moveStartHandler&&i.off("movestart",this._moveStartHandler),this._moveEndHandler&&(i.off("moveend",this._moveEndHandler),i.off("zoomend",this._moveEndHandler)),i.on(p?m?"viewchange":u?"camerachange":"mapmove":"moveend",!m&&l?v=t.throttle(v,20,!0):v),this._moveHandler=v,!p||m&&u||i.on("zoom",v),!p){i.on("movestart",this._moveStartHandler=function(){setTimeout((function(){e.setEChartsLayerVisiblity(!1)}),0)});var g=this._moveEndHandler=function(t){(!t||"moveend"!==t.type)&&v(t),setTimeout((function(){e.setEChartsLayerVisiblity(!0)}),m||!l?0:20)};if(i.on("moveend",g),i.on("zoomend",g),this._isFirstRender&&u){var y=i.setPitch,_=i.setRotation;i.setPitch=function(){y.apply(this,arguments),g()},i.setRotation=function(){_.apply(this,arguments),g()}}}if(h){var L=function(){t.getInstanceByDom(a.getDom()).resize()};!m&&l&&(L=t.throttle(L,20,!0)),i.on("resize",this._resizeHandler=L)}this._isFirstRender=o=!1},dispose:function(){o={};var e=this.__model;e&&(e.getAMap().destroy(),e.setAMap(null),e.setEChartsLayer(null),e.coordinateSystem&&(e.coordinateSystem.setAMap(null),e.coordinateSystem=null),delete this._moveHandler,delete this._resizeHandler,delete this._moveStartHandler,delete this._moveEndHandler)}},f=a?t.ComponentView.extend(d):d;function u(e){(!a||5==n[0]&&n[1]<4)&&e.registerLayout((function(e,t){e.eachSeriesByType("pie",(function(e){var t=e.coordinateSystem,n=e.getData(),a=n.mapDimension("value");if(t&&"amap"===t.type){var o=e.get("center"),i=t.dataToPoint(o),r=i[0],s=i[1];n.each(a,(function(e,t){var a=n.getItemLayout(t);a.cx=r,a.cy=s}))}}))})),a?e.registerComponentModel(l):e.extendComponentModel(l),a?e.registerComponentView(f):e.extendComponentView(f),e.registerCoordinateSystem("amap",c),e.registerAction({type:"amapRoam",event:"amapRoam",update:"updateLayout"},(function(e,t){t.eachComponent("amap",(function(e){var t=e.getAMap(),n=t.getCenter();e.setCenterAndZoom([n.lng,n.lat],t.getZoom())}))}))}a?t.use(u):u(t),e.name="echarts-extension-amap",e.version="1.11.0",Object.defineProperty(e,"__esModule",{value:!0})})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("echarts/lib/echarts")):"function"==typeof define&&define.amd?define(["exports","echarts"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).echarts=e.echarts||{},e.echarts.amap={}),e.echarts)}(this,(function(e,t){"use strict";var n=t.version.split("."),a=n[0]>4,o="amap";var i={};function r(e,t,n){var a="[ECharts][Extension][AMap]".concat(e?" "+e+":":""," ").concat(t);n&&i[a]||console.warn(a),n&&(i[a]=!0)}function s(e,n){return n=n||[0,0],t.util.map([0,1],(function(t){var a=n[t],o=e[t]/2,i=[],r=[];return i[t]=a-o,r[t]=a+o,i[1-t]=r[1-t]=n[1-t],Math.abs(this.dataToPoint(i)[t]-this.dataToPoint(r)[t])}),this)}var c=["echartsLayerZIndex","echartsLayerInteractive","renderOnMoving","largeMode","returnMapCameraState","layers"];function p(e,t){this._amap=e,this._api=t,this._mapOffset=[0,0]}var h=p.prototype;h.setZoom=function(e){this._zoom=e},h.setCenter=function(e){var t=new AMap.LngLat(e[0],e[1]);this._center=this._amap.lngLatToContainer(t)},h.setMapOffset=function(e){this._mapOffset=e},h.setAMap=function(e){this._amap=e},h.getAMap=function(){return this._amap},h.dataToPoint=function(e){var t=new AMap.LngLat(e[0],e[1]),n=this._amap.lngLatToContainer(t),a=this._mapOffset;return[n.x-a[0],n.y-a[1]]},h.pointToData=function(e){var t=this._mapOffset,n=this._amap.containerToLngLat(new AMap.Pixel(e[0]+t[0],e[1]+t[1]));return[n.lng,n.lat]},h.getViewRect=function(){var e=this._api;return new t.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},h.getRoamTransform=function(){return t.matrix.create()},h.prepareCustoms=function(){var e=this.getViewRect();return{coordSys:{type:o,x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:t.util.bind(this.dataToPoint,this),size:t.util.bind(s,this)}}},h.convertToPixel=function(e,t,n){return this.dataToPoint(n)},h.convertFromPixel=function(e,t,n){return this.pointToData(n)},p.create=function(e,n){var a;return e.eachComponent(o,(function(e){if("undefined"==typeof AMap)throw new Error("AMap api is not loaded");if(a)throw new Error("Only one amap component is allowed");var i=e.getAMap(),s=e.get("echartsLayerInteractive");if(!i){var h=n.getDom(),m=n.getZr().painter,l=m.getViewportRoot();l.className=o+"-ec-layer",l.style.visibility="hidden";var d="ec-extension-"+o,f=h.querySelector("."+d);f&&(l.style.left="0px",l.style.top="0px",h.removeChild(f)),(f=document.createElement("div")).className=d,f.style.cssText="position:absolute;top:0;left:0;bottom:0;right:0;",h.appendChild(f);var u=t.util.clone(e.get());"echartsLayerZIndex"in u&&r("DEPRECATED","the option `echartsLayerZIndex` has been removed since v1.9.0, use `echartsLayerInteractive` instead."),t.util.each(c,(function(e){delete u[e]})),(i=new AMap.Map(f,u)).on("complete",(function(){f.querySelector(".amap-maps").appendChild(l),l.style.visibility=""})),e.setAMap(i),e.setEChartsLayer(l),m.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}e.__echartsLayerInteractive!==s&&(e.setEChartsLayerInteractive(s),e.__echartsLayerInteractive=s);var v=e.get("center"),g=e.get("zoom");if(v&&g){var y=i.getCenter(),_=i.getZoom();e.centerOrZoomChanged([y.lng,y.lat],_)&&i.setZoomAndCenter(g,new AMap.LngLat(v[0],v[1]))}var L=e.__mapStyle,M=e.get("mapStyle");if(L!==M&&i.setMapStyle(e.__mapStyle=M),i.setLang){var C=e.__mapLang,A=e.get("lang");C!==A&&i.setLang(e.__mapLang=A)}else r("CAVEAT","The current map doesn't support `setLang` API!",!0);(a=new p(i,n)).setMapOffset(e.__mapOffset||[0,0]),a.setZoom(g),a.setCenter(v),e.coordinateSystem=a})),e.eachSeries((function(e){e.get("coordinateSystem")===o&&(e.coordinateSystem=a)})),a&&[a]},h.dimensions=p.dimensions=["lng","lat"],h.type=o;var m,l={type:o,setAMap:function(e){this.__amap=e},getAMap:function(){return this.__amap},setEChartsLayer:function(e){this.__echartsLayer=e},getEChartsLayer:function(){return this.__echartsLayer},setEChartsLayerVisibility:function(e){this.__echartsLayer.style.display=e?"block":"none"},setEChartsLayerInteractive:function(e){this.option.echartsLayerInteractive=!!e,this.__echartsLayer.style.pointerEvents=e?"auto":"none"},setCenterAndZoom:function(e,t){this.option.center=e,this.option.zoom=t},centerOrZoomChanged:function(e,t){var n,a,o=this.option;return a=o.center,!((n=e)&&a&&n[0]===a[0]&&n[1]===a[1]&&t===o.zoom)},defaultOption:{center:[116.397428,39.90923],zoom:5,isHotspot:!1,resizeEnable:!0,echartsLayerInteractive:!0,renderOnMoving:!0,largeMode:!1,returnMapCameraState:!1}},d=a?t.ComponentModel.extend(l):l,f={type:o,init:function(){this._isFirstRender=!0,m=!AMap.v&&AMap.version&&AMap.version.split(".")[0]>=2},render:function(e,n,a){var o=this,i=!0,r=e.getAMap(),s=a.getZr().painter.getViewportRoot(),c=r.getContainer(),p=e.coordinateSystem,h=e.get("renderOnMoving"),l=e.get("resizeEnable"),d=e.get("largeMode"),f=e.get("returnMapCameraState"),u=r.getViewMode_(),v="3D"===u,g=function(t){if(!i){var n=c.style,o=[-parseInt(n.left,10)||0,-parseInt(n.top,10)||0],h=s.style,m=o[0]+"px",l=o[1]+"px";h.left!==m&&(h.left=m),h.top!==l&&(h.top=l),p.setMapOffset(e.__mapOffset=o);var d={type:"amapRoam",animation:{duration:0}};if(f){var v=(t=t||{}).center;v||(v=[(v=r.getCenter()).lng,v.lat]),d.camera={viewMode:u,center:v,zoom:t.zoom||r.getZoom(),rotation:null==t.rotation?r.getRotation():t.rotation,pitch:null==t.pitch?r.getPitch():t.pitch,scale:r.getScale(),bounds:r.getBounds()}}a.dispatchAction(d)}};if(r.off("mapmove",this._moveHandler),r.off("moveend",this._moveHandler),r.off("viewchange",this._moveHandler),r.off("camerachange",this._moveHandler),r.off("zoom",this._moveHandler),this._resizeHandler&&r.off("resize",this._resizeHandler),this._moveStartHandler&&r.off("movestart",this._moveStartHandler),this._moveEndHandler&&(r.off("moveend",this._moveEndHandler),r.off("zoomend",this._moveEndHandler)),r.on(h?m?"viewchange":v?"camerachange":"mapmove":"moveend",!m&&d?g=t.throttle(g,20,!0):g),this._moveHandler=g,!h||m&&v||r.on("zoom",g),!h){r.on("movestart",this._moveStartHandler=function(){setTimeout((function(){e.setEChartsLayerVisibility(!1)}),0)});var y=this._moveEndHandler=function(t){(!t||"moveend"!==t.type)&&g(t),setTimeout((function(){e.setEChartsLayerVisibility(!0)}),m||!d?0:20)};if(r.on("moveend",y),r.on("zoomend",y),this._isFirstRender&&v){var _=r.setPitch,L=r.setRotation;r.setPitch=function(){_.apply(this,arguments),y()},r.setRotation=function(){L.apply(this,arguments),y()}}}if(l){var M=function(){clearTimeout(o._resizeTimeout),o._resizeTimeout=setTimeout((function(){return t.getInstanceByDom(a.getDom()).resize()}),0)};!m&&d&&(M=t.throttle(M,20,!0)),r.on("resize",this._resizeHandler=M)}this._isFirstRender=i=!1},dispose:function(){clearTimeout(this._resizeTimeout),i={};var e=this.__model;e&&(e.getAMap().destroy(),e.setAMap(null),e.setEChartsLayer(null),e.coordinateSystem&&(e.coordinateSystem.setAMap(null),e.coordinateSystem=null)),delete this._moveHandler,delete this._moveStartHandler,delete this._moveEndHandler,delete this._resizeHandler,delete this._resizeTimeout}},u=a?t.ComponentView.extend(f):f;function v(e){(!a||5==n[0]&&n[1]<4)&&e.registerLayout((function(e){e.eachSeriesByType("pie",(function(e){var t=e.coordinateSystem,n=e.getData(),a=n.mapDimension("value");if(t&&t.type===o){var i=e.get("center"),r=t.dataToPoint(i),s=r[0],c=r[1];n.each(a,(function(e,t){var a=n.getItemLayout(t);a.cx=s,a.cy=c}))}}))})),a?e.registerComponentModel(d):e.extendComponentModel(d),a?e.registerComponentView(u):e.extendComponentView(u),e.registerCoordinateSystem(o,p),e.registerAction({type:o+"Roam",event:o+"Roam",update:"updateLayout"},(function(e,t){t.eachComponent(o,(function(e){var t=e.getAMap(),n=t.getCenter();e.setCenterAndZoom([n.lng,n.lat],t.getZoom())}))}))}a?t.use(v):v(t),e.name="echarts-extension-amap",e.version="1.12.0"})); //# sourceMappingURL=echarts-extension-amap.min.js.map diff --git a/dist/echarts-extension-amap.min.js.map b/dist/echarts-extension-amap.min.js.map index 2dfe47a..94355e7 100644 --- a/dist/echarts-extension-amap.min.js.map +++ b/dist/echarts-extension-amap.min.js.map @@ -1 +1 @@ -{"version":3,"file":"echarts-extension-amap.min.js","sources":["../src/helper.js","../src/AMapCoordSys.js","../src/AMapModel.js","../src/AMapView.js","../src/index.js","../index.js"],"sourcesContent":["import { version } from 'echarts/lib/echarts'\n\nexport const ecVer = version.split('.')\n\nexport const isNewEC = ecVer[0] > 4\n\n/* global AMap */\n\n// `AMap.version` only exists in AMap 2.x\n// For AMap 1.x, it's `AMap.v`\n// use function instead of constant to allow importing the plugin before AMap is loaded\nexport const isAMap2X = () => AMap.version >= 2\n\nexport function v2Equal(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1]\n}\n\nlet logMap = {}\n\nexport function logWarn(tag, msg, once) {\n const log = `[ECharts][Extension][AMap]${tag ? ' ' + tag + ':' : ''} ${msg}`\n once && logMap[log] || console.warn(log)\n once && (logMap[log] = true)\n}\n\nexport function clearLogMap() {\n logMap = {}\n}\n","import { util as zrUtil, graphic, matrix } from 'echarts/lib/echarts'\nimport { logWarn } from './helper'\n\nfunction dataToCoordSize(dataSize, dataItem) {\n dataItem = dataItem || [0, 0];\n return zrUtil.map(\n [0, 1],\n function(dimIdx) {\n const val = dataItem[dimIdx]\n const halfSize = dataSize[dimIdx] / 2\n const p1 = []\n const p2 = []\n p1[dimIdx] = val - halfSize\n p2[dimIdx] = val + halfSize\n p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx]\n return Math.abs(\n this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]\n )\n },\n this\n )\n}\n\n// exclude private and unsupported options\nconst excludedOptions = [\n 'echartsLayerZIndex', // DEPRECATED since v1.9.0\n 'echartsLayerInteractive',\n 'renderOnMoving',\n 'largeMode',\n 'returnMapCameraState',\n 'layers'\n]\n\nfunction AMapCoordSys(amap, api) {\n this._amap = amap\n this._api = api\n this._mapOffset = [0, 0]\n // this.dimensions = ['lng', 'lat']\n}\n\nconst AMapCoordSysProto = AMapCoordSys.prototype\n\nAMapCoordSysProto.setZoom = function(zoom) {\n this._zoom = zoom\n}\n\nAMapCoordSysProto.setCenter = function(center) {\n const lnglat = new AMap.LngLat(center[0], center[1])\n this._center = this._amap.lngLatToContainer(lnglat)\n}\n\nAMapCoordSysProto.setMapOffset = function(mapOffset) {\n this._mapOffset = mapOffset\n}\n\nAMapCoordSysProto.setAMap = function(amap) {\n this._amap = amap\n}\n\nAMapCoordSysProto.getAMap = function() {\n return this._amap\n}\n\nAMapCoordSysProto.dataToPoint = function(data) {\n const lnglat = new AMap.LngLat(data[0], data[1])\n const px = this._amap.lngLatToContainer(lnglat)\n const mapOffset = this._mapOffset\n return [px.x - mapOffset[0], px.y - mapOffset[1]]\n}\n\nAMapCoordSysProto.pointToData = function(pt) {\n const mapOffset = this._mapOffset\n const lnglat = this._amap.containerToLngLat(\n new AMap.Pixel(\n pt[0] + mapOffset[0],\n pt[1] + mapOffset[1]\n )\n )\n return [lnglat.lng, lnglat.lat]\n}\n\nAMapCoordSysProto.getViewRect = function() {\n const api = this._api\n return new graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight())\n}\n\nAMapCoordSysProto.getRoamTransform = function() {\n return matrix.create()\n}\n\nAMapCoordSysProto.prepareCustoms = function() {\n const rect = this.getViewRect()\n return {\n coordSys: {\n // The name exposed to user is always 'cartesian2d' but not 'grid'.\n type: 'amap',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n api: {\n coord: zrUtil.bind(this.dataToPoint, this),\n size: zrUtil.bind(dataToCoordSize, this)\n }\n }\n}\n\nAMapCoordSysProto.convertToPixel = function(ecModel, finder, value) {\n // here we don't use finder as only one amap component is allowed\n return this.dataToPoint(value);\n}\n\nAMapCoordSysProto.convertFromPixel = function(ecModel, finder, value) {\n // here we don't use finder as only one amap component is allowed\n return this.pointToData(value);\n}\n\n// less useful\n// AMapCoordSysProto.containPoint = function(point) {\n// return this._amap.getBounds().contains(this.pointToData(point));\n// }\n\nAMapCoordSys.create = function(ecModel, api) {\n let amapCoordSys\n ecModel.eachComponent('amap', function(amapModel) {\n if (typeof AMap === 'undefined') {\n throw new Error('AMap api is not loaded')\n }\n if (amapCoordSys) {\n throw new Error('Only one amap component is allowed')\n }\n let amap = amapModel.getAMap()\n const echartsLayerInteractive = amapModel.get('echartsLayerInteractive')\n if (!amap) {\n const root = api.getDom()\n const painter = api.getZr().painter\n const viewportRoot = painter.getViewportRoot()\n viewportRoot.className = 'amap-ec-layer'\n // PENDING not hidden?\n viewportRoot.style.visibility = 'hidden'\n // Not support IE8\n let amapRoot = root.querySelector('.ec-extension-amap')\n if (amapRoot) {\n // Reset viewport left and top, which will be changed\n // in moving handler in AMapView\n viewportRoot.style.left = '0px'\n viewportRoot.style.top = '0px'\n root.removeChild(amapRoot)\n }\n amapRoot = document.createElement('div')\n amapRoot.className = 'ec-extension-amap'\n amapRoot.style.cssText = 'position:absolute;top:0;left:0;bottom:0;right:0;'\n root.appendChild(amapRoot)\n\n const options = zrUtil.clone(amapModel.get())\n if ('echartsLayerZIndex' in options) {\n logWarn('DEPRECATED', 'the option `echartsLayerZIndex` has been removed since v1.9.0, use `echartsLayerInteractive` instead.')\n }\n // delete excluded options\n zrUtil.each(excludedOptions, function(key) {\n delete options[key]\n })\n\n amap = new AMap.Map(amapRoot, options)\n\n // PENDING: should update the model option when the user call map.setXXX?\n\n // const nativeSetMapStyle = amap.setMapStyle\n // const nativeSetLang = amap.setLang\n\n // // PENDING\n // amap.setMapStyle = function () {\n // nativeSetMapStyle.apply(this, arguments)\n // amapModel.__mapStyle = amap.getMapStyle()\n // }\n\n // // PENDING\n // nativeSetLang && (amap.setLang = function() {\n // nativeSetLang.apply(this, arguments)\n // amapModel.__mapLang = amap.getLang()\n // })\n\n // use `complete` callback to avoid NPE when first load amap\n amap.on('complete', function() {\n amapRoot.querySelector('.amap-maps').appendChild(viewportRoot)\n // PENDING\n viewportRoot.style.visibility = ''\n })\n\n amapModel.setAMap(amap)\n amapModel.setEChartsLayer(viewportRoot)\n\n // Override\n painter.getViewportRootOffset = function() {\n return { offsetLeft: 0, offsetTop: 0 }\n }\n }\n\n const oldEChartsLayerInteractive = amapModel.__echartsLayerInteractive\n if (oldEChartsLayerInteractive !== echartsLayerInteractive) {\n amapModel.setEChartsLayerInteractive(echartsLayerInteractive)\n amapModel.__echartsLayerInteractive = echartsLayerInteractive\n }\n\n const center = amapModel.get('center')\n const zoom = amapModel.get('zoom')\n if (center && zoom) {\n const amapCenter = amap.getCenter()\n const amapZoom = amap.getZoom()\n const centerOrZoomChanged = amapModel.centerOrZoomChanged(\n [amapCenter.lng, amapCenter.lat],\n amapZoom\n )\n if (centerOrZoomChanged) {\n amap.setZoomAndCenter(zoom, new AMap.LngLat(center[0], center[1]))\n }\n }\n\n // update map style(#13)\n const originalMapStyle = amapModel.__mapStyle\n const newMapStyle = amapModel.get('mapStyle')\n if (originalMapStyle !== newMapStyle) {\n amap.setMapStyle(amapModel.__mapStyle = newMapStyle)\n }\n\n // update map lang\n // PENDING: AMap 2.x does not support `setLang` yet\n if (amap.setLang) {\n const originalMapLang = amapModel.__mapLang\n const newMapLang = amapModel.get('lang')\n if (originalMapLang !== newMapLang) {\n amap.setLang(amapModel.__mapLang = newMapLang)\n }\n }\n else {\n logWarn('CAVEAT', 'The current map doesn\\'t support `setLang` API!', true)\n }\n\n amapCoordSys = new AMapCoordSys(amap, api)\n amapCoordSys.setMapOffset(amapModel.__mapOffset || [0, 0])\n amapCoordSys.setZoom(zoom)\n amapCoordSys.setCenter(center)\n\n amapModel.coordinateSystem = amapCoordSys\n })\n\n ecModel.eachSeries(function(seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'amap') {\n // inject coordinate system\n seriesModel.coordinateSystem = amapCoordSys\n }\n })\n\n // return created coordinate systems\n return amapCoordSys && [amapCoordSys]\n}\n\nAMapCoordSysProto.dimensions = AMapCoordSys.dimensions = ['lng', 'lat']\n\nAMapCoordSysProto.type = 'amap'\n\n\nexport default AMapCoordSys\n","import { ComponentModel } from 'echarts/lib/echarts'\nimport { isNewEC, v2Equal } from './helper'\n\nconst AMapModel = {\n type: 'amap',\n\n setAMap(amap) {\n this.__amap = amap\n },\n\n getAMap() {\n return this.__amap\n },\n\n setEChartsLayer(layer) {\n this.__echartsLayer = layer\n },\n\n getEChartsLayer() {\n return this.__echartsLayer\n },\n\n setEChartsLayerVisiblity(visible) {\n this.__echartsLayer.style.display = visible ? 'block' : 'none'\n },\n\n // FIXME: NOT SUPPORT <= IE 10\n setEChartsLayerInteractive(interactive) {\n this.option.echartsLayerInteractive = !!interactive\n this.__echartsLayer.style.pointerEvents = interactive ? 'auto' : 'none'\n },\n\n setCenterAndZoom(center, zoom) {\n this.option.center = center\n this.option.zoom = zoom\n },\n\n centerOrZoomChanged(center, zoom) {\n const option = this.option\n return !(v2Equal(center, option.center) && zoom === option.zoom)\n },\n\n defaultOption: {\n center: [116.397428, 39.90923],\n zoom: 5,\n isHotspot: false,\n resizeEnable: true,\n\n // extension specific options\n // echartsLayerZIndex: 2000, // DEPRECATED since v1.9.0\n echartsLayerInteractive: true,\n renderOnMoving: true,\n largeMode: false,\n // since v1.10.0\n returnMapCameraState: false\n }\n}\n\nexport default isNewEC\n ? ComponentModel.extend(AMapModel)\n : AMapModel\n","import { ComponentView, getInstanceByDom, throttle } from 'echarts/lib/echarts'\nimport { isNewEC, isAMap2X, clearLogMap } from './helper'\n\nlet _isAMap2X\n\nconst AMapView = {\n type: 'amap',\n\n init() {\n this._isFirstRender = true\n\n _isAMap2X = isAMap2X()\n },\n\n render(amapModel, ecModel, api) {\n let rendering = true\n\n const amap = amapModel.getAMap()\n const viewportRoot = api.getZr().painter.getViewportRoot()\n const offsetEl = amap.getContainer()\n const coordSys = amapModel.coordinateSystem\n\n const renderOnMoving = amapModel.get('renderOnMoving')\n const resizeEnable = amapModel.get('resizeEnable')\n const largeMode = amapModel.get('largeMode')\n const returnMapCameraState = amapModel.get('returnMapCameraState')\n\n const viewMode = amap.getViewMode_()\n const is3DMode = viewMode === '3D'\n\n let moveHandler = function(e) {\n if (rendering) {\n return\n }\n\n const offsetElStyle = offsetEl.style\n const mapOffset = [\n -parseInt(offsetElStyle.left, 10) || 0,\n -parseInt(offsetElStyle.top, 10) || 0\n ]\n // only update style when map offset changed\n const viewportRootStyle = viewportRoot.style\n const offsetLeft = mapOffset[0] + 'px'\n const offsetTop = mapOffset[1] + 'px'\n if (viewportRootStyle.left !== offsetLeft) {\n viewportRootStyle.left = offsetLeft\n }\n if (viewportRootStyle.top !== offsetTop) {\n viewportRootStyle.top = offsetTop\n }\n\n coordSys.setMapOffset(amapModel.__mapOffset = mapOffset)\n\n const actionParams = {\n type: 'amapRoam',\n animation: {\n // compatible with ECharts 5.x\n // no delay for rendering but remain animation of elements\n duration: 0\n }\n }\n\n if (returnMapCameraState) {\n e = e || {}\n let center = e.center\n if (!center) {\n // normalize center LngLat to Array\n center = amap.getCenter()\n center = [center.lng, center.lat]\n }\n actionParams.camera = {\n viewMode,\n center,\n zoom: e.zoom || amap.getZoom(),\n rotation: e.rotation == null ? amap.getRotation() : e.rotation,\n pitch: e.pitch == null ? amap.getPitch() : e.pitch,\n scale: amap.getScale(),\n bounds: amap.getBounds()\n }\n }\n\n api.dispatchAction(actionParams)\n }\n\n amap.off('mapmove', this._moveHandler)\n amap.off('moveend', this._moveHandler)\n amap.off('viewchange', this._moveHandler)\n amap.off('camerachange', this._moveHandler)\n amap.off('zoom', this._moveHandler)\n\n if (this._resizeHandler) {\n amap.off('resize', this._resizeHandler)\n }\n if (this._moveStartHandler) {\n amap.off('movestart', this._moveStartHandler)\n }\n if (this._moveEndHandler) {\n amap.off('moveend', this._moveEndHandler)\n amap.off('zoomend', this._moveEndHandler)\n }\n\n amap.on(\n renderOnMoving\n ? (_isAMap2X\n ? 'viewchange'\n : is3DMode\n ? 'camerachange'\n : 'mapmove')\n : 'moveend',\n // FIXME: bad performance in 1.x in the cases with large data, use debounce?\n // moveHandler\n (!_isAMap2X && largeMode) ? (moveHandler = throttle(moveHandler, 20, true)) : moveHandler\n )\n\n this._moveHandler = moveHandler\n\n if (renderOnMoving && !(_isAMap2X && is3DMode)) {\n // need to listen to zoom if 1.x & 2D mode\n // FIXME: unnecessary `mapmove` event triggered when zooming\n amap.on('zoom', moveHandler)\n }\n\n if (!renderOnMoving) {\n amap.on('movestart', this._moveStartHandler = function() {\n setTimeout(function() {\n amapModel.setEChartsLayerVisiblity(false)\n }, 0)\n })\n const moveEndHandler = this._moveEndHandler = function(e) {\n ;(!e || e.type !== 'moveend') && moveHandler(e)\n setTimeout(function() {\n amapModel.setEChartsLayerVisiblity(true)\n }, _isAMap2X || !largeMode ? 0 : 20)\n }\n amap.on('moveend', moveEndHandler)\n amap.on('zoomend', moveEndHandler)\n if (this._isFirstRender && is3DMode) {\n // FIXME: not rewrite AMap instance method\n const nativeSetPicth = amap.setPitch\n const nativeSetRotation = amap.setRotation\n amap.setPitch = function() {\n nativeSetPicth.apply(this, arguments)\n moveEndHandler()\n }\n amap.setRotation = function() {\n nativeSetRotation.apply(this, arguments)\n moveEndHandler()\n }\n }\n }\n\n if (resizeEnable) {\n let resizeHandler = function() {\n getInstanceByDom(api.getDom()).resize()\n }\n if (!_isAMap2X && largeMode) {\n resizeHandler = throttle(resizeHandler, 20, true)\n }\n amap.on('resize', this._resizeHandler = resizeHandler)\n }\n\n this._isFirstRender = rendering = false\n },\n\n dispose() {\n clearLogMap()\n const component = this.__model\n if (component) {\n component.getAMap().destroy()\n component.setAMap(null)\n component.setEChartsLayer(null)\n if (component.coordinateSystem) {\n component.coordinateSystem.setAMap(null)\n component.coordinateSystem = null\n }\n delete this._moveHandler\n delete this._resizeHandler\n delete this._moveStartHandler\n delete this._moveEndHandler\n }\n }\n}\n\nexport default isNewEC\n ? ComponentView.extend(AMapView)\n : AMapView\n","/**\n * AMap component extension\n */\n\nimport AMapCoordSys from './AMapCoordSys'\nimport AMapModel from './AMapModel'\nimport AMapView from './AMapView'\nimport { isNewEC, ecVer } from './helper'\n\nexport { version, name } from '../package.json'\n\n/**\n * @typedef {import('../export').EChartsExtensionRegisters} EChartsExtensionRegisters\n */\n\n/**\n * AMap extension installer\n * @param {EChartsExtensionRegisters} registers\n */\nexport function install(registers) {\n // add coordinate system support for pie series for ECharts < 5.4.0\n if (!isNewEC || (ecVer[0] == 5 && ecVer[1] < 4)) {\n registers.registerLayout(function(ecModel, api) {\n ecModel.eachSeriesByType('pie', function (seriesModel) {\n const coordSys = seriesModel.coordinateSystem\n const data = seriesModel.getData()\n const valueDim = data.mapDimension('value')\n if (coordSys && coordSys.type === 'amap') {\n const center = seriesModel.get('center')\n const point = coordSys.dataToPoint(center)\n const cx = point[0]\n const cy = point[1]\n data.each(valueDim, function (value, idx) {\n const layout = data.getItemLayout(idx)\n layout.cx = cx\n layout.cy = cy\n })\n }\n })\n })\n }\n // Model\n isNewEC\n ? registers.registerComponentModel(AMapModel)\n : registers.extendComponentModel(AMapModel)\n // View\n isNewEC\n ? registers.registerComponentView(AMapView)\n : registers.extendComponentView(AMapView)\n // Coordinate System\n registers.registerCoordinateSystem('amap', AMapCoordSys)\n // Action\n registers.registerAction(\n {\n type: 'amapRoam',\n event: 'amapRoam',\n update: 'updateLayout'\n },\n function(payload, ecModel) {\n ecModel.eachComponent('amap', function(amapModel) {\n const amap = amapModel.getAMap()\n const center = amap.getCenter()\n amapModel.setCenterAndZoom([center.lng, center.lat], amap.getZoom())\n })\n }\n )\n}\n","/**\n * TODO use `echarts/core` rather than `echarts/lib/echarts`\n * to avoid self-registered `CanvasRenderer` and `DataSetComponent` in Apache ECharts 5\n * but it's not compatible with echarts v4. Leave it to 2.0.\n */\nimport * as echarts from 'echarts/lib/echarts'\nimport { install } from './src/index'\nimport { isNewEC } from './src/helper'\n\nisNewEC ? echarts.use(install) : install(echarts)\n\nexport { name, version } from './src/index'\n"],"names":["ecVer","version","split","isNewEC","logMap","logWarn","tag","msg","once","log","concat","console","warn","dataToCoordSize","dataSize","dataItem","zrUtil","map","dimIdx","val","halfSize","p1","p2","Math","abs","this","dataToPoint","excludedOptions","AMapCoordSys","amap","api","_amap","_api","_mapOffset","AMapCoordSysProto","prototype","setZoom","zoom","_zoom","setCenter","center","lnglat","AMap","LngLat","_center","lngLatToContainer","setMapOffset","mapOffset","setAMap","getAMap","data","px","x","y","pointToData","pt","containerToLngLat","Pixel","lng","lat","getViewRect","graphic","BoundingRect","getWidth","getHeight","getRoamTransform","matrix","create","prepareCustoms","rect","coordSys","type","width","height","coord","bind","size","util","convertToPixel","ecModel","finder","value","convertFromPixel","amapCoordSys","eachComponent","amapModel","Error","echartsLayerInteractive","get","root","getDom","painter","getZr","viewportRoot","getViewportRoot","className","style","visibility","amapRoot","querySelector","left","top","removeChild","document","createElement","cssText","appendChild","options","clone","each","key","Map","on","setEChartsLayer","getViewportRootOffset","offsetLeft","offsetTop","__echartsLayerInteractive","setEChartsLayerInteractive","amapCenter","getCenter","amapZoom","getZoom","centerOrZoomChanged","setZoomAndCenter","originalMapStyle","__mapStyle","newMapStyle","setMapStyle","setLang","originalMapLang","__mapLang","newMapLang","__mapOffset","coordinateSystem","eachSeries","seriesModel","dimensions","_isAMap2X","AMapModel","__amap","layer","__echartsLayer","getEChartsLayer","setEChartsLayerVisiblity","visible","display","interactive","option","pointerEvents","setCenterAndZoom","a","b","defaultOption","isHotspot","resizeEnable","renderOnMoving","largeMode","returnMapCameraState","ComponentModel","extend","AMapView","init","_isFirstRender","render","rendering","offsetEl","getContainer","viewMode","getViewMode_","is3DMode","moveHandler","e","offsetElStyle","parseInt","viewportRootStyle","actionParams","animation","duration","camera","rotation","getRotation","pitch","getPitch","scale","getScale","bounds","getBounds","dispatchAction","off","_moveHandler","_resizeHandler","_moveStartHandler","_moveEndHandler","throttle","setTimeout","moveEndHandler","nativeSetPicth","setPitch","nativeSetRotation","setRotation","apply","arguments","resizeHandler","getInstanceByDom","resize","dispose","component","__model","destroy","ComponentView","install","registers","registerLayout","eachSeriesByType","getData","valueDim","mapDimension","point","cx","cy","idx","layout","getItemLayout","registerComponentModel","extendComponentModel","registerComponentView","extendComponentView","registerCoordinateSystem","registerAction","event","update","payload","echarts","use"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;+UAEO,IAAMA,EAAQC,EAAOA,QAACC,MAAM,KAEtBC,EAAUH,EAAM,GAAK,EAalC,IAAII,EAAS,CAAA,EAEN,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,GACxC,IAAMlE,EAAWkE,EAAYF,iBACvBpF,EAAOsF,EAAY+E,UACnBC,EAAWtK,EAAKuK,aAAa,SACnC,GAAInJ,GAA8B,SAAlBA,EAASC,KAAiB,CACxC,IAAM/B,EAASgG,EAAYhD,IAAI,UACzBkI,EAAQpJ,EAAS5C,YAAYc,GAC7BmL,EAAKD,EAAM,GACXE,EAAKF,EAAM,GACjBxK,EAAK2D,KAAK2G,GAAU,SAAUvI,EAAO4I,GACnC,IAAMC,EAAS5K,EAAK6K,cAAcF,GAClCC,EAAOH,GAAKA,EACZG,EAAOF,GAAKA,IAEf,QAKPzN,EACIiN,EAAUY,uBAAuBrF,GACjCyE,EAAUa,qBAAqBtF,GAEnCxI,EACIiN,EAAUc,sBAAsBjE,GAChCmD,EAAUe,oBAAoBlE,GAElCmD,EAAUgB,yBAAyB,OAAQxM,GAE3CwL,EAAUiB,eACR,CACE9J,KAAM,WACN+J,MAAO,WACPC,OAAQ,iBAEV,SAASC,EAASzJ,GAChBA,EAAQK,cAAc,QAAQ,SAASC,GACrC,IAAMxD,EAAOwD,EAAUpC,UACjBT,EAASX,EAAK2F,YACpBnC,EAAUiE,iBAAiB,CAAC9G,EAAOkB,IAAKlB,EAAOmB,KAAM9B,EAAK6F,gBAIjE,CCzDDvH,EAAUsO,EAAQC,IAAIvB,GAAWA,EAAQsB"} \ No newline at end of file +{"version":3,"file":"echarts-extension-amap.min.js","sources":["../src/helper.js","../src/AMapCoordSys.js","../src/AMapModel.js","../src/AMapView.js","../src/index.js","../index.js"],"sourcesContent":["import { version } from 'echarts/lib/echarts'\n\nexport const ecVer = version.split('.')\n\nexport const isNewEC = ecVer[0] > 4\n\nexport const COMPONENT_TYPE = 'amap'\n\n/* global AMap */\n\n// The version property is `AMap.v` in AMap 1.x,\n// but `AMap.version` may also exist (See #51)\n// In AMap 2.x, it's `AMap.version` (Not sure if `AMap.v` exists)\n// use function instead of constant to allow importing the plugin before AMap is loaded\nexport const isAMap2X = () => !AMap.v && AMap.version && AMap.version.split('.')[0] >= 2\n\nexport function v2Equal(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1]\n}\n\nlet logMap = {}\n\nexport function logWarn(tag, msg, once) {\n const log = `[ECharts][Extension][AMap]${tag ? ' ' + tag + ':' : ''} ${msg}`\n once && logMap[log] || console.warn(log)\n once && (logMap[log] = true)\n}\n\nexport function clearLogMap() {\n logMap = {}\n}\n","import { util as zrUtil, graphic, matrix } from 'echarts/lib/echarts'\nimport { COMPONENT_TYPE, logWarn } from './helper'\n\nfunction dataToCoordSize(dataSize, dataItem) {\n dataItem = dataItem || [0, 0];\n return zrUtil.map(\n [0, 1],\n function(dimIdx) {\n const val = dataItem[dimIdx]\n const halfSize = dataSize[dimIdx] / 2\n const p1 = []\n const p2 = []\n p1[dimIdx] = val - halfSize\n p2[dimIdx] = val + halfSize\n p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx]\n return Math.abs(\n this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]\n )\n },\n this\n )\n}\n\n// exclude private and unsupported options\nconst excludedOptions = [\n 'echartsLayerZIndex', // DEPRECATED since v1.9.0\n 'echartsLayerInteractive',\n 'renderOnMoving',\n 'largeMode',\n 'returnMapCameraState',\n 'layers'\n]\n\nfunction AMapCoordSys(amap, api) {\n this._amap = amap\n this._api = api\n this._mapOffset = [0, 0]\n // this.dimensions = ['lng', 'lat']\n}\n\nconst AMapCoordSysProto = AMapCoordSys.prototype\n\nAMapCoordSysProto.setZoom = function(zoom) {\n this._zoom = zoom\n}\n\nAMapCoordSysProto.setCenter = function(center) {\n const lnglat = new AMap.LngLat(center[0], center[1])\n this._center = this._amap.lngLatToContainer(lnglat)\n}\n\nAMapCoordSysProto.setMapOffset = function(mapOffset) {\n this._mapOffset = mapOffset\n}\n\nAMapCoordSysProto.setAMap = function(amap) {\n this._amap = amap\n}\n\nAMapCoordSysProto.getAMap = function() {\n return this._amap\n}\n\nAMapCoordSysProto.dataToPoint = function(data) {\n const lnglat = new AMap.LngLat(data[0], data[1])\n const px = this._amap.lngLatToContainer(lnglat)\n const mapOffset = this._mapOffset\n return [px.x - mapOffset[0], px.y - mapOffset[1]]\n}\n\nAMapCoordSysProto.pointToData = function(pt) {\n const mapOffset = this._mapOffset\n const lnglat = this._amap.containerToLngLat(\n new AMap.Pixel(\n pt[0] + mapOffset[0],\n pt[1] + mapOffset[1]\n )\n )\n return [lnglat.lng, lnglat.lat]\n}\n\nAMapCoordSysProto.getViewRect = function() {\n const api = this._api\n return new graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight())\n}\n\nAMapCoordSysProto.getRoamTransform = function() {\n return matrix.create()\n}\n\nAMapCoordSysProto.prepareCustoms = function() {\n const rect = this.getViewRect()\n return {\n coordSys: {\n type: COMPONENT_TYPE,\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n api: {\n coord: zrUtil.bind(this.dataToPoint, this),\n size: zrUtil.bind(dataToCoordSize, this)\n }\n }\n}\n\nAMapCoordSysProto.convertToPixel = function(ecModel, finder, value) {\n // here we don't use finder as only one amap component is allowed\n return this.dataToPoint(value);\n}\n\nAMapCoordSysProto.convertFromPixel = function(ecModel, finder, value) {\n // here we don't use finder as only one amap component is allowed\n return this.pointToData(value);\n}\n\n// less useful\n// AMapCoordSysProto.containPoint = function(point) {\n// return this._amap.getBounds().contains(this.pointToData(point));\n// }\n\nAMapCoordSys.create = function(ecModel, api) {\n let amapCoordSys\n ecModel.eachComponent(COMPONENT_TYPE, function(amapModel) {\n if (typeof AMap === 'undefined') {\n throw new Error('AMap api is not loaded')\n }\n if (amapCoordSys) {\n throw new Error('Only one amap component is allowed')\n }\n let amap = amapModel.getAMap()\n const echartsLayerInteractive = amapModel.get('echartsLayerInteractive')\n if (!amap) {\n const root = api.getDom()\n const painter = api.getZr().painter\n const viewportRoot = painter.getViewportRoot()\n viewportRoot.className = COMPONENT_TYPE + '-ec-layer'\n // PENDING not hidden?\n viewportRoot.style.visibility = 'hidden'\n const className = 'ec-extension-' + COMPONENT_TYPE\n // Not support IE8\n let amapRoot = root.querySelector('.' + className)\n if (amapRoot) {\n // Reset viewport left and top, which will be changed\n // in moving handler in AMapView\n viewportRoot.style.left = '0px'\n viewportRoot.style.top = '0px'\n root.removeChild(amapRoot)\n }\n amapRoot = document.createElement('div')\n amapRoot.className = className\n amapRoot.style.cssText = 'position:absolute;top:0;left:0;bottom:0;right:0;'\n root.appendChild(amapRoot)\n\n const options = zrUtil.clone(amapModel.get())\n if ('echartsLayerZIndex' in options) {\n logWarn('DEPRECATED', 'the option `echartsLayerZIndex` has been removed since v1.9.0, use `echartsLayerInteractive` instead.')\n }\n // delete excluded options\n zrUtil.each(excludedOptions, function(key) {\n delete options[key]\n })\n\n amap = new AMap.Map(amapRoot, options)\n\n // PENDING: should update the model option when the user call map.setXXX?\n\n // const nativeSetMapStyle = amap.setMapStyle\n // const nativeSetLang = amap.setLang\n\n // // PENDING\n // amap.setMapStyle = function () {\n // nativeSetMapStyle.apply(this, arguments)\n // amapModel.__mapStyle = amap.getMapStyle()\n // }\n\n // // PENDING\n // nativeSetLang && (amap.setLang = function() {\n // nativeSetLang.apply(this, arguments)\n // amapModel.__mapLang = amap.getLang()\n // })\n\n // use `complete` callback to avoid NPE when first load amap\n amap.on('complete', function() {\n amapRoot.querySelector('.amap-maps').appendChild(viewportRoot)\n // PENDING\n viewportRoot.style.visibility = ''\n })\n\n amapModel.setAMap(amap)\n amapModel.setEChartsLayer(viewportRoot)\n\n // Override\n painter.getViewportRootOffset = function() {\n return { offsetLeft: 0, offsetTop: 0 }\n }\n }\n\n const oldEChartsLayerInteractive = amapModel.__echartsLayerInteractive\n if (oldEChartsLayerInteractive !== echartsLayerInteractive) {\n amapModel.setEChartsLayerInteractive(echartsLayerInteractive)\n amapModel.__echartsLayerInteractive = echartsLayerInteractive\n }\n\n const center = amapModel.get('center')\n const zoom = amapModel.get('zoom')\n if (center && zoom) {\n const amapCenter = amap.getCenter()\n const amapZoom = amap.getZoom()\n const centerOrZoomChanged = amapModel.centerOrZoomChanged(\n [amapCenter.lng, amapCenter.lat],\n amapZoom\n )\n if (centerOrZoomChanged) {\n amap.setZoomAndCenter(zoom, new AMap.LngLat(center[0], center[1]))\n }\n }\n\n // update map style(#13)\n const originalMapStyle = amapModel.__mapStyle\n const newMapStyle = amapModel.get('mapStyle')\n if (originalMapStyle !== newMapStyle) {\n amap.setMapStyle(amapModel.__mapStyle = newMapStyle)\n }\n\n // update map lang\n // PENDING: AMap 2.x does not support `setLang` yet\n if (amap.setLang) {\n const originalMapLang = amapModel.__mapLang\n const newMapLang = amapModel.get('lang')\n if (originalMapLang !== newMapLang) {\n amap.setLang(amapModel.__mapLang = newMapLang)\n }\n }\n else {\n logWarn('CAVEAT', 'The current map doesn\\'t support `setLang` API!', true)\n }\n\n amapCoordSys = new AMapCoordSys(amap, api)\n amapCoordSys.setMapOffset(amapModel.__mapOffset || [0, 0])\n amapCoordSys.setZoom(zoom)\n amapCoordSys.setCenter(center)\n\n amapModel.coordinateSystem = amapCoordSys\n })\n\n ecModel.eachSeries(function(seriesModel) {\n if (seriesModel.get('coordinateSystem') === COMPONENT_TYPE) {\n // inject coordinate system\n seriesModel.coordinateSystem = amapCoordSys\n }\n })\n\n // return created coordinate systems\n return amapCoordSys && [amapCoordSys]\n}\n\nAMapCoordSysProto.dimensions = AMapCoordSys.dimensions = ['lng', 'lat']\n\nAMapCoordSysProto.type = COMPONENT_TYPE\n\n\nexport default AMapCoordSys\n","import { ComponentModel } from 'echarts/lib/echarts'\nimport { COMPONENT_TYPE, isNewEC, v2Equal } from './helper'\n\nconst AMapModel = {\n type: COMPONENT_TYPE,\n\n setAMap(amap) {\n this.__amap = amap\n },\n\n getAMap() {\n return this.__amap\n },\n\n setEChartsLayer(layer) {\n this.__echartsLayer = layer\n },\n\n getEChartsLayer() {\n return this.__echartsLayer\n },\n\n setEChartsLayerVisibility(visible) {\n this.__echartsLayer.style.display = visible ? 'block' : 'none'\n },\n\n // FIXME: NOT SUPPORT <= IE 10\n setEChartsLayerInteractive(interactive) {\n this.option.echartsLayerInteractive = !!interactive\n this.__echartsLayer.style.pointerEvents = interactive ? 'auto' : 'none'\n },\n\n setCenterAndZoom(center, zoom) {\n this.option.center = center\n this.option.zoom = zoom\n },\n\n centerOrZoomChanged(center, zoom) {\n const option = this.option\n return !(v2Equal(center, option.center) && zoom === option.zoom)\n },\n\n defaultOption: {\n center: [116.397428, 39.90923],\n zoom: 5,\n isHotspot: false,\n resizeEnable: true,\n\n // extension specific options\n // echartsLayerZIndex: 2000, // DEPRECATED since v1.9.0\n echartsLayerInteractive: true,\n renderOnMoving: true,\n largeMode: false,\n // since v1.10.0\n returnMapCameraState: false\n }\n}\n\nexport default isNewEC\n ? ComponentModel.extend(AMapModel)\n : AMapModel\n","import { ComponentView, getInstanceByDom, throttle } from 'echarts/lib/echarts'\nimport { COMPONENT_TYPE, isNewEC, isAMap2X, clearLogMap } from './helper'\n\nlet _isAMap2X\n\nconst AMapView = {\n type: COMPONENT_TYPE,\n\n init() {\n this._isFirstRender = true\n\n _isAMap2X = isAMap2X()\n },\n\n render(amapModel, ecModel, api) {\n let rendering = true\n\n const amap = amapModel.getAMap()\n const viewportRoot = api.getZr().painter.getViewportRoot()\n const offsetEl = amap.getContainer()\n const coordSys = amapModel.coordinateSystem\n\n const renderOnMoving = amapModel.get('renderOnMoving')\n const resizeEnable = amapModel.get('resizeEnable')\n const largeMode = amapModel.get('largeMode')\n const returnMapCameraState = amapModel.get('returnMapCameraState')\n\n const viewMode = amap.getViewMode_()\n const is3DMode = viewMode === '3D'\n\n let moveHandler = function(e) {\n if (rendering) {\n return\n }\n\n const offsetElStyle = offsetEl.style\n const mapOffset = [\n -parseInt(offsetElStyle.left, 10) || 0,\n -parseInt(offsetElStyle.top, 10) || 0\n ]\n // only update style when map offset changed\n const viewportRootStyle = viewportRoot.style\n const offsetLeft = mapOffset[0] + 'px'\n const offsetTop = mapOffset[1] + 'px'\n if (viewportRootStyle.left !== offsetLeft) {\n viewportRootStyle.left = offsetLeft\n }\n if (viewportRootStyle.top !== offsetTop) {\n viewportRootStyle.top = offsetTop\n }\n\n coordSys.setMapOffset(amapModel.__mapOffset = mapOffset)\n\n const actionParams = {\n type: 'amapRoam',\n animation: {\n // compatible with ECharts 5.x\n // no delay for rendering but remain animation of elements\n duration: 0\n }\n }\n\n if (returnMapCameraState) {\n e = e || {}\n let center = e.center\n if (!center) {\n // normalize center LngLat to Array\n center = amap.getCenter()\n center = [center.lng, center.lat]\n }\n actionParams.camera = {\n viewMode,\n center,\n zoom: e.zoom || amap.getZoom(),\n rotation: e.rotation == null ? amap.getRotation() : e.rotation,\n pitch: e.pitch == null ? amap.getPitch() : e.pitch,\n scale: amap.getScale(),\n bounds: amap.getBounds()\n }\n }\n\n api.dispatchAction(actionParams)\n }\n\n amap.off('mapmove', this._moveHandler)\n amap.off('moveend', this._moveHandler)\n amap.off('viewchange', this._moveHandler)\n amap.off('camerachange', this._moveHandler)\n amap.off('zoom', this._moveHandler)\n\n if (this._resizeHandler) {\n amap.off('resize', this._resizeHandler)\n }\n if (this._moveStartHandler) {\n amap.off('movestart', this._moveStartHandler)\n }\n if (this._moveEndHandler) {\n amap.off('moveend', this._moveEndHandler)\n amap.off('zoomend', this._moveEndHandler)\n }\n\n amap.on(\n renderOnMoving\n ? (_isAMap2X\n ? 'viewchange'\n : is3DMode\n ? 'camerachange'\n : 'mapmove')\n : 'moveend',\n // FIXME: bad performance in 1.x in the cases with large data, use debounce?\n // moveHandler\n (!_isAMap2X && largeMode) ? (moveHandler = throttle(moveHandler, 20, true)) : moveHandler\n )\n\n this._moveHandler = moveHandler\n\n if (renderOnMoving && !(_isAMap2X && is3DMode)) {\n // need to listen to zoom if 1.x & 2D mode\n // FIXME: unnecessary `mapmove` event triggered when zooming\n amap.on('zoom', moveHandler)\n }\n\n if (!renderOnMoving) {\n amap.on('movestart', this._moveStartHandler = function() {\n setTimeout(function() {\n amapModel.setEChartsLayerVisibility(false)\n }, 0)\n })\n const moveEndHandler = this._moveEndHandler = function(e) {\n ;(!e || e.type !== 'moveend') && moveHandler(e)\n setTimeout(function() {\n amapModel.setEChartsLayerVisibility(true)\n }, _isAMap2X || !largeMode ? 0 : 20)\n }\n amap.on('moveend', moveEndHandler)\n amap.on('zoomend', moveEndHandler)\n if (this._isFirstRender && is3DMode) {\n // FIXME: not rewrite AMap instance method\n const nativeSetPitch = amap.setPitch\n const nativeSetRotation = amap.setRotation\n amap.setPitch = function() {\n nativeSetPitch.apply(this, arguments)\n moveEndHandler()\n }\n amap.setRotation = function() {\n nativeSetRotation.apply(this, arguments)\n moveEndHandler()\n }\n }\n }\n\n if (resizeEnable) {\n let resizeHandler = () => {\n clearTimeout(this._resizeTimeout)\n this._resizeTimeout = setTimeout(() => getInstanceByDom(api.getDom()).resize(), 0)\n }\n if (!_isAMap2X && largeMode) {\n resizeHandler = throttle(resizeHandler, 20, true)\n }\n amap.on('resize', this._resizeHandler = resizeHandler)\n }\n\n this._isFirstRender = rendering = false\n },\n\n dispose() {\n clearTimeout(this._resizeTimeout)\n clearLogMap()\n const component = this.__model\n if (component) {\n component.getAMap().destroy()\n component.setAMap(null)\n component.setEChartsLayer(null)\n if (component.coordinateSystem) {\n component.coordinateSystem.setAMap(null)\n component.coordinateSystem = null\n }\n }\n delete this._moveHandler\n delete this._moveStartHandler\n delete this._moveEndHandler\n delete this._resizeHandler\n delete this._resizeTimeout\n }\n}\n\nexport default isNewEC\n ? ComponentView.extend(AMapView)\n : AMapView\n","/**\n * AMap component extension\n */\n\nimport AMapCoordSys from './AMapCoordSys'\nimport AMapModel from './AMapModel'\nimport AMapView from './AMapView'\nimport { isNewEC, ecVer, COMPONENT_TYPE } from './helper'\n\nexport { version, name } from '../package.json'\n\n/**\n * @typedef {import('../export').EChartsExtensionRegisters} EChartsExtensionRegisters\n */\n\n/**\n * AMap extension installer\n * @param {EChartsExtensionRegisters} registers\n */\nexport function install(registers) {\n // add coordinate system support for pie series for ECharts < 5.4.0\n if (!isNewEC || (ecVer[0] == 5 && ecVer[1] < 4)) {\n registers.registerLayout(function(ecModel) {\n ecModel.eachSeriesByType('pie', function (seriesModel) {\n const coordSys = seriesModel.coordinateSystem\n const data = seriesModel.getData()\n const valueDim = data.mapDimension('value')\n if (coordSys && coordSys.type === COMPONENT_TYPE) {\n const center = seriesModel.get('center')\n const point = coordSys.dataToPoint(center)\n const cx = point[0]\n const cy = point[1]\n data.each(valueDim, function (value, idx) {\n const layout = data.getItemLayout(idx)\n layout.cx = cx\n layout.cy = cy\n })\n }\n })\n })\n }\n // Model\n isNewEC\n ? registers.registerComponentModel(AMapModel)\n : registers.extendComponentModel(AMapModel)\n // View\n isNewEC\n ? registers.registerComponentView(AMapView)\n : registers.extendComponentView(AMapView)\n // Coordinate System\n registers.registerCoordinateSystem(COMPONENT_TYPE, AMapCoordSys)\n // Action\n registers.registerAction(\n {\n type: COMPONENT_TYPE + 'Roam',\n event: COMPONENT_TYPE + 'Roam',\n update: 'updateLayout'\n },\n function(payload, ecModel) {\n ecModel.eachComponent(COMPONENT_TYPE, function(amapModel) {\n const amap = amapModel.getAMap()\n const center = amap.getCenter()\n amapModel.setCenterAndZoom([center.lng, center.lat], amap.getZoom())\n })\n }\n )\n}\n","/**\n * TODO use `echarts/core` rather than `echarts/lib/echarts`\n * to avoid self-registered `CanvasRenderer` and `DataSetComponent` in Apache ECharts 5\n * but it's not compatible with echarts v4. Leave it to 2.0.\n */\nimport * as echarts from 'echarts/lib/echarts'\nimport { install } from './src/index'\nimport { isNewEC } from './src/helper'\n\nisNewEC ? echarts.use(install) : install(echarts)\n\nexport { name, version } from './src/index'\n"],"names":["ecVer","version","split","isNewEC","COMPONENT_TYPE","logMap","logWarn","tag","msg","once","log","concat","console","warn","dataToCoordSize","dataSize","dataItem","zrUtil","map","dimIdx","val","halfSize","p1","p2","Math","abs","this","dataToPoint","excludedOptions","AMapCoordSys","amap","api","_amap","_api","_mapOffset","AMapCoordSysProto","prototype","setZoom","zoom","_zoom","setCenter","center","lnglat","AMap","LngLat","_center","lngLatToContainer","setMapOffset","mapOffset","setAMap","getAMap","data","px","x","y","pointToData","pt","containerToLngLat","Pixel","lng","lat","getViewRect","graphic","BoundingRect","getWidth","getHeight","getRoamTransform","matrix","create","prepareCustoms","rect","coordSys","type","width","height","coord","bind","size","util","convertToPixel","ecModel","finder","value","convertFromPixel","amapCoordSys","eachComponent","amapModel","Error","echartsLayerInteractive","get","root","getDom","painter","getZr","viewportRoot","getViewportRoot","className","style","visibility","amapRoot","querySelector","left","top","removeChild","document","createElement","cssText","appendChild","options","clone","each","key","Map","on","setEChartsLayer","getViewportRootOffset","offsetLeft","offsetTop","__echartsLayerInteractive","setEChartsLayerInteractive","amapCenter","getCenter","amapZoom","getZoom","centerOrZoomChanged","setZoomAndCenter","originalMapStyle","__mapStyle","newMapStyle","setMapStyle","setLang","originalMapLang","__mapLang","newMapLang","__mapOffset","coordinateSystem","eachSeries","seriesModel","dimensions","_isAMap2X","AMapModel","__amap","layer","__echartsLayer","getEChartsLayer","setEChartsLayerVisibility","visible","display","interactive","option","pointerEvents","setCenterAndZoom","a","b","defaultOption","isHotspot","resizeEnable","renderOnMoving","largeMode","returnMapCameraState","ComponentModel","extend","AMapView","init","_isFirstRender","v","render","_this","rendering","offsetEl","getContainer","viewMode","getViewMode_","is3DMode","moveHandler","e","offsetElStyle","parseInt","viewportRootStyle","actionParams","animation","duration","camera","rotation","getRotation","pitch","getPitch","scale","getScale","bounds","getBounds","dispatchAction","off","_moveHandler","_resizeHandler","_moveStartHandler","_moveEndHandler","throttle","setTimeout","moveEndHandler","nativeSetPitch","setPitch","nativeSetRotation","setRotation","apply","arguments","resizeHandler","clearTimeout","_resizeTimeout","getInstanceByDom","resize","dispose","component","__model","destroy","ComponentView","install","registers","registerLayout","eachSeriesByType","getData","valueDim","mapDimension","point","cx","cy","idx","layout","getItemLayout","registerComponentModel","extendComponentModel","registerComponentView","extendComponentView","registerCoordinateSystem","registerAction","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zDAxH,EAAU2O,EAAQC,IAAIvB,GAAWA,EAAQsB"} \ No newline at end of file diff --git a/examples/heatmap.html b/examples/heatmap.html index 25fb19f..aa14a48 100644 --- a/examples/heatmap.html +++ b/examples/heatmap.html @@ -14,7 +14,7 @@ - +