From 25f634457295834c87dd8bbd18c4c7aaf07b219d Mon Sep 17 00:00:00 2001 From: plainheart Date: Wed, 18 Sep 2024 09:58:45 +0800 Subject: [PATCH] release: v1.7.0 --- build/header.js | 4 ++-- dist/echarts-extension-gmap.cjs.js | 11 +++++++---- dist/echarts-extension-gmap.esm.js | 11 +++++++---- dist/echarts-extension-gmap.js | 11 +++++++---- dist/echarts-extension-gmap.js.map | 2 +- dist/echarts-extension-gmap.min.js | 6 +++--- dist/echarts-extension-gmap.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 +- src/GMapView.js | 2 +- src/index.js | 8 ++++---- types.d.ts | 2 +- 20 files changed, 45 insertions(+), 36 deletions(-) diff --git a/build/header.js b/build/header.js index aeb9eb0..da29255 100644 --- a/build/header.js +++ b/build/header.js @@ -1,5 +1,5 @@ -const fs = require('fs') -const path = require('path') +const fs = require('node:fs') +const path = require('node:path') const { name, version, author } = require('../package.json') const COMMENT_END_REGEX = /\*\//g diff --git a/dist/echarts-extension-gmap.cjs.js b/dist/echarts-extension-gmap.cjs.js index 22afcaa..d6515f4 100644 --- a/dist/echarts-extension-gmap.cjs.js +++ b/dist/echarts-extension-gmap.cjs.js @@ -1,11 +1,11 @@ /*! * echarts-extension-gmap - * @version 1.6.0 + * @version 1.7.0 * @author plainheart * * MIT License * - * Copyright (c) 2020-2022 Zhongxiang Wang + * Copyright (c) 2020-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 @@ -38,6 +38,7 @@ function v2Equal(a, b) { } /* global google */ + function dataToCoordSize(dataSize, dataItem) { dataItem = dataItem || [0, 0]; return echarts.util.map([0, 1], function (dimIdx) { @@ -298,6 +299,7 @@ var GMapModel = { var GMapModel$1 = isNewEC ? echarts.ComponentModel.extend(GMapModel) : GMapModel; /* global google */ + var GMapView = { type: COMPONENT_TYPE, render: function render(gmapModel, ecModel, api) { @@ -350,7 +352,7 @@ var GMapView = { } this._renderHandler = google.maps.event.addListener(gmap, renderOnMoving ? 'gmaprender' : 'idle', renderHandler); gmap.setOptions({ - gestureHandling: gmapModel.get('roam') ? 'auto' : 'none' + gestureHandling: gmapModel.get('roam') ? gmapModel.get('gestureHandling') || 'auto' : 'none' }); rendering = false; }, @@ -384,12 +386,13 @@ var GMapView = { var GMapView$1 = isNewEC ? echarts.ComponentView.extend(GMapView) : GMapView; var name = "echarts-extension-gmap"; -var version = "1.6.0"; +var version = "1.7.0"; /** * Google Map component extension */ + /** * @typedef {import('../export').EChartsExtensionRegisters} EChartsExtensionRegisters */ diff --git a/dist/echarts-extension-gmap.esm.js b/dist/echarts-extension-gmap.esm.js index 720ea4e..b4688ac 100644 --- a/dist/echarts-extension-gmap.esm.js +++ b/dist/echarts-extension-gmap.esm.js @@ -1,11 +1,11 @@ /*! * echarts-extension-gmap - * @version 1.6.0 + * @version 1.7.0 * @author plainheart * * MIT License * - * Copyright (c) 2020-2022 Zhongxiang Wang + * Copyright (c) 2020-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 @@ -37,6 +37,7 @@ function v2Equal(a, b) { } /* global google */ + function dataToCoordSize(dataSize, dataItem) { dataItem = dataItem || [0, 0]; return util.map([0, 1], function (dimIdx) { @@ -297,6 +298,7 @@ var GMapModel = { var GMapModel$1 = isNewEC ? ComponentModel.extend(GMapModel) : GMapModel; /* global google */ + var GMapView = { type: COMPONENT_TYPE, render: function render(gmapModel, ecModel, api) { @@ -349,7 +351,7 @@ var GMapView = { } this._renderHandler = google.maps.event.addListener(gmap, renderOnMoving ? 'gmaprender' : 'idle', renderHandler); gmap.setOptions({ - gestureHandling: gmapModel.get('roam') ? 'auto' : 'none' + gestureHandling: gmapModel.get('roam') ? gmapModel.get('gestureHandling') || 'auto' : 'none' }); rendering = false; }, @@ -383,12 +385,13 @@ var GMapView = { var GMapView$1 = isNewEC ? ComponentView.extend(GMapView) : GMapView; var name = "echarts-extension-gmap"; -var version = "1.6.0"; +var version = "1.7.0"; /** * Google Map component extension */ + /** * @typedef {import('../export').EChartsExtensionRegisters} EChartsExtensionRegisters */ diff --git a/dist/echarts-extension-gmap.js b/dist/echarts-extension-gmap.js index 4580268..c9227d4 100644 --- a/dist/echarts-extension-gmap.js +++ b/dist/echarts-extension-gmap.js @@ -1,11 +1,11 @@ /*! * echarts-extension-gmap - * @version 1.6.0 + * @version 1.7.0 * @author plainheart * * MIT License * - * Copyright (c) 2020-2022 Zhongxiang Wang + * Copyright (c) 2020-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 @@ -40,6 +40,7 @@ } /* global google */ + function dataToCoordSize(dataSize, dataItem) { dataItem = dataItem || [0, 0]; return echarts.util.map([0, 1], function (dimIdx) { @@ -300,6 +301,7 @@ var GMapModel$1 = isNewEC ? echarts.ComponentModel.extend(GMapModel) : GMapModel; /* global google */ + var GMapView = { type: COMPONENT_TYPE, render: function render(gmapModel, ecModel, api) { @@ -352,7 +354,7 @@ } this._renderHandler = google.maps.event.addListener(gmap, renderOnMoving ? 'gmaprender' : 'idle', renderHandler); gmap.setOptions({ - gestureHandling: gmapModel.get('roam') ? 'auto' : 'none' + gestureHandling: gmapModel.get('roam') ? gmapModel.get('gestureHandling') || 'auto' : 'none' }); rendering = false; }, @@ -386,12 +388,13 @@ var GMapView$1 = isNewEC ? echarts.ComponentView.extend(GMapView) : GMapView; var name = "echarts-extension-gmap"; - var version = "1.6.0"; + var version = "1.7.0"; /** * Google Map component extension */ + /** * @typedef {import('../export').EChartsExtensionRegisters} EChartsExtensionRegisters */ diff --git a/dist/echarts-extension-gmap.js.map b/dist/echarts-extension-gmap.js.map index cf613bb..12b428c 100644 --- a/dist/echarts-extension-gmap.js.map +++ b/dist/echarts-extension-gmap.js.map @@ -1 +1 @@ -{"version":3,"file":"echarts-extension-gmap.js","sources":["../src/helper.js","../src/GMapCoordSys.js","../src/GMapModel.js","../src/GMapView.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 = 'gmap'\n\nexport function v2Equal(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1]\n}\n","/* global google */\n\nimport { util as zrUtil, graphic, matrix } from 'echarts/lib/echarts'\nimport { COMPONENT_TYPE } 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\nfunction GMapCoordSys(gmap, api) {\n this._gmap = gmap\n this.dimensions = ['lng', 'lat']\n this._mapOffset = [0, 0]\n this._api = api\n}\n\nconst GMapCoordSysProto = GMapCoordSys.prototype\n\n// exclude private and unsupported options\nconst excludedOptions = [\n 'echartsLayerZIndex',\n 'renderOnMoving'\n]\n\nGMapCoordSysProto.setZoom = function(zoom) {\n this._zoom = zoom\n}\n\nGMapCoordSysProto.setCenter = function(center) {\n const latlng = new google.maps.LatLng(center[1], center[0])\n this._center = latLngToPixel(latlng, this._gmap)\n}\n\nGMapCoordSysProto.setMapOffset = function(mapOffset) {\n this._mapOffset = mapOffset\n}\n\nGMapCoordSysProto.setGoogleMap = function(gmap) {\n this._gmap = gmap\n}\n\nGMapCoordSysProto.getGoogleMap = function() {\n return this._gmap\n}\n\nGMapCoordSysProto.dataToPoint = function(data) {\n const latlng = new google.maps.LatLng(data[1], data[0])\n const px = latLngToPixel(latlng, this._gmap)\n const mapOffset = this._mapOffset\n return [px.x - mapOffset[0], px.y - mapOffset[1]]\n}\n\nGMapCoordSysProto.pointToData = function(pt) {\n const mapOffset = this._mapOffset\n const latlng = pixelToLatLng(\n new google.maps.Point(pt[0] + mapOffset[0], pt[1] + mapOffset[1]),\n this._gmap\n )\n return [latlng.lng(), latlng.lat()]\n}\n\nGMapCoordSysProto.getViewRect = function() {\n const api = this._api\n return new graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight())\n}\n\nGMapCoordSysProto.getRoamTransform = function() {\n return matrix.create()\n}\n\nGMapCoordSysProto.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\nGMapCoordSysProto.convertToPixel = function(ecModel, finder, value) {\n // here we don't use finder as only one google map component is allowed\n return this.dataToPoint(value);\n}\n\nGMapCoordSysProto.convertFromPixel = function(ecModel, finder, value) {\n // here we don't use finder as only one google map component is allowed\n return this.pointToData(value);\n}\n\nGMapCoordSys.create = function(ecModel, api) {\n let gmapCoordSys\n const root = api.getDom()\n\n ecModel.eachComponent(COMPONENT_TYPE, function(gmapModel) {\n const painter = api.getZr().painter\n const viewportRoot = painter.getViewportRoot()\n if (typeof google === 'undefined' || !google.maps || !google.maps.Map) {\n throw new Error('Google Map API is not loaded')\n }\n Overlay = Overlay || createOverlayCtor()\n if (gmapCoordSys) {\n throw new Error('Only one google map component is allowed')\n }\n let gmap = gmapModel.getGoogleMap()\n if (!gmap) {\n // Not support IE8\n const className = 'ec-extension-google-map'\n let gmapRoot = root.querySelector('.' + className)\n if (gmapRoot) {\n // Reset viewport left and top, which will be changed\n // in moving handler in GMapView\n viewportRoot.style.left = '0'\n viewportRoot.style.top = '0'\n root.removeChild(gmapRoot)\n }\n gmapRoot = document.createElement('div')\n gmapRoot.className = className\n gmapRoot.style.cssText = 'position:absolute;top:0;left:0;right:0;bottom:0'\n root.appendChild(gmapRoot)\n\n const options = zrUtil.clone(gmapModel.get())\n const echartsLayerZIndex = options.echartsLayerZIndex\n // delete excluded options\n zrUtil.each(excludedOptions, function(key) {\n delete options[key]\n })\n const center = options.center\n // normalize center\n if (zrUtil.isArray(center)) {\n options.center = {\n lng: center[0],\n lat: center[1]\n }\n }\n\n gmap = new google.maps.Map(gmapRoot, options)\n gmapModel.setGoogleMap(gmap)\n\n gmapModel.__projectionChangeListener && gmapModel.__projectionChangeListener.remove()\n gmapModel.__projectionChangeListener = google.maps.event.addListener(gmap, 'projection_changed',\n function() {\n const layer = gmapModel.getEChartsLayer()\n layer && layer.setMap(null)\n\n const overlay = new Overlay(viewportRoot, gmap)\n overlay.setZIndex(echartsLayerZIndex)\n gmapModel.setEChartsLayer(overlay)\n }\n )\n\n // Override\n painter.getViewportRootOffset = function() {\n return { offsetLeft: 0, offsetTop: 0 }\n }\n }\n\n const center = gmapModel.get('center')\n const normalizedCenter = [\n center.lng != null ? center.lng : center[0],\n center.lat != null ? center.lat : center[1]\n ]\n const zoom = gmapModel.get('zoom')\n if (center && zoom) {\n const gmapCenter = gmap.getCenter()\n const gmapZoom = gmap.getZoom()\n const centerOrZoomChanged = gmapModel.centerOrZoomChanged([gmapCenter.lng(), gmapCenter.lat()], gmapZoom)\n if (centerOrZoomChanged) {\n const pt = new google.maps.LatLng(normalizedCenter[1], normalizedCenter[0])\n gmap.setOptions({\n center: pt,\n zoom: zoom\n })\n }\n }\n\n gmapCoordSys = new GMapCoordSys(gmap, api)\n gmapCoordSys.setMapOffset(gmapModel.__mapOffset || [0, 0])\n gmapCoordSys.setZoom(zoom)\n gmapCoordSys.setCenter(normalizedCenter)\n\n gmapModel.coordinateSystem = gmapCoordSys\n })\n\n ecModel.eachSeries(function(seriesModel) {\n if (seriesModel.get('coordinateSystem') === COMPONENT_TYPE) {\n seriesModel.coordinateSystem = gmapCoordSys\n }\n })\n\n // return created coordinate systems\n return gmapCoordSys && [gmapCoordSys]\n}\n\nlet Overlay\n\nfunction createOverlayCtor() {\n function Overlay(root, gmap) {\n this._root = root\n this.setMap(gmap)\n }\n\n Overlay.prototype = new google.maps.OverlayView()\n\n Overlay.prototype.onAdd = function() {\n const gmap = this.getMap()\n gmap.__overlayProjection = this.getProjection()\n gmap.getDiv().querySelector('.gm-style > div').appendChild(this._root)\n }\n\n /**\n * @override\n */\n Overlay.prototype.draw = function() {\n google.maps.event.trigger(this.getMap(), 'gmaprender')\n }\n\n Overlay.prototype.onRemove = function() {\n this._root.parentNode.removeChild(this._root)\n this._root = null\n }\n\n Overlay.prototype.setZIndex = function(zIndex) {\n this._root.style.zIndex = zIndex\n }\n\n Overlay.prototype.getZIndex = function() {\n return this._root.style.zIndex\n }\n\n return Overlay\n}\n\nfunction latLngToPixel(latLng, map) {\n const projection = map.__overlayProjection\n if (!projection) {\n return new google.maps.Point(-Infinity, -Infinity)\n }\n\n return projection.fromLatLngToContainerPixel(latLng)\n}\n\nfunction pixelToLatLng(pixel, map) {\n const projection = map.__overlayProjection\n if (!projection) {\n return new google.maps.Point(-Infinity, -Infinity)\n }\n\n return projection.fromContainerPixelToLatLng(pixel)\n}\n\nGMapCoordSysProto.dimensions = GMapCoordSys.dimensions = ['lng', 'lat']\n\nGMapCoordSysProto.type = COMPONENT_TYPE\n\nexport default GMapCoordSys\n","import { ComponentModel } from 'echarts/lib/echarts'\nimport { COMPONENT_TYPE, isNewEC, v2Equal } from './helper'\n\nconst GMapModel = {\n type: COMPONENT_TYPE,\n\n setGoogleMap(gmap) {\n this.__gmap = gmap\n },\n\n getGoogleMap() {\n // __gmap is set when creating GMapCoordSys\n return this.__gmap\n },\n\n setEChartsLayer(layer) {\n this.__echartsLayer = layer\n },\n\n getEChartsLayer() {\n return this.__echartsLayer\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: { lat: 39.90923, lng: 116.397428 },\n zoom: 5,\n\n // extension options\n // since v1.4.0\n roam: true,\n echartsLayerZIndex: 2000,\n renderOnMoving: true\n }\n}\n\nexport default isNewEC\n ? ComponentModel.extend(GMapModel)\n : GMapModel\n","/* global google */\n\nimport { ComponentView, getInstanceByDom, throttle } from 'echarts/lib/echarts'\nimport { isNewEC, COMPONENT_TYPE } from './helper'\n\nconst GMapView = {\n type: COMPONENT_TYPE,\n\n render(gmapModel, ecModel, api) {\n let rendering = true\n\n const gmap = gmapModel.getGoogleMap()\n const viewportRoot = api.getZr().painter.getViewportRoot()\n const coordSys = gmapModel.coordinateSystem\n const renderOnMoving = gmapModel.get('renderOnMoving')\n const offsetEl = gmap.getDiv()\n const mapEl = offsetEl.firstChild\n const oldWidth = mapEl.clientWidth\n const oldHeight = mapEl.clientHeight\n\n let renderHandler = function() {\n if (rendering) {\n return\n }\n\n // reduce unnecessary resize\n if (mapEl.clientWidth !== oldWidth || mapEl.clientHeight !== oldHeight) {\n return resizeHandler()\n }\n\n const mapOffset = [\n -parseInt(offsetEl.style.left, 10) || 0,\n -parseInt(offsetEl.style.top, 10) || 0\n ]\n viewportRoot.style.left = mapOffset[0] + 'px'\n viewportRoot.style.top = mapOffset[1] + 'px'\n\n coordSys.setMapOffset(mapOffset)\n gmapModel.__mapOffset = mapOffset\n\n api.dispatchAction({\n type: COMPONENT_TYPE + 'Roam',\n animation: {\n // in ECharts 5.x,\n // we can set animation duration as 0\n // to ensure no delay when moving or zooming\n duration: 0\n }\n })\n }\n\n let resizeHandler = function() {\n // fix chart can't get resized correctly after the google map enters fullscreen\n // See also #14\n getInstanceByDom(api.getDom()).resize({\n width: mapEl.clientWidth,\n height: mapEl.clientHeight\n })\n }\n\n this._renderHandler && this._renderHandler.remove()\n\n if (!renderOnMoving) {\n // PENDING hide layer when rendering\n renderHandler = throttle(renderHandler, 100, true)\n resizeHandler = throttle(resizeHandler, 100, true)\n }\n this._renderHandler = google.maps.event.addListener(\n gmap,\n renderOnMoving ? 'gmaprender' : 'idle',\n renderHandler\n )\n\n gmap.setOptions({\n gestureHandling: gmapModel.get('roam') ? 'auto' : 'none'\n })\n\n rendering = false\n },\n\n dispose() {\n this._renderHandler && this._renderHandler.remove()\n delete this._renderHandler\n\n const component = this.__model\n if (!component) {\n return\n }\n\n const gmapInstance = component.getGoogleMap()\n\n if (gmapInstance) {\n // remove injected projection\n delete gmapInstance.__overlayProjection\n\n // clear all listeners of map instance\n google.maps.event.clearInstanceListeners(gmapInstance)\n\n // remove DOM of map instance\n const mapDiv = gmapInstance.getDiv()\n mapDiv.parentNode && mapDiv.parentNode.removeChild(mapDiv)\n }\n\n component.setGoogleMap(null)\n component.setEChartsLayer(null)\n\n if (component.coordinateSystem) {\n component.coordinateSystem.setGoogleMap(null)\n component.coordinateSystem = null\n }\n }\n}\n\nexport default isNewEC\n ? ComponentView.extend(GMapView)\n : GMapView\n","/**\n * Google Map component extension\n */\n\n import GMapCoordSys from './GMapCoordSys'\n import GMapModel from './GMapModel'\n import GMapView from './GMapView'\n import { 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 * Google Map extension installer\n * @param {EChartsExtensionRegisters} registers\n */\n export 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(GMapModel)\n : registers.extendComponentModel(GMapModel)\n // View\n isNewEC\n ? registers.registerComponentView(GMapView)\n : registers.extendComponentView(GMapView)\n // Coordinate System\n registers.registerCoordinateSystem(COMPONENT_TYPE, GMapCoordSys)\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(gmapModel) {\n const gmap = gmapModel.getGoogleMap()\n const center = gmap.getCenter()\n gmapModel.setCenterAndZoom([center.lng(), center.lat()], gmap.getZoom())\n })\n }\n )\n}\n","import * 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","v2Equal","a","b","dataToCoordSize","dataSize","dataItem","zrUtil","map","dimIdx","val","halfSize","p1","p2","Math","abs","dataToPoint","GMapCoordSys","gmap","api","_gmap","dimensions","_mapOffset","_api","GMapCoordSysProto","prototype","excludedOptions","setZoom","zoom","_zoom","setCenter","center","latlng","google","maps","LatLng","_center","latLngToPixel","setMapOffset","mapOffset","setGoogleMap","getGoogleMap","data","px","x","y","pointToData","pt","pixelToLatLng","Point","lng","lat","getViewRect","graphic","BoundingRect","getWidth","getHeight","getRoamTransform","matrix","create","prepareCustoms","rect","coordSys","type","width","height","coord","bind","size","convertToPixel","ecModel","finder","value","convertFromPixel","gmapCoordSys","root","getDom","eachComponent","gmapModel","painter","getZr","viewportRoot","getViewportRoot","Map","Error","Overlay","createOverlayCtor","className","gmapRoot","querySelector","style","left","top","removeChild","document","createElement","cssText","appendChild","options","clone","get","echartsLayerZIndex","each","key","isArray","__projectionChangeListener","remove","event","addListener","layer","getEChartsLayer","setMap","overlay","setZIndex","setEChartsLayer","getViewportRootOffset","offsetLeft","offsetTop","normalizedCenter","gmapCenter","getCenter","gmapZoom","getZoom","centerOrZoomChanged","setOptions","__mapOffset","coordinateSystem","eachSeries","seriesModel","_root","OverlayView","onAdd","getMap","__overlayProjection","getProjection","getDiv","draw","trigger","onRemove","parentNode","zIndex","getZIndex","latLng","projection","Infinity","fromLatLngToContainerPixel","pixel","fromContainerPixelToLatLng","GMapModel","__gmap","__echartsLayer","setCenterAndZoom","option","defaultOption","roam","renderOnMoving","ComponentModel","extend","GMapView","render","rendering","offsetEl","mapEl","firstChild","oldWidth","clientWidth","oldHeight","clientHeight","renderHandler","resizeHandler","parseInt","dispatchAction","animation","duration","getInstanceByDom","resize","_renderHandler","throttle","gestureHandling","dispose","component","__model","gmapInstance","clearInstanceListeners","mapDiv","ComponentView","install","registers","registerLayout","eachSeriesByType","getData","valueDim","mapDimension","point","cx","cy","idx","layout","getItemLayout","registerComponentModel","extendComponentModel","registerComponentView","extendComponentView","registerCoordinateSystem","registerAction","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;EAE7B,SAASC,OAAOA,CAACC,CAAC,EAAEC,CAAC,EAAE;IAC5B,OAAOD,CAAC,IAAIC,CAAC,IAAID,CAAC,CAAC,CAAC,CAAC,KAAKC,CAAC,CAAC,CAAC,CAAC,IAAID,CAAC,CAAC,CAAC,CAAC,KAAKC,CAAC,CAAC,CAAC,CAAC,CAAA;EACjD;;ECVA;EAKA,SAASC,e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AAE,CAAC,CAAA;EAC1E,KAAC,CAAC,CAAA;EACJ,GAAC,CACF,CAAA;EACH;;EC9DA3H,OAAO,GAAGgN,OAAO,CAACC,GAAG,CAACtB,OAAO,CAAC,GAAGA,OAAO,CAACqB,OAAO,CAAC;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"echarts-extension-gmap.js","sources":["../src/helper.js","../src/GMapCoordSys.js","../src/GMapModel.js","../src/GMapView.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 = 'gmap'\n\nexport function v2Equal(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1]\n}\n","/* global google */\n\nimport { util as zrUtil, graphic, matrix } from 'echarts/lib/echarts'\nimport { COMPONENT_TYPE } 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\nfunction GMapCoordSys(gmap, api) {\n this._gmap = gmap\n this.dimensions = ['lng', 'lat']\n this._mapOffset = [0, 0]\n this._api = api\n}\n\nconst GMapCoordSysProto = GMapCoordSys.prototype\n\n// exclude private and unsupported options\nconst excludedOptions = [\n 'echartsLayerZIndex',\n 'renderOnMoving'\n]\n\nGMapCoordSysProto.setZoom = function(zoom) {\n this._zoom = zoom\n}\n\nGMapCoordSysProto.setCenter = function(center) {\n const latlng = new google.maps.LatLng(center[1], center[0])\n this._center = latLngToPixel(latlng, this._gmap)\n}\n\nGMapCoordSysProto.setMapOffset = function(mapOffset) {\n this._mapOffset = mapOffset\n}\n\nGMapCoordSysProto.setGoogleMap = function(gmap) {\n this._gmap = gmap\n}\n\nGMapCoordSysProto.getGoogleMap = function() {\n return this._gmap\n}\n\nGMapCoordSysProto.dataToPoint = function(data) {\n const latlng = new google.maps.LatLng(data[1], data[0])\n const px = latLngToPixel(latlng, this._gmap)\n const mapOffset = this._mapOffset\n return [px.x - mapOffset[0], px.y - mapOffset[1]]\n}\n\nGMapCoordSysProto.pointToData = function(pt) {\n const mapOffset = this._mapOffset\n const latlng = pixelToLatLng(\n new google.maps.Point(pt[0] + mapOffset[0], pt[1] + mapOffset[1]),\n this._gmap\n )\n return [latlng.lng(), latlng.lat()]\n}\n\nGMapCoordSysProto.getViewRect = function() {\n const api = this._api\n return new graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight())\n}\n\nGMapCoordSysProto.getRoamTransform = function() {\n return matrix.create()\n}\n\nGMapCoordSysProto.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\nGMapCoordSysProto.convertToPixel = function(ecModel, finder, value) {\n // here we don't use finder as only one google map component is allowed\n return this.dataToPoint(value);\n}\n\nGMapCoordSysProto.convertFromPixel = function(ecModel, finder, value) {\n // here we don't use finder as only one google map component is allowed\n return this.pointToData(value);\n}\n\nGMapCoordSys.create = function(ecModel, api) {\n let gmapCoordSys\n const root = api.getDom()\n\n ecModel.eachComponent(COMPONENT_TYPE, function(gmapModel) {\n const painter = api.getZr().painter\n const viewportRoot = painter.getViewportRoot()\n if (typeof google === 'undefined' || !google.maps || !google.maps.Map) {\n throw new Error('Google Map API is not loaded')\n }\n Overlay = Overlay || createOverlayCtor()\n if (gmapCoordSys) {\n throw new Error('Only one google map component is allowed')\n }\n let gmap = gmapModel.getGoogleMap()\n if (!gmap) {\n // Not support IE8\n const className = 'ec-extension-google-map'\n let gmapRoot = root.querySelector('.' + className)\n if (gmapRoot) {\n // Reset viewport left and top, which will be changed\n // in moving handler in GMapView\n viewportRoot.style.left = '0'\n viewportRoot.style.top = '0'\n root.removeChild(gmapRoot)\n }\n gmapRoot = document.createElement('div')\n gmapRoot.className = className\n gmapRoot.style.cssText = 'position:absolute;top:0;left:0;right:0;bottom:0'\n root.appendChild(gmapRoot)\n\n const options = zrUtil.clone(gmapModel.get())\n const echartsLayerZIndex = options.echartsLayerZIndex\n // delete excluded options\n zrUtil.each(excludedOptions, function(key) {\n delete options[key]\n })\n const center = options.center\n // normalize center\n if (zrUtil.isArray(center)) {\n options.center = {\n lng: center[0],\n lat: center[1]\n }\n }\n\n gmap = new google.maps.Map(gmapRoot, options)\n gmapModel.setGoogleMap(gmap)\n\n gmapModel.__projectionChangeListener && gmapModel.__projectionChangeListener.remove()\n gmapModel.__projectionChangeListener = google.maps.event.addListener(gmap, 'projection_changed',\n function() {\n const layer = gmapModel.getEChartsLayer()\n layer && layer.setMap(null)\n\n const overlay = new Overlay(viewportRoot, gmap)\n overlay.setZIndex(echartsLayerZIndex)\n gmapModel.setEChartsLayer(overlay)\n }\n )\n\n // Override\n painter.getViewportRootOffset = function() {\n return { offsetLeft: 0, offsetTop: 0 }\n }\n }\n\n const center = gmapModel.get('center')\n const normalizedCenter = [\n center.lng != null ? center.lng : center[0],\n center.lat != null ? center.lat : center[1]\n ]\n const zoom = gmapModel.get('zoom')\n if (center && zoom) {\n const gmapCenter = gmap.getCenter()\n const gmapZoom = gmap.getZoom()\n const centerOrZoomChanged = gmapModel.centerOrZoomChanged([gmapCenter.lng(), gmapCenter.lat()], gmapZoom)\n if (centerOrZoomChanged) {\n const pt = new google.maps.LatLng(normalizedCenter[1], normalizedCenter[0])\n gmap.setOptions({\n center: pt,\n zoom: zoom\n })\n }\n }\n\n gmapCoordSys = new GMapCoordSys(gmap, api)\n gmapCoordSys.setMapOffset(gmapModel.__mapOffset || [0, 0])\n gmapCoordSys.setZoom(zoom)\n gmapCoordSys.setCenter(normalizedCenter)\n\n gmapModel.coordinateSystem = gmapCoordSys\n })\n\n ecModel.eachSeries(function(seriesModel) {\n if (seriesModel.get('coordinateSystem') === COMPONENT_TYPE) {\n seriesModel.coordinateSystem = gmapCoordSys\n }\n })\n\n // return created coordinate systems\n return gmapCoordSys && [gmapCoordSys]\n}\n\nlet Overlay\n\nfunction createOverlayCtor() {\n function Overlay(root, gmap) {\n this._root = root\n this.setMap(gmap)\n }\n\n Overlay.prototype = new google.maps.OverlayView()\n\n Overlay.prototype.onAdd = function() {\n const gmap = this.getMap()\n gmap.__overlayProjection = this.getProjection()\n gmap.getDiv().querySelector('.gm-style > div').appendChild(this._root)\n }\n\n /**\n * @override\n */\n Overlay.prototype.draw = function() {\n google.maps.event.trigger(this.getMap(), 'gmaprender')\n }\n\n Overlay.prototype.onRemove = function() {\n this._root.parentNode.removeChild(this._root)\n this._root = null\n }\n\n Overlay.prototype.setZIndex = function(zIndex) {\n this._root.style.zIndex = zIndex\n }\n\n Overlay.prototype.getZIndex = function() {\n return this._root.style.zIndex\n }\n\n return Overlay\n}\n\nfunction latLngToPixel(latLng, map) {\n const projection = map.__overlayProjection\n if (!projection) {\n return new google.maps.Point(-Infinity, -Infinity)\n }\n\n return projection.fromLatLngToContainerPixel(latLng)\n}\n\nfunction pixelToLatLng(pixel, map) {\n const projection = map.__overlayProjection\n if (!projection) {\n return new google.maps.Point(-Infinity, -Infinity)\n }\n\n return projection.fromContainerPixelToLatLng(pixel)\n}\n\nGMapCoordSysProto.dimensions = GMapCoordSys.dimensions = ['lng', 'lat']\n\nGMapCoordSysProto.type = COMPONENT_TYPE\n\nexport default GMapCoordSys\n","import { ComponentModel } from 'echarts/lib/echarts'\nimport { COMPONENT_TYPE, isNewEC, v2Equal } from './helper'\n\nconst GMapModel = {\n type: COMPONENT_TYPE,\n\n setGoogleMap(gmap) {\n this.__gmap = gmap\n },\n\n getGoogleMap() {\n // __gmap is set when creating GMapCoordSys\n return this.__gmap\n },\n\n setEChartsLayer(layer) {\n this.__echartsLayer = layer\n },\n\n getEChartsLayer() {\n return this.__echartsLayer\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: { lat: 39.90923, lng: 116.397428 },\n zoom: 5,\n\n // extension options\n // since v1.4.0\n roam: true,\n echartsLayerZIndex: 2000,\n renderOnMoving: true\n }\n}\n\nexport default isNewEC\n ? ComponentModel.extend(GMapModel)\n : GMapModel\n","/* global google */\n\nimport { ComponentView, getInstanceByDom, throttle } from 'echarts/lib/echarts'\nimport { isNewEC, COMPONENT_TYPE } from './helper'\n\nconst GMapView = {\n type: COMPONENT_TYPE,\n\n render(gmapModel, ecModel, api) {\n let rendering = true\n\n const gmap = gmapModel.getGoogleMap()\n const viewportRoot = api.getZr().painter.getViewportRoot()\n const coordSys = gmapModel.coordinateSystem\n const renderOnMoving = gmapModel.get('renderOnMoving')\n const offsetEl = gmap.getDiv()\n const mapEl = offsetEl.firstChild\n const oldWidth = mapEl.clientWidth\n const oldHeight = mapEl.clientHeight\n\n let renderHandler = function() {\n if (rendering) {\n return\n }\n\n // reduce unnecessary resize\n if (mapEl.clientWidth !== oldWidth || mapEl.clientHeight !== oldHeight) {\n return resizeHandler()\n }\n\n const mapOffset = [\n -parseInt(offsetEl.style.left, 10) || 0,\n -parseInt(offsetEl.style.top, 10) || 0\n ]\n viewportRoot.style.left = mapOffset[0] + 'px'\n viewportRoot.style.top = mapOffset[1] + 'px'\n\n coordSys.setMapOffset(mapOffset)\n gmapModel.__mapOffset = mapOffset\n\n api.dispatchAction({\n type: COMPONENT_TYPE + 'Roam',\n animation: {\n // in ECharts 5.x,\n // we can set animation duration as 0\n // to ensure no delay when moving or zooming\n duration: 0\n }\n })\n }\n\n let resizeHandler = function() {\n // fix chart can't get resized correctly after the google map enters fullscreen\n // See also #14\n getInstanceByDom(api.getDom()).resize({\n width: mapEl.clientWidth,\n height: mapEl.clientHeight\n })\n }\n\n this._renderHandler && this._renderHandler.remove()\n\n if (!renderOnMoving) {\n // PENDING hide layer when rendering\n renderHandler = throttle(renderHandler, 100, true)\n resizeHandler = throttle(resizeHandler, 100, true)\n }\n this._renderHandler = google.maps.event.addListener(\n gmap,\n renderOnMoving ? 'gmaprender' : 'idle',\n renderHandler\n )\n\n gmap.setOptions({\n gestureHandling: gmapModel.get('roam') ? (gmapModel.get('gestureHandling') || 'auto') : 'none'\n })\n\n rendering = false\n },\n\n dispose() {\n this._renderHandler && this._renderHandler.remove()\n delete this._renderHandler\n\n const component = this.__model\n if (!component) {\n return\n }\n\n const gmapInstance = component.getGoogleMap()\n\n if (gmapInstance) {\n // remove injected projection\n delete gmapInstance.__overlayProjection\n\n // clear all listeners of map instance\n google.maps.event.clearInstanceListeners(gmapInstance)\n\n // remove DOM of map instance\n const mapDiv = gmapInstance.getDiv()\n mapDiv.parentNode && mapDiv.parentNode.removeChild(mapDiv)\n }\n\n component.setGoogleMap(null)\n component.setEChartsLayer(null)\n\n if (component.coordinateSystem) {\n component.coordinateSystem.setGoogleMap(null)\n component.coordinateSystem = null\n }\n }\n}\n\nexport default isNewEC\n ? ComponentView.extend(GMapView)\n : GMapView\n","/**\n * Google Map component extension\n */\n\nimport GMapCoordSys from './GMapCoordSys'\nimport GMapModel from './GMapModel'\nimport GMapView from './GMapView'\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 * Google Map extension installer\n * @param {EChartsExtensionRegisters} registers\n */\n export 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(GMapModel)\n : registers.extendComponentModel(GMapModel)\n // View\n isNewEC\n ? registers.registerComponentView(GMapView)\n : registers.extendComponentView(GMapView)\n // Coordinate System\n registers.registerCoordinateSystem(COMPONENT_TYPE, GMapCoordSys)\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(gmapModel) {\n const gmap = gmapModel.getGoogleMap()\n const center = gmap.getCenter()\n gmapModel.setCenterAndZoom([center.lng(), center.lat()], gmap.getZoom())\n })\n }\n )\n}\n","import * 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","v2Equal","a","b","dataToCoordSize","dataSize","dataItem","zrUtil","map","dimIdx","val","halfSize","p1","p2","Math","abs","dataToPoint","GMapCoordSys","gmap","api","_gmap","dimensions","_mapOffset","_api","GMapCoordSysProto","prototype","excludedOptions","setZoom","zoom","_zoom","setCenter","center","latlng","google","maps","LatLng","_center","latLngToPixel","setMapOffset","mapOffset","setGoogleMap","getGoogleMap","data","px","x","y","pointToData","pt","pixelToLatLng","Point","lng","lat","getViewRect","graphic","BoundingRect","getWidth","getHeight","getRoamTransform","matrix","create","prepareCustoms","rect","coordSys","type","width","height","coord","bind","size","convertToPixel","ecModel","finder","value","convertFromPixel","gmapCoordSys","root","getDom","eachComponent","gmapModel","painter","getZr","viewportRoot","getViewportRoot","Map","Error","Overlay","createOverlayCtor","className","gmapRoot","querySelector","style","left","top","removeChild","document","createElement","cssText","appendChild","options","clone","get","echartsLayerZIndex","each","key","isArray","__projectionChangeListener","remove","event","addListener","layer","getEChartsLayer","setMap","overlay","setZIndex","setEChartsLayer","getViewportRootOffset","offsetLeft","offsetTop","normalizedCenter","gmapCenter","getCenter","gmapZoom","getZoom","centerOrZoomChanged","setOptions","__mapOffset","coordinateSystem","eachSeries","seriesModel","_root","OverlayView","onAdd","getMap","__overlayProjection","getProjection","getDiv","draw","trigger","onRemove","parentNode","zIndex","getZIndex","latLng","projection","Infinity","fromLatLngToContainerPixel","pixel","fromContainerPixelToLatLng","GMapModel","__gmap","__echartsLayer","setCenterAndZoom","option","defaultOption","roam","renderOnMoving","ComponentModel","extend","GMapView","render","rendering","offsetEl","mapEl","firstChild","oldWidth","clientWidth","oldHeight","clientHeight","renderHandler","resizeHandler","parseInt","dispatchAction","animation","duration","getInstanceByDom","resize","_renderHandler","throttle","gestureHandling","dispose","component","__model","gmapInstance","clearInstanceListeners","mapDiv","ComponentView","install","registers","registerLayout","eachSeriesByType","getData","valueDim","mapDimension","point","cx","cy","idx","layout","getItemLayout","registerComponentModel","extendComponentModel","registerComponentView","extendComponentView","registerCoordinateSystem","registerAction","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;EAE7B,SAASC,OAAOA,CAACC,CAAC,EAAEC,CAAC,EAAE;IAC5B,OAAOD,CAAC,IAAIC,CAAC,IAAID,CAAC,CAA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AAE,CAAA;EACrC,MAAA,IAAMV,MAAM,GAAGb,IAAI,CAACsG,SAAS,EAAE,CAAA;QAC/B1C,SAAS,CAACyE,gBAAgB,CAAC,CAACxH,MAAM,CAACmB,GAAG,EAAE,EAAEnB,MAAM,CAACoB,GAAG,EAAE,CAAC,EAAEjC,IAAI,CAACwG,OAAO,EAAE,CAAC,CAAA;EAC1E,KAAC,CAAC,CAAA;EACJ,GACF,CAAC,CAAA;EACH;;EC9DA3H,OAAO,GAAGgN,OAAO,CAACC,GAAG,CAACtB,OAAO,CAAC,GAAGA,OAAO,CAACqB,OAAO,CAAC;;;;;;;;;"} \ No newline at end of file diff --git a/dist/echarts-extension-gmap.min.js b/dist/echarts-extension-gmap.min.js index 45e4c74..4c59d4c 100644 --- a/dist/echarts-extension-gmap.min.js +++ b/dist/echarts-extension-gmap.min.js @@ -1,11 +1,11 @@ /*! * echarts-extension-gmap - * @version 1.6.0 + * @version 1.7.0 * @author plainheart * * MIT License * - * Copyright (c) 2020-2022 Zhongxiang Wang + * Copyright (c) 2020-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.gmap={}),e.echarts)}(this,(function(e,t){"use strict";var o=t.version.split("."),n=o[0]>4,r="gmap";function i(e,o){return o=o||[0,0],t.util.map([0,1],(function(t){var n=o[t],r=e[t]/2,i=[],a=[];return i[t]=n-r,a[t]=n+r,i[1-t]=a[1-t]=o[1-t],Math.abs(this.dataToPoint(i)[t]-this.dataToPoint(a)[t])}),this)}function a(e,t){this._gmap=e,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}var s,g=a.prototype,l=["echartsLayerZIndex","renderOnMoving"];function p(e,t){var o=t.__overlayProjection;return o?o.fromLatLngToContainerPixel(e):new google.maps.Point(-1/0,-1/0)}g.setZoom=function(e){this._zoom=e},g.setCenter=function(e){var t=new google.maps.LatLng(e[1],e[0]);this._center=p(t,this._gmap)},g.setMapOffset=function(e){this._mapOffset=e},g.setGoogleMap=function(e){this._gmap=e},g.getGoogleMap=function(){return this._gmap},g.dataToPoint=function(e){var t=p(new google.maps.LatLng(e[1],e[0]),this._gmap),o=this._mapOffset;return[t.x-o[0],t.y-o[1]]},g.pointToData=function(e){var t=this._mapOffset,o=function(e,t){var o=t.__overlayProjection;if(!o)return new google.maps.Point(-1/0,-1/0);return o.fromContainerPixelToLatLng(e)}(new google.maps.Point(e[0]+t[0],e[1]+t[1]),this._gmap);return[o.lng(),o.lat()]},g.getViewRect=function(){var e=this._api;return new t.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},g.getRoamTransform=function(){return t.matrix.create()},g.prepareCustoms=function(){var e=this.getViewRect();return{coordSys:{type:r,x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:t.util.bind(this.dataToPoint,this),size:t.util.bind(i,this)}}},g.convertToPixel=function(e,t,o){return this.dataToPoint(o)},g.convertFromPixel=function(e,t,o){return this.pointToData(o)},a.create=function(e,o){var n,i=o.getDom();return e.eachComponent(r,(function(e){var r=o.getZr().painter,g=r.getViewportRoot();if("undefined"==typeof google||!google.maps||!google.maps.Map)throw new Error("Google Map API is not loaded");if(s=s||function(){function e(e,t){this._root=e,this.setMap(t)}return e.prototype=new google.maps.OverlayView,e.prototype.onAdd=function(){var e=this.getMap();e.__overlayProjection=this.getProjection(),e.getDiv().querySelector(".gm-style > div").appendChild(this._root)},e.prototype.draw=function(){google.maps.event.trigger(this.getMap(),"gmaprender")},e.prototype.onRemove=function(){this._root.parentNode.removeChild(this._root),this._root=null},e.prototype.setZIndex=function(e){this._root.style.zIndex=e},e.prototype.getZIndex=function(){return this._root.style.zIndex},e}(),n)throw new Error("Only one google map component is allowed");var p=e.getGoogleMap();if(!p){var c="ec-extension-google-map",d=i.querySelector("."+c);d&&(g.style.left="0",g.style.top="0",i.removeChild(d)),(d=document.createElement("div")).className=c,d.style.cssText="position:absolute;top:0;left:0;right:0;bottom:0",i.appendChild(d);var h=t.util.clone(e.get()),u=h.echartsLayerZIndex;t.util.each(l,(function(e){delete h[e]}));var f=h.center;t.util.isArray(f)&&(h.center={lng:f[0],lat:f[1]}),p=new google.maps.Map(d,h),e.setGoogleMap(p),e.__projectionChangeListener&&e.__projectionChangeListener.remove(),e.__projectionChangeListener=google.maps.event.addListener(p,"projection_changed",(function(){var t=e.getEChartsLayer();t&&t.setMap(null);var o=new s(g,p);o.setZIndex(u),e.setEChartsLayer(o)})),r.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}var m=e.get("center"),y=[null!=m.lng?m.lng:m[0],null!=m.lat?m.lat:m[1]],v=e.get("zoom");if(m&&v){var _=p.getCenter(),C=p.getZoom();if(e.centerOrZoomChanged([_.lng(),_.lat()],C)){var L=new google.maps.LatLng(y[1],y[0]);p.setOptions({center:L,zoom:v})}}(n=new a(p,o)).setMapOffset(e.__mapOffset||[0,0]),n.setZoom(v),n.setCenter(y),e.coordinateSystem=n})),e.eachSeries((function(e){e.get("coordinateSystem")===r&&(e.coordinateSystem=n)})),n&&[n]},g.dimensions=a.dimensions=["lng","lat"],g.type=r;var c={type:r,setGoogleMap:function(e){this.__gmap=e},getGoogleMap:function(){return this.__gmap},setEChartsLayer:function(e){this.__echartsLayer=e},getEChartsLayer:function(){return this.__echartsLayer},setCenterAndZoom:function(e,t){this.option.center=e,this.option.zoom=t},centerOrZoomChanged:function(e,t){var o,n,r=this.option;return n=r.center,!((o=e)&&n&&o[0]===n[0]&&o[1]===n[1]&&t===r.zoom)},defaultOption:{center:{lat:39.90923,lng:116.397428},zoom:5,roam:!0,echartsLayerZIndex:2e3,renderOnMoving:!0}},d=n?t.ComponentModel.extend(c):c,h={type:r,render:function(e,o,n){var i=!0,a=e.getGoogleMap(),s=n.getZr().painter.getViewportRoot(),g=e.coordinateSystem,l=e.get("renderOnMoving"),p=a.getDiv(),c=p.firstChild,d=c.clientWidth,h=c.clientHeight,u=function(){if(!i){if(c.clientWidth!==d||c.clientHeight!==h)return f();var t=[-parseInt(p.style.left,10)||0,-parseInt(p.style.top,10)||0];s.style.left=t[0]+"px",s.style.top=t[1]+"px",g.setMapOffset(t),e.__mapOffset=t,n.dispatchAction({type:r+"Roam",animation:{duration:0}})}},f=function(){t.getInstanceByDom(n.getDom()).resize({width:c.clientWidth,height:c.clientHeight})};this._renderHandler&&this._renderHandler.remove(),l||(u=t.throttle(u,100,!0),f=t.throttle(f,100,!0)),this._renderHandler=google.maps.event.addListener(a,l?"gmaprender":"idle",u),a.setOptions({gestureHandling:e.get("roam")?"auto":"none"}),i=!1},dispose:function(){this._renderHandler&&this._renderHandler.remove(),delete this._renderHandler;var e=this.__model;if(e){var t=e.getGoogleMap();if(t){delete t.__overlayProjection,google.maps.event.clearInstanceListeners(t);var o=t.getDiv();o.parentNode&&o.parentNode.removeChild(o)}e.setGoogleMap(null),e.setEChartsLayer(null),e.coordinateSystem&&(e.coordinateSystem.setGoogleMap(null),e.coordinateSystem=null)}}},u=n?t.ComponentView.extend(h):h;function f(e){(!n||5==o[0]&&o[1]<4)&&e.registerLayout((function(e){e.eachSeriesByType("pie",(function(e){var t=e.coordinateSystem,o=e.getData(),n=o.mapDimension("value");if(t&&t.type===r){var i=e.get("center"),a=t.dataToPoint(i),s=a[0],g=a[1];o.each(n,(function(e,t){var n=o.getItemLayout(t);n.cx=s,n.cy=g}))}}))})),n?e.registerComponentModel(d):e.extendComponentModel(d),n?e.registerComponentView(u):e.extendComponentView(u),e.registerCoordinateSystem(r,a),e.registerAction({type:r+"Roam",event:r+"Roam",update:"updateLayout"},(function(e,t){t.eachComponent(r,(function(e){var t=e.getGoogleMap(),o=t.getCenter();e.setCenterAndZoom([o.lng(),o.lat()],t.getZoom())}))}))}n?t.use(f):f(t),e.name="echarts-extension-gmap",e.version="1.6.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.gmap={}),e.echarts)}(this,(function(e,t){"use strict";var o=t.version.split("."),n=o[0]>4,r="gmap";function i(e,o){return o=o||[0,0],t.util.map([0,1],(function(t){var n=o[t],r=e[t]/2,i=[],a=[];return i[t]=n-r,a[t]=n+r,i[1-t]=a[1-t]=o[1-t],Math.abs(this.dataToPoint(i)[t]-this.dataToPoint(a)[t])}),this)}function a(e,t){this._gmap=e,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}var s,g=a.prototype,l=["echartsLayerZIndex","renderOnMoving"];function p(e,t){var o=t.__overlayProjection;return o?o.fromLatLngToContainerPixel(e):new google.maps.Point(-1/0,-1/0)}g.setZoom=function(e){this._zoom=e},g.setCenter=function(e){var t=new google.maps.LatLng(e[1],e[0]);this._center=p(t,this._gmap)},g.setMapOffset=function(e){this._mapOffset=e},g.setGoogleMap=function(e){this._gmap=e},g.getGoogleMap=function(){return this._gmap},g.dataToPoint=function(e){var t=p(new google.maps.LatLng(e[1],e[0]),this._gmap),o=this._mapOffset;return[t.x-o[0],t.y-o[1]]},g.pointToData=function(e){var t=this._mapOffset,o=function(e,t){var o=t.__overlayProjection;if(!o)return new google.maps.Point(-1/0,-1/0);return o.fromContainerPixelToLatLng(e)}(new google.maps.Point(e[0]+t[0],e[1]+t[1]),this._gmap);return[o.lng(),o.lat()]},g.getViewRect=function(){var e=this._api;return new t.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},g.getRoamTransform=function(){return t.matrix.create()},g.prepareCustoms=function(){var e=this.getViewRect();return{coordSys:{type:r,x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:t.util.bind(this.dataToPoint,this),size:t.util.bind(i,this)}}},g.convertToPixel=function(e,t,o){return this.dataToPoint(o)},g.convertFromPixel=function(e,t,o){return this.pointToData(o)},a.create=function(e,o){var n,i=o.getDom();return e.eachComponent(r,(function(e){var r=o.getZr().painter,g=r.getViewportRoot();if("undefined"==typeof google||!google.maps||!google.maps.Map)throw new Error("Google Map API is not loaded");if(s=s||function(){function e(e,t){this._root=e,this.setMap(t)}return e.prototype=new google.maps.OverlayView,e.prototype.onAdd=function(){var e=this.getMap();e.__overlayProjection=this.getProjection(),e.getDiv().querySelector(".gm-style > div").appendChild(this._root)},e.prototype.draw=function(){google.maps.event.trigger(this.getMap(),"gmaprender")},e.prototype.onRemove=function(){this._root.parentNode.removeChild(this._root),this._root=null},e.prototype.setZIndex=function(e){this._root.style.zIndex=e},e.prototype.getZIndex=function(){return this._root.style.zIndex},e}(),n)throw new Error("Only one google map component is allowed");var p=e.getGoogleMap();if(!p){var c="ec-extension-google-map",d=i.querySelector("."+c);d&&(g.style.left="0",g.style.top="0",i.removeChild(d)),(d=document.createElement("div")).className=c,d.style.cssText="position:absolute;top:0;left:0;right:0;bottom:0",i.appendChild(d);var h=t.util.clone(e.get()),u=h.echartsLayerZIndex;t.util.each(l,(function(e){delete h[e]}));var f=h.center;t.util.isArray(f)&&(h.center={lng:f[0],lat:f[1]}),p=new google.maps.Map(d,h),e.setGoogleMap(p),e.__projectionChangeListener&&e.__projectionChangeListener.remove(),e.__projectionChangeListener=google.maps.event.addListener(p,"projection_changed",(function(){var t=e.getEChartsLayer();t&&t.setMap(null);var o=new s(g,p);o.setZIndex(u),e.setEChartsLayer(o)})),r.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}var m=e.get("center"),y=[null!=m.lng?m.lng:m[0],null!=m.lat?m.lat:m[1]],v=e.get("zoom");if(m&&v){var _=p.getCenter(),C=p.getZoom();if(e.centerOrZoomChanged([_.lng(),_.lat()],C)){var L=new google.maps.LatLng(y[1],y[0]);p.setOptions({center:L,zoom:v})}}(n=new a(p,o)).setMapOffset(e.__mapOffset||[0,0]),n.setZoom(v),n.setCenter(y),e.coordinateSystem=n})),e.eachSeries((function(e){e.get("coordinateSystem")===r&&(e.coordinateSystem=n)})),n&&[n]},g.dimensions=a.dimensions=["lng","lat"],g.type=r;var c={type:r,setGoogleMap:function(e){this.__gmap=e},getGoogleMap:function(){return this.__gmap},setEChartsLayer:function(e){this.__echartsLayer=e},getEChartsLayer:function(){return this.__echartsLayer},setCenterAndZoom:function(e,t){this.option.center=e,this.option.zoom=t},centerOrZoomChanged:function(e,t){var o,n,r=this.option;return n=r.center,!((o=e)&&n&&o[0]===n[0]&&o[1]===n[1]&&t===r.zoom)},defaultOption:{center:{lat:39.90923,lng:116.397428},zoom:5,roam:!0,echartsLayerZIndex:2e3,renderOnMoving:!0}},d=n?t.ComponentModel.extend(c):c,h={type:r,render:function(e,o,n){var i=!0,a=e.getGoogleMap(),s=n.getZr().painter.getViewportRoot(),g=e.coordinateSystem,l=e.get("renderOnMoving"),p=a.getDiv(),c=p.firstChild,d=c.clientWidth,h=c.clientHeight,u=function(){if(!i){if(c.clientWidth!==d||c.clientHeight!==h)return f();var t=[-parseInt(p.style.left,10)||0,-parseInt(p.style.top,10)||0];s.style.left=t[0]+"px",s.style.top=t[1]+"px",g.setMapOffset(t),e.__mapOffset=t,n.dispatchAction({type:r+"Roam",animation:{duration:0}})}},f=function(){t.getInstanceByDom(n.getDom()).resize({width:c.clientWidth,height:c.clientHeight})};this._renderHandler&&this._renderHandler.remove(),l||(u=t.throttle(u,100,!0),f=t.throttle(f,100,!0)),this._renderHandler=google.maps.event.addListener(a,l?"gmaprender":"idle",u),a.setOptions({gestureHandling:e.get("roam")?e.get("gestureHandling")||"auto":"none"}),i=!1},dispose:function(){this._renderHandler&&this._renderHandler.remove(),delete this._renderHandler;var e=this.__model;if(e){var t=e.getGoogleMap();if(t){delete t.__overlayProjection,google.maps.event.clearInstanceListeners(t);var o=t.getDiv();o.parentNode&&o.parentNode.removeChild(o)}e.setGoogleMap(null),e.setEChartsLayer(null),e.coordinateSystem&&(e.coordinateSystem.setGoogleMap(null),e.coordinateSystem=null)}}},u=n?t.ComponentView.extend(h):h;function f(e){(!n||5==o[0]&&o[1]<4)&&e.registerLayout((function(e){e.eachSeriesByType("pie",(function(e){var t=e.coordinateSystem,o=e.getData(),n=o.mapDimension("value");if(t&&t.type===r){var i=e.get("center"),a=t.dataToPoint(i),s=a[0],g=a[1];o.each(n,(function(e,t){var n=o.getItemLayout(t);n.cx=s,n.cy=g}))}}))})),n?e.registerComponentModel(d):e.extendComponentModel(d),n?e.registerComponentView(u):e.extendComponentView(u),e.registerCoordinateSystem(r,a),e.registerAction({type:r+"Roam",event:r+"Roam",update:"updateLayout"},(function(e,t){t.eachComponent(r,(function(e){var t=e.getGoogleMap(),o=t.getCenter();e.setCenterAndZoom([o.lng(),o.lat()],t.getZoom())}))}))}n?t.use(f):f(t),e.name="echarts-extension-gmap",e.version="1.7.0"})); //# sourceMappingURL=echarts-extension-gmap.min.js.map diff --git a/dist/echarts-extension-gmap.min.js.map b/dist/echarts-extension-gmap.min.js.map index e8d55c5..77da0a3 100644 --- a/dist/echarts-extension-gmap.min.js.map +++ b/dist/echarts-extension-gmap.min.js.map @@ -1 +1 @@ -{"version":3,"file":"echarts-extension-gmap.min.js","sources":["../src/helper.js","../src/GMapCoordSys.js","../src/GMapModel.js","../src/GMapView.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 = 'gmap'\n\nexport function v2Equal(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1]\n}\n","/* global google */\n\nimport { util as zrUtil, graphic, matrix } from 'echarts/lib/echarts'\nimport { COMPONENT_TYPE } 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\nfunction GMapCoordSys(gmap, api) {\n this._gmap = gmap\n this.dimensions = ['lng', 'lat']\n this._mapOffset = [0, 0]\n this._api = api\n}\n\nconst GMapCoordSysProto = GMapCoordSys.prototype\n\n// exclude private and unsupported options\nconst excludedOptions = [\n 'echartsLayerZIndex',\n 'renderOnMoving'\n]\n\nGMapCoordSysProto.setZoom = function(zoom) {\n this._zoom = zoom\n}\n\nGMapCoordSysProto.setCenter = function(center) {\n const latlng = new google.maps.LatLng(center[1], center[0])\n this._center = latLngToPixel(latlng, this._gmap)\n}\n\nGMapCoordSysProto.setMapOffset = function(mapOffset) {\n this._mapOffset = mapOffset\n}\n\nGMapCoordSysProto.setGoogleMap = function(gmap) {\n this._gmap = gmap\n}\n\nGMapCoordSysProto.getGoogleMap = function() {\n return this._gmap\n}\n\nGMapCoordSysProto.dataToPoint = function(data) {\n const latlng = new google.maps.LatLng(data[1], data[0])\n const px = latLngToPixel(latlng, this._gmap)\n const mapOffset = this._mapOffset\n return [px.x - mapOffset[0], px.y - mapOffset[1]]\n}\n\nGMapCoordSysProto.pointToData = function(pt) {\n const mapOffset = this._mapOffset\n const latlng = pixelToLatLng(\n new google.maps.Point(pt[0] + mapOffset[0], pt[1] + mapOffset[1]),\n this._gmap\n )\n return [latlng.lng(), latlng.lat()]\n}\n\nGMapCoordSysProto.getViewRect = function() {\n const api = this._api\n return new graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight())\n}\n\nGMapCoordSysProto.getRoamTransform = function() {\n return matrix.create()\n}\n\nGMapCoordSysProto.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\nGMapCoordSysProto.convertToPixel = function(ecModel, finder, value) {\n // here we don't use finder as only one google map component is allowed\n return this.dataToPoint(value);\n}\n\nGMapCoordSysProto.convertFromPixel = function(ecModel, finder, value) {\n // here we don't use finder as only one google map component is allowed\n return this.pointToData(value);\n}\n\nGMapCoordSys.create = function(ecModel, api) {\n let gmapCoordSys\n const root = api.getDom()\n\n ecModel.eachComponent(COMPONENT_TYPE, function(gmapModel) {\n const painter = api.getZr().painter\n const viewportRoot = painter.getViewportRoot()\n if (typeof google === 'undefined' || !google.maps || !google.maps.Map) {\n throw new Error('Google Map API is not loaded')\n }\n Overlay = Overlay || createOverlayCtor()\n if (gmapCoordSys) {\n throw new Error('Only one google map component is allowed')\n }\n let gmap = gmapModel.getGoogleMap()\n if (!gmap) {\n // Not support IE8\n const className = 'ec-extension-google-map'\n let gmapRoot = root.querySelector('.' + className)\n if (gmapRoot) {\n // Reset viewport left and top, which will be changed\n // in moving handler in GMapView\n viewportRoot.style.left = '0'\n viewportRoot.style.top = '0'\n root.removeChild(gmapRoot)\n }\n gmapRoot = document.createElement('div')\n gmapRoot.className = className\n gmapRoot.style.cssText = 'position:absolute;top:0;left:0;right:0;bottom:0'\n root.appendChild(gmapRoot)\n\n const options = zrUtil.clone(gmapModel.get())\n const echartsLayerZIndex = options.echartsLayerZIndex\n // delete excluded options\n zrUtil.each(excludedOptions, function(key) {\n delete options[key]\n })\n const center = options.center\n // normalize center\n if (zrUtil.isArray(center)) {\n options.center = {\n lng: center[0],\n lat: center[1]\n }\n }\n\n gmap = new google.maps.Map(gmapRoot, options)\n gmapModel.setGoogleMap(gmap)\n\n gmapModel.__projectionChangeListener && gmapModel.__projectionChangeListener.remove()\n gmapModel.__projectionChangeListener = google.maps.event.addListener(gmap, 'projection_changed',\n function() {\n const layer = gmapModel.getEChartsLayer()\n layer && layer.setMap(null)\n\n const overlay = new Overlay(viewportRoot, gmap)\n overlay.setZIndex(echartsLayerZIndex)\n gmapModel.setEChartsLayer(overlay)\n }\n )\n\n // Override\n painter.getViewportRootOffset = function() {\n return { offsetLeft: 0, offsetTop: 0 }\n }\n }\n\n const center = gmapModel.get('center')\n const normalizedCenter = [\n center.lng != null ? center.lng : center[0],\n center.lat != null ? center.lat : center[1]\n ]\n const zoom = gmapModel.get('zoom')\n if (center && zoom) {\n const gmapCenter = gmap.getCenter()\n const gmapZoom = gmap.getZoom()\n const centerOrZoomChanged = gmapModel.centerOrZoomChanged([gmapCenter.lng(), gmapCenter.lat()], gmapZoom)\n if (centerOrZoomChanged) {\n const pt = new google.maps.LatLng(normalizedCenter[1], normalizedCenter[0])\n gmap.setOptions({\n center: pt,\n zoom: zoom\n })\n }\n }\n\n gmapCoordSys = new GMapCoordSys(gmap, api)\n gmapCoordSys.setMapOffset(gmapModel.__mapOffset || [0, 0])\n gmapCoordSys.setZoom(zoom)\n gmapCoordSys.setCenter(normalizedCenter)\n\n gmapModel.coordinateSystem = gmapCoordSys\n })\n\n ecModel.eachSeries(function(seriesModel) {\n if (seriesModel.get('coordinateSystem') === COMPONENT_TYPE) {\n seriesModel.coordinateSystem = gmapCoordSys\n }\n })\n\n // return created coordinate systems\n return gmapCoordSys && [gmapCoordSys]\n}\n\nlet Overlay\n\nfunction createOverlayCtor() {\n function Overlay(root, gmap) {\n this._root = root\n this.setMap(gmap)\n }\n\n Overlay.prototype = new google.maps.OverlayView()\n\n Overlay.prototype.onAdd = function() {\n const gmap = this.getMap()\n gmap.__overlayProjection = this.getProjection()\n gmap.getDiv().querySelector('.gm-style > div').appendChild(this._root)\n }\n\n /**\n * @override\n */\n Overlay.prototype.draw = function() {\n google.maps.event.trigger(this.getMap(), 'gmaprender')\n }\n\n Overlay.prototype.onRemove = function() {\n this._root.parentNode.removeChild(this._root)\n this._root = null\n }\n\n Overlay.prototype.setZIndex = function(zIndex) {\n this._root.style.zIndex = zIndex\n }\n\n Overlay.prototype.getZIndex = function() {\n return this._root.style.zIndex\n }\n\n return Overlay\n}\n\nfunction latLngToPixel(latLng, map) {\n const projection = map.__overlayProjection\n if (!projection) {\n return new google.maps.Point(-Infinity, -Infinity)\n }\n\n return projection.fromLatLngToContainerPixel(latLng)\n}\n\nfunction pixelToLatLng(pixel, map) {\n const projection = map.__overlayProjection\n if (!projection) {\n return new google.maps.Point(-Infinity, -Infinity)\n }\n\n return projection.fromContainerPixelToLatLng(pixel)\n}\n\nGMapCoordSysProto.dimensions = GMapCoordSys.dimensions = ['lng', 'lat']\n\nGMapCoordSysProto.type = COMPONENT_TYPE\n\nexport default GMapCoordSys\n","import { ComponentModel } from 'echarts/lib/echarts'\nimport { COMPONENT_TYPE, isNewEC, v2Equal } from './helper'\n\nconst GMapModel = {\n type: COMPONENT_TYPE,\n\n setGoogleMap(gmap) {\n this.__gmap = gmap\n },\n\n getGoogleMap() {\n // __gmap is set when creating GMapCoordSys\n return this.__gmap\n },\n\n setEChartsLayer(layer) {\n this.__echartsLayer = layer\n },\n\n getEChartsLayer() {\n return this.__echartsLayer\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: { lat: 39.90923, lng: 116.397428 },\n zoom: 5,\n\n // extension options\n // since v1.4.0\n roam: true,\n echartsLayerZIndex: 2000,\n renderOnMoving: true\n }\n}\n\nexport default isNewEC\n ? ComponentModel.extend(GMapModel)\n : GMapModel\n","/* global google */\n\nimport { ComponentView, getInstanceByDom, throttle } from 'echarts/lib/echarts'\nimport { isNewEC, COMPONENT_TYPE } from './helper'\n\nconst GMapView = {\n type: COMPONENT_TYPE,\n\n render(gmapModel, ecModel, api) {\n let rendering = true\n\n const gmap = gmapModel.getGoogleMap()\n const viewportRoot = api.getZr().painter.getViewportRoot()\n const coordSys = gmapModel.coordinateSystem\n const renderOnMoving = gmapModel.get('renderOnMoving')\n const offsetEl = gmap.getDiv()\n const mapEl = offsetEl.firstChild\n const oldWidth = mapEl.clientWidth\n const oldHeight = mapEl.clientHeight\n\n let renderHandler = function() {\n if (rendering) {\n return\n }\n\n // reduce unnecessary resize\n if (mapEl.clientWidth !== oldWidth || mapEl.clientHeight !== oldHeight) {\n return resizeHandler()\n }\n\n const mapOffset = [\n -parseInt(offsetEl.style.left, 10) || 0,\n -parseInt(offsetEl.style.top, 10) || 0\n ]\n viewportRoot.style.left = mapOffset[0] + 'px'\n viewportRoot.style.top = mapOffset[1] + 'px'\n\n coordSys.setMapOffset(mapOffset)\n gmapModel.__mapOffset = mapOffset\n\n api.dispatchAction({\n type: COMPONENT_TYPE + 'Roam',\n animation: {\n // in ECharts 5.x,\n // we can set animation duration as 0\n // to ensure no delay when moving or zooming\n duration: 0\n }\n })\n }\n\n let resizeHandler = function() {\n // fix chart can't get resized correctly after the google map enters fullscreen\n // See also #14\n getInstanceByDom(api.getDom()).resize({\n width: mapEl.clientWidth,\n height: mapEl.clientHeight\n })\n }\n\n this._renderHandler && this._renderHandler.remove()\n\n if (!renderOnMoving) {\n // PENDING hide layer when rendering\n renderHandler = throttle(renderHandler, 100, true)\n resizeHandler = throttle(resizeHandler, 100, true)\n }\n this._renderHandler = google.maps.event.addListener(\n gmap,\n renderOnMoving ? 'gmaprender' : 'idle',\n renderHandler\n )\n\n gmap.setOptions({\n gestureHandling: gmapModel.get('roam') ? 'auto' : 'none'\n })\n\n rendering = false\n },\n\n dispose() {\n this._renderHandler && this._renderHandler.remove()\n delete this._renderHandler\n\n const component = this.__model\n if (!component) {\n return\n }\n\n const gmapInstance = component.getGoogleMap()\n\n if (gmapInstance) {\n // remove injected projection\n delete gmapInstance.__overlayProjection\n\n // clear all listeners of map instance\n google.maps.event.clearInstanceListeners(gmapInstance)\n\n // remove DOM of map instance\n const mapDiv = gmapInstance.getDiv()\n mapDiv.parentNode && mapDiv.parentNode.removeChild(mapDiv)\n }\n\n component.setGoogleMap(null)\n component.setEChartsLayer(null)\n\n if (component.coordinateSystem) {\n component.coordinateSystem.setGoogleMap(null)\n component.coordinateSystem = null\n }\n }\n}\n\nexport default isNewEC\n ? ComponentView.extend(GMapView)\n : GMapView\n","/**\n * Google Map component extension\n */\n\n import GMapCoordSys from './GMapCoordSys'\n import GMapModel from './GMapModel'\n import GMapView from './GMapView'\n import { 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 * Google Map extension installer\n * @param {EChartsExtensionRegisters} registers\n */\n export 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(GMapModel)\n : registers.extendComponentModel(GMapModel)\n // View\n isNewEC\n ? registers.registerComponentView(GMapView)\n : registers.extendComponentView(GMapView)\n // Coordinate System\n registers.registerCoordinateSystem(COMPONENT_TYPE, GMapCoordSys)\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(gmapModel) {\n const gmap = gmapModel.getGoogleMap()\n const center = gmap.getCenter()\n gmapModel.setCenterAndZoom([center.lng(), center.lat()], gmap.getZoom())\n })\n }\n )\n}\n","import * 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","dataToCoordSize","dataSize","dataItem","zrUtil","map","dimIdx","val","halfSize","p1","p2","Math","abs","this","dataToPoint","GMapCoordSys","gmap","api","_gmap","dimensions","_mapOffset","_api","Overlay","GMapCoordSysProto","prototype","excludedOptions","latLngToPixel","latLng","projection","__overlayProjection","fromLatLngToContainerPixel","google","maps","Point","Infinity","setZoom","zoom","_zoom","setCenter","center","latlng","LatLng","_center","setMapOffset","mapOffset","setGoogleMap","getGoogleMap","data","px","x","y","pointToData","pt","pixel","fromContainerPixelToLatLng","pixelToLatLng","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","gmapCoordSys","root","getDom","eachComponent","gmapModel","painter","getZr","viewportRoot","getViewportRoot","Map","Error","_root","setMap","OverlayView","onAdd","getMap","getProjection","getDiv","querySelector","appendChild","draw","event","trigger","onRemove","parentNode","removeChild","setZIndex","zIndex","style","getZIndex","createOverlayCtor","className","gmapRoot","left","top","document","createElement","cssText","options","clone","get","echartsLayerZIndex","each","key","isArray","__projectionChangeListener","remove","addListener","layer","getEChartsLayer","overlay","setEChartsLayer","getViewportRootOffset","offsetLeft","offsetTop","normalizedCenter","gmapCenter","getCenter","gmapZoom","getZoom","centerOrZoomChanged","setOptions","__mapOffset","coordinateSystem","eachSeries","seriesModel","GMapModel","__gmap","__echartsLayer","setCenterAndZoom","option","a","b","defaultOption","roam","renderOnMoving","ComponentModel","extend","GMapView","render","rendering","offsetEl","mapEl","firstChild","oldWidth","clientWidth","oldHeight","clientHeight","renderHandler","resizeHandler","parseInt","dispatchAction","animation","duration","getInstanceByDom","resize","_renderHandler","throttle","gestureHandling","dispose","component","__model","gmapInstance","clearInstanceListeners","mapDiv","ComponentView","install","registers","registerLayout","eachSeriesByType","getData","valueDim","mapDimension","point","cx","cy","idx","layout","getItemLayout","registerComponentModel","extendComponentModel","registerComponentView","extendComponentView","registerCoordinateSystem","registerAction","update","payload","echarts","use"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;+UAEO,IAAMA,EAAQC,EAAOA,QAACC,MAAM,KAEtBC,EAAUH,EAAM,GAAK,EAErBI,EAAiB,OCD9B,SAASC,EAAgBC,EAAUC,GAEjC,OADAA,EAAWA,GAAY,CAAC,EAAG,GACpBC,EAAAA,KAAOC,IACZ,CAAC,EAAG,IACJ,SAASC,GACP,IAAMC,EAAMJ,EAASG,GACfE,EAAWN,EAASI,GAAU,EAC9BG,EAAK,GACLC,EAAK,GAIX,OAHAD,EAAGH,GAAUC,EAAMC,EACnBE,EAAGJ,GAAUC,EAAMC,EACnBC,EAAG,EAAIH,GAAUI,EAAG,EAAIJ,GAAUH,EAAS,EAAIG,GACxCK,KAAKC,IACVC,KAAKC,YAAYL,GAAIH,GAAUO,KAAKC,YAAYJ,GAAIJ,GAEvD,GACDO,KAEJ,CAEA,SAASE,EAAaC,EAAMC,GAC1BJ,KAAKK,MAAQF,EACbH,KAAKM,WAAa,CAAC,MAAO,OAC1BN,KAAKO,WAAa,CAAC,EAAG,GACtBP,KAAKQ,KAAOJ,CACd,CAEA,IAyLIK,EAzLEC,EAAoBR,EAAaS,UAGjCC,EAAkB,CACtB,qBACA,kBA2NF,SAASC,EAAcC,EAAQtB,GAC7B,IAAMuB,EAAavB,EAAIwB,oBACvB,OAAKD,EAIEA,EAAWE,2BAA2BH,GAHpC,IAAII,OAAOC,KAAKC,OAAOC,KAAWA,IAI7C,CA/NAX,EAAkBY,QAAU,SAASC,GACnCvB,KAAKwB,MAAQD,CACf,EAEAb,EAAkBe,UAAY,SAASC,GACrC,IAAMC,EAAS,IAAIT,OAAOC,KAAKS,OAAO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Ue,oBAAoB5C,GAElC6B,EAAUgB,yBAAyB5M,EAAgBe,GAEnD6K,EAAUiB,eACR,CACExI,KAAMrE,EAAiB,OACvBsG,MAAOtG,EAAiB,OACxB8M,OAAQ,iBAEV,SAASC,EAASlI,GAChBA,EAAQO,cAAcpF,GAAgB,SAASqF,GAC7C,IAAMrE,EAAOqE,EAAUvC,eACjBP,EAASvB,EAAK0H,YACpBrD,EAAUiE,iBAAiB,CAAC/G,EAAOiB,MAAOjB,EAAOkB,OAAQzC,EAAK4H,UAChE,GACF,GAEJ,CC9DA7I,EAAUiN,EAAQC,IAAItB,GAAWA,EAAQqB"} \ No newline at end of file +{"version":3,"file":"echarts-extension-gmap.min.js","sources":["../src/helper.js","../src/GMapCoordSys.js","../src/GMapModel.js","../src/GMapView.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 = 'gmap'\n\nexport function v2Equal(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1]\n}\n","/* global google */\n\nimport { util as zrUtil, graphic, matrix } from 'echarts/lib/echarts'\nimport { COMPONENT_TYPE } 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\nfunction GMapCoordSys(gmap, api) {\n this._gmap = gmap\n this.dimensions = ['lng', 'lat']\n this._mapOffset = [0, 0]\n this._api = api\n}\n\nconst GMapCoordSysProto = GMapCoordSys.prototype\n\n// exclude private and unsupported options\nconst excludedOptions = [\n 'echartsLayerZIndex',\n 'renderOnMoving'\n]\n\nGMapCoordSysProto.setZoom = function(zoom) {\n this._zoom = zoom\n}\n\nGMapCoordSysProto.setCenter = function(center) {\n const latlng = new google.maps.LatLng(center[1], center[0])\n this._center = latLngToPixel(latlng, this._gmap)\n}\n\nGMapCoordSysProto.setMapOffset = function(mapOffset) {\n this._mapOffset = mapOffset\n}\n\nGMapCoordSysProto.setGoogleMap = function(gmap) {\n this._gmap = gmap\n}\n\nGMapCoordSysProto.getGoogleMap = function() {\n return this._gmap\n}\n\nGMapCoordSysProto.dataToPoint = function(data) {\n const latlng = new google.maps.LatLng(data[1], data[0])\n const px = latLngToPixel(latlng, this._gmap)\n const mapOffset = this._mapOffset\n return [px.x - mapOffset[0], px.y - mapOffset[1]]\n}\n\nGMapCoordSysProto.pointToData = function(pt) {\n const mapOffset = this._mapOffset\n const latlng = pixelToLatLng(\n new google.maps.Point(pt[0] + mapOffset[0], pt[1] + mapOffset[1]),\n this._gmap\n )\n return [latlng.lng(), latlng.lat()]\n}\n\nGMapCoordSysProto.getViewRect = function() {\n const api = this._api\n return new graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight())\n}\n\nGMapCoordSysProto.getRoamTransform = function() {\n return matrix.create()\n}\n\nGMapCoordSysProto.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\nGMapCoordSysProto.convertToPixel = function(ecModel, finder, value) {\n // here we don't use finder as only one google map component is allowed\n return this.dataToPoint(value);\n}\n\nGMapCoordSysProto.convertFromPixel = function(ecModel, finder, value) {\n // here we don't use finder as only one google map component is allowed\n return this.pointToData(value);\n}\n\nGMapCoordSys.create = function(ecModel, api) {\n let gmapCoordSys\n const root = api.getDom()\n\n ecModel.eachComponent(COMPONENT_TYPE, function(gmapModel) {\n const painter = api.getZr().painter\n const viewportRoot = painter.getViewportRoot()\n if (typeof google === 'undefined' || !google.maps || !google.maps.Map) {\n throw new Error('Google Map API is not loaded')\n }\n Overlay = Overlay || createOverlayCtor()\n if (gmapCoordSys) {\n throw new Error('Only one google map component is allowed')\n }\n let gmap = gmapModel.getGoogleMap()\n if (!gmap) {\n // Not support IE8\n const className = 'ec-extension-google-map'\n let gmapRoot = root.querySelector('.' + className)\n if (gmapRoot) {\n // Reset viewport left and top, which will be changed\n // in moving handler in GMapView\n viewportRoot.style.left = '0'\n viewportRoot.style.top = '0'\n root.removeChild(gmapRoot)\n }\n gmapRoot = document.createElement('div')\n gmapRoot.className = className\n gmapRoot.style.cssText = 'position:absolute;top:0;left:0;right:0;bottom:0'\n root.appendChild(gmapRoot)\n\n const options = zrUtil.clone(gmapModel.get())\n const echartsLayerZIndex = options.echartsLayerZIndex\n // delete excluded options\n zrUtil.each(excludedOptions, function(key) {\n delete options[key]\n })\n const center = options.center\n // normalize center\n if (zrUtil.isArray(center)) {\n options.center = {\n lng: center[0],\n lat: center[1]\n }\n }\n\n gmap = new google.maps.Map(gmapRoot, options)\n gmapModel.setGoogleMap(gmap)\n\n gmapModel.__projectionChangeListener && gmapModel.__projectionChangeListener.remove()\n gmapModel.__projectionChangeListener = google.maps.event.addListener(gmap, 'projection_changed',\n function() {\n const layer = gmapModel.getEChartsLayer()\n layer && layer.setMap(null)\n\n const overlay = new Overlay(viewportRoot, gmap)\n overlay.setZIndex(echartsLayerZIndex)\n gmapModel.setEChartsLayer(overlay)\n }\n )\n\n // Override\n painter.getViewportRootOffset = function() {\n return { offsetLeft: 0, offsetTop: 0 }\n }\n }\n\n const center = gmapModel.get('center')\n const normalizedCenter = [\n center.lng != null ? center.lng : center[0],\n center.lat != null ? center.lat : center[1]\n ]\n const zoom = gmapModel.get('zoom')\n if (center && zoom) {\n const gmapCenter = gmap.getCenter()\n const gmapZoom = gmap.getZoom()\n const centerOrZoomChanged = gmapModel.centerOrZoomChanged([gmapCenter.lng(), gmapCenter.lat()], gmapZoom)\n if (centerOrZoomChanged) {\n const pt = new google.maps.LatLng(normalizedCenter[1], normalizedCenter[0])\n gmap.setOptions({\n center: pt,\n zoom: zoom\n })\n }\n }\n\n gmapCoordSys = new GMapCoordSys(gmap, api)\n gmapCoordSys.setMapOffset(gmapModel.__mapOffset || [0, 0])\n gmapCoordSys.setZoom(zoom)\n gmapCoordSys.setCenter(normalizedCenter)\n\n gmapModel.coordinateSystem = gmapCoordSys\n })\n\n ecModel.eachSeries(function(seriesModel) {\n if (seriesModel.get('coordinateSystem') === COMPONENT_TYPE) {\n seriesModel.coordinateSystem = gmapCoordSys\n }\n })\n\n // return created coordinate systems\n return gmapCoordSys && [gmapCoordSys]\n}\n\nlet Overlay\n\nfunction createOverlayCtor() {\n function Overlay(root, gmap) {\n this._root = root\n this.setMap(gmap)\n }\n\n Overlay.prototype = new google.maps.OverlayView()\n\n Overlay.prototype.onAdd = function() {\n const gmap = this.getMap()\n gmap.__overlayProjection = this.getProjection()\n gmap.getDiv().querySelector('.gm-style > div').appendChild(this._root)\n }\n\n /**\n * @override\n */\n Overlay.prototype.draw = function() {\n google.maps.event.trigger(this.getMap(), 'gmaprender')\n }\n\n Overlay.prototype.onRemove = function() {\n this._root.parentNode.removeChild(this._root)\n this._root = null\n }\n\n Overlay.prototype.setZIndex = function(zIndex) {\n this._root.style.zIndex = zIndex\n }\n\n Overlay.prototype.getZIndex = function() {\n return this._root.style.zIndex\n }\n\n return Overlay\n}\n\nfunction latLngToPixel(latLng, map) {\n const projection = map.__overlayProjection\n if (!projection) {\n return new google.maps.Point(-Infinity, -Infinity)\n }\n\n return projection.fromLatLngToContainerPixel(latLng)\n}\n\nfunction pixelToLatLng(pixel, map) {\n const projection = map.__overlayProjection\n if (!projection) {\n return new google.maps.Point(-Infinity, -Infinity)\n }\n\n return projection.fromContainerPixelToLatLng(pixel)\n}\n\nGMapCoordSysProto.dimensions = GMapCoordSys.dimensions = ['lng', 'lat']\n\nGMapCoordSysProto.type = COMPONENT_TYPE\n\nexport default GMapCoordSys\n","import { ComponentModel } from 'echarts/lib/echarts'\nimport { COMPONENT_TYPE, isNewEC, v2Equal } from './helper'\n\nconst GMapModel = {\n type: COMPONENT_TYPE,\n\n setGoogleMap(gmap) {\n this.__gmap = gmap\n },\n\n getGoogleMap() {\n // __gmap is set when creating GMapCoordSys\n return this.__gmap\n },\n\n setEChartsLayer(layer) {\n this.__echartsLayer = layer\n },\n\n getEChartsLayer() {\n return this.__echartsLayer\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: { lat: 39.90923, lng: 116.397428 },\n zoom: 5,\n\n // extension options\n // since v1.4.0\n roam: true,\n echartsLayerZIndex: 2000,\n renderOnMoving: true\n }\n}\n\nexport default isNewEC\n ? ComponentModel.extend(GMapModel)\n : GMapModel\n","/* global google */\n\nimport { ComponentView, getInstanceByDom, throttle } from 'echarts/lib/echarts'\nimport { isNewEC, COMPONENT_TYPE } from './helper'\n\nconst GMapView = {\n type: COMPONENT_TYPE,\n\n render(gmapModel, ecModel, api) {\n let rendering = true\n\n const gmap = gmapModel.getGoogleMap()\n const viewportRoot = api.getZr().painter.getViewportRoot()\n const coordSys = gmapModel.coordinateSystem\n const renderOnMoving = gmapModel.get('renderOnMoving')\n const offsetEl = gmap.getDiv()\n const mapEl = offsetEl.firstChild\n const oldWidth = mapEl.clientWidth\n const oldHeight = mapEl.clientHeight\n\n let renderHandler = function() {\n if (rendering) {\n return\n }\n\n // reduce unnecessary resize\n if (mapEl.clientWidth !== oldWidth || mapEl.clientHeight !== oldHeight) {\n return resizeHandler()\n }\n\n const mapOffset = [\n -parseInt(offsetEl.style.left, 10) || 0,\n -parseInt(offsetEl.style.top, 10) || 0\n ]\n viewportRoot.style.left = mapOffset[0] + 'px'\n viewportRoot.style.top = mapOffset[1] + 'px'\n\n coordSys.setMapOffset(mapOffset)\n gmapModel.__mapOffset = mapOffset\n\n api.dispatchAction({\n type: COMPONENT_TYPE + 'Roam',\n animation: {\n // in ECharts 5.x,\n // we can set animation duration as 0\n // to ensure no delay when moving or zooming\n duration: 0\n }\n })\n }\n\n let resizeHandler = function() {\n // fix chart can't get resized correctly after the google map enters fullscreen\n // See also #14\n getInstanceByDom(api.getDom()).resize({\n width: mapEl.clientWidth,\n height: mapEl.clientHeight\n })\n }\n\n this._renderHandler && this._renderHandler.remove()\n\n if (!renderOnMoving) {\n // PENDING hide layer when rendering\n renderHandler = throttle(renderHandler, 100, true)\n resizeHandler = throttle(resizeHandler, 100, true)\n }\n this._renderHandler = google.maps.event.addListener(\n gmap,\n renderOnMoving ? 'gmaprender' : 'idle',\n renderHandler\n )\n\n gmap.setOptions({\n gestureHandling: gmapModel.get('roam') ? (gmapModel.get('gestureHandling') || 'auto') : 'none'\n })\n\n rendering = false\n },\n\n dispose() {\n this._renderHandler && this._renderHandler.remove()\n delete this._renderHandler\n\n const component = this.__model\n if (!component) {\n return\n }\n\n const gmapInstance = component.getGoogleMap()\n\n if (gmapInstance) {\n // remove injected projection\n delete gmapInstance.__overlayProjection\n\n // clear all listeners of map instance\n google.maps.event.clearInstanceListeners(gmapInstance)\n\n // remove DOM of map instance\n const mapDiv = gmapInstance.getDiv()\n mapDiv.parentNode && mapDiv.parentNode.removeChild(mapDiv)\n }\n\n component.setGoogleMap(null)\n component.setEChartsLayer(null)\n\n if (component.coordinateSystem) {\n component.coordinateSystem.setGoogleMap(null)\n component.coordinateSystem = null\n }\n }\n}\n\nexport default isNewEC\n ? ComponentView.extend(GMapView)\n : GMapView\n","/**\n * Google Map component extension\n */\n\nimport GMapCoordSys from './GMapCoordSys'\nimport GMapModel from './GMapModel'\nimport GMapView from './GMapView'\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 * Google Map extension installer\n * @param {EChartsExtensionRegisters} registers\n */\n export 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(GMapModel)\n : registers.extendComponentModel(GMapModel)\n // View\n isNewEC\n ? registers.registerComponentView(GMapView)\n : registers.extendComponentView(GMapView)\n // Coordinate System\n registers.registerCoordinateSystem(COMPONENT_TYPE, GMapCoordSys)\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(gmapModel) {\n const gmap = gmapModel.getGoogleMap()\n const center = gmap.getCenter()\n gmapModel.setCenterAndZoom([center.lng(), center.lat()], gmap.getZoom())\n })\n }\n )\n}\n","import * 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","dataToCoordSize","dataSize","dataItem","zrUtil","map","dimIdx","val","halfSize","p1","p2","Math","abs","this","dataToPoint","GMapCoordSys","gmap","api","_gmap","dimensions","_mapOffset","_api","Overlay","GMapCoordSysProto","prototype","excludedOptions","latLngToPixel","latLng","projection","__overlayProjection","fromLatLngToContainerPixel","google","maps","Point","Infinity","setZoom","zoom","_zoom","setCenter","center","latlng","LatLng","_center","setMapOffset","mapOffset","setGoogleMap","getGoogleMap","data","px","x","y","pointToData","pt","pixel","fromContainerPixelToLatLng","pixelToLatLng","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","gmapCoordSys","root","getDom","eachComponent","gmapModel","painter","getZr","viewportRoot","getViewportRoot","Map","Error","_root","setMap","OverlayView","onAdd","getMap","getProjection","getDiv","querySelector","appendChild","draw","event","trigger","onRemove","parentNode","removeChild","setZIndex","zIndex","style","getZIndex","createOverlayCtor","className","gmapRoot","left","top","document","createElement","cssText","options","clone","get","echartsLayerZIndex","each","key","isArray","__projectionChangeListener","remove","addListener","layer","getEChartsLayer","overlay","setEChartsLayer","getViewportRootOffset","offsetLeft","offsetTop","normalizedCenter","gmapCenter","getCenter","gmapZoom","getZoom","centerOrZoomChanged","setOptions","__mapOffset","coordinateSystem","eachSeries","seriesModel","GMapModel","__gmap","__echartsLayer","setCenterAndZoom","option","a","b","defaultOption","roam","renderOnMoving","ComponentModel","extend","GMapView","render","rendering","offsetEl","mapEl","firstChild","oldWidth","clientWidth","oldHeight","clientHeight","renderHandler","resizeHandler","parseInt","dispatchAction","animation","duration","getInstanceByDom","resize","_renderHandler","throttle","gestureHandling","dispose","component","__model","gmapInstance","clearInstanceListeners","mapDiv","ComponentView","install","registers","registerLayout","eachSeriesByType","getData","valueDim","mapDimension","point","cx","cy","idx","layout","getItemLayout","registerComponentModel","extendComponentModel","registerComponentView","extendComponentView","registerCoordinateSystem","registerAction","update","payload","echarts","use"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;+UAEO,IAAMA,EAAQC,EAAOA,QAACC,MAAM,KAEtBC,EAAUH,EAAM,GAAK,EA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,MAAOjB,EAAOkB,OAAQzC,EAAK4H,UAChE,GACF,GAEJ,CC9DA7I,EAAUiN,EAAQC,IAAItB,GAAWA,EAAQqB"} \ No newline at end of file diff --git a/examples/heatmap.html b/examples/heatmap.html index 97e68f2..95481bd 100644 --- a/examples/heatmap.html +++ b/examples/heatmap.html @@ -13,7 +13,7 @@ - +