From 9bf81b4f1f31cd273b2e9bde3b6bf1ddc86be6dc Mon Sep 17 00:00:00 2001 From: plainheart Date: Tue, 7 Sep 2021 11:18:53 +0800 Subject: [PATCH] [release] v1.4.0 --- README.md | 11 +- README.zh-CN.md | 9 +- dist/echarts-extension-gmap.js | 426 +++-------------------------- dist/echarts-extension-gmap.js.map | 2 +- dist/echarts-extension-gmap.min.js | 4 +- examples/index.html | 14 +- examples/index_zh_CN.html | 14 +- package-lock.json | 17 +- package.json | 5 +- 9 files changed, 76 insertions(+), 426 deletions(-) diff --git a/README.md b/README.md index 4f5e513..b30cfb6 100644 --- a/README.md +++ b/README.md @@ -72,14 +72,19 @@ option = { // See https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions for details // initial map center, accepts an array like [lng, lat] or an object like { lng, lat } center: [108.39, 39.9], + // center: { lng: 108.39, lat: 39.9 }, // initial map zoom zoom: 4, - // whether echarts layer should be rendered when the map is moving. Default is true. + + // whether echarts layer should be rendered when the map is moving. `true` by default. // if false, it will only be re-rendered after the map `moveend`. // It's better to set this option to false if data is large. renderOnMoving: true, - // the zIndex of echarts layer for Google Map, default value is 2000. - echartsLayerZIndex: 2019 + // the zIndex of echarts layer for Google Map. `2000` by default. + echartsLayerZIndex: 2019, + // whether to enable gesture handling. `true` by default. + // since v1.4.0 + roam: false // More initial options... }, diff --git a/README.zh-CN.md b/README.zh-CN.md index 9b77c33..4485415 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -76,8 +76,13 @@ option = { // 其他地图初始化参数... // https://developers.google.cn/maps/documentation/javascript/reference/map#MapOptions - // 移动过程中实时渲染 默认为true 如数据量较大 建议置为false - renderOnMoving: true + // 移动过程中实时渲染。默认为 true。如数据量较大,建议置为 false。 + renderOnMoving: true, + // 谷歌地图 ECharts 图层的 zIndex。默认为 2000。 + echartsLayerZIndex: 2019, + // 是否启用手势事件处理,如拖拽等。默认为 true。 + // 此配置项从 v1.4.0 起支持 + roam: true }, series: [ { diff --git a/dist/echarts-extension-gmap.js b/dist/echarts-extension-gmap.js index 9a65509..18da6eb 100644 --- a/dist/echarts-extension-gmap.js +++ b/dist/echarts-extension-gmap.js @@ -1,6 +1,6 @@ /*! * echarts-extension-gmap - * @version 1.3.1 + * @version 1.4.0 * @author plainheart * * MIT License @@ -32,8 +32,30 @@ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.echarts = global.echarts || {}, global.echarts.gmap = {}), global.echarts)); }(this, (function (exports, echarts) { 'use strict'; + function _interopNamespace(e) { + if (e && e.__esModule) return e; + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { + return e[k]; + } + }); + } + }); + } + n['default'] = e; + return Object.freeze(n); + } + + var echarts__namespace = /*#__PURE__*/_interopNamespace(echarts); + var name = "echarts-extension-gmap"; - var version = "1.3.1"; + var version = "1.4.0"; /* global google */ @@ -306,7 +328,7 @@ return a && b && a[0] === b[0] && a[1] === b[1]; } - echarts.extendComponentModel({ + echarts__namespace.extendComponentModel({ type: 'gmap', setGoogleMap: function(gmap) { @@ -341,394 +363,16 @@ zoom: 5, // extension options + // since v1.4.0 + roam: true, echartsLayerZIndex: 2000, renderOnMoving: true } }); - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - - /** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - - /** Used as references for various `Number` constants. */ - var NAN = 0 / 0; - - /** `Object#toString` result references. */ - var symbolTag = '[object Symbol]'; - - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g; - - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; - - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; - - /** Built-in method references without a dependency on `root`. */ - var freeParseInt = parseInt; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; - - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeMax = Math.max, - nativeMin = Math.min; - - /** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Date - * @returns {number} Returns the timestamp. - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred invocation. - */ - var now = function() { - return root.Date.now(); - }; - - /** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide `options` to indicate whether `func` should be invoked on the - * leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent - * calls to the debounced function return the result of the last `func` - * invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); - */ - function debounce(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; - - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } - - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } - - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - result = wait - timeSinceLastCall; - - return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; - } - - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; - - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); - } - - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } - - function trailingEdge(time) { - timerId = undefined; - - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined; - return result; - } - - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } - - function flush() { - return timerId === undefined ? result : trailingEdge(now()); - } - - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); - - lastArgs = arguments; - lastThis = this; - lastCallTime = time; - - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; - } - - /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); - } - - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ - function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); - } - - var lodash_debounce = debounce; - /* global google */ - echarts.extendComponentView({ + echarts__namespace.extendComponentView({ type: 'gmap', render: function(gmapModel, ecModel, api) { @@ -742,6 +386,10 @@ var oldWidth = offsetEl.clientWidth; var oldHeight = offsetEl.clientHeight; + gmap.setOptions({ + gestureHandling: gmapModel.get('roam') ? 'auto' : 'none' + }); + var renderHandler = function() { if (rendering) { return; @@ -776,14 +424,14 @@ }; var resizeHandler = function() { - echarts.getInstanceByDom(api.getDom()).resize(); + echarts__namespace.getInstanceByDom(api.getDom()).resize(); }; this._oldRenderHandler && this._oldRenderHandler.remove(); if (!renderOnMoving) { - renderHandler = lodash_debounce(renderHandler, 100); - resizeHandler = lodash_debounce(resizeHandler, 100); + renderHandler = echarts__namespace.throttle(renderHandler, 100, true); + resizeHandler = echarts__namespace.throttle(resizeHandler, 100, true); } this._oldRenderHandler = google.maps.event.addListener(gmap, 'gmaprender', renderHandler); @@ -828,10 +476,10 @@ * Google Map component extension */ - echarts.registerCoordinateSystem('gmap', GMapCoordSys); + echarts__namespace.registerCoordinateSystem('gmap', GMapCoordSys); // Action - echarts.registerAction( + echarts__namespace.registerAction( { type: 'gmapRoam', event: 'gmapRoam', diff --git a/dist/echarts-extension-gmap.js.map b/dist/echarts-extension-gmap.js.map index 3a9e075..39546ba 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/GMapCoordSys.js","../src/GMapModel.js","../node_modules/lodash.debounce/index.js","../src/GMapView.js","../src/index.js"],"sourcesContent":["/* global google */\n\nimport { util as zrUtil, graphic, matrix } from 'echarts';\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\nvar GMapCoordSysProto = GMapCoordSys.prototype;\n\n// exclude private and unsupported options\nvar excludedOptions = [\n 'echartsLayerZIndex',\n 'renderOnMoving'\n];\n\nGMapCoordSysProto.dimensions = ['lng', 'lat'];\n\nGMapCoordSysProto.setZoom = function(zoom) {\n this._zoom = zoom;\n};\n\nGMapCoordSysProto.setCenter = function(center) {\n var 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 var latlng = new google.maps.LatLng(data[1], data[0]);\n var px = latLngToPixel(latlng, this._gmap);\n var mapOffset = this._mapOffset;\n return [px.x - mapOffset[0], px.y - mapOffset[1]];\n};\n\nGMapCoordSysProto.pointToData = function(pt) {\n var mapOffset = this._mapOffset;\n var 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 var 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(data) {\n var rect = this.getViewRect();\n return {\n coordSys: {\n // The name exposed to user is always 'cartesian2d' but not 'grid'.\n type: 'gmap',\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\nfunction dataToCoordSize(dataSize, dataItem) {\n dataItem = dataItem || [0, 0];\n return zrUtil.map(\n [0, 1],\n function(dimIdx) {\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n var p1 = [];\n var 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// For deciding which dimensions to use when creating list data\nGMapCoordSys.dimensions = GMapCoordSysProto.dimensions;\n\nGMapCoordSys.create = function(ecModel, api) {\n var gmapCoordSys;\n var root = api.getDom();\n\n ecModel.eachComponent('gmap', function(gmapModel) {\n var painter = api.getZr().painter;\n var viewportRoot = painter.getViewportRoot();\n if (typeof google === 'undefined'\n || typeof google.maps === 'undefined'\n || typeof google.maps.Map === 'undefined') {\n throw new Error('It seems that Google Map API has not been loaded completely yet.');\n }\n Overlay = Overlay || createOverlayCtor();\n if (gmapCoordSys) {\n throw new Error('Only one google map component can exist');\n }\n var gmap = gmapModel.getGoogleMap();\n if (!gmap) {\n // Not support IE8\n var gmapRoot = root.querySelector('.ec-extension-google-map');\n if (gmapRoot) {\n // Reset viewport left and top, which will be changed\n // in moving handler in GMapView\n viewportRoot.style.left = '0px';\n viewportRoot.style.top = '0px';\n viewportRoot.style.width = '100%';\n viewportRoot.style.height = '100%';\n root.removeChild(gmapRoot);\n }\n gmapRoot = document.createElement('div');\n gmapRoot.className = 'ec-extension-google-map';\n gmapRoot.style.cssText = 'position:absolute;top:0;left:0;right:0;bottom:0;';\n root.appendChild(gmapRoot);\n\n var options = zrUtil.clone(gmapModel.get());\n var echartsLayerZIndex = options.echartsLayerZIndex;\n // delete excluded options\n zrUtil.each(excludedOptions, function(key) {\n delete options[key];\n });\n var 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 var layer = gmapModel.getEChartsLayer();\n layer && layer.setMap(null);\n\n var 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 var center = gmapModel.get('center');\n var normalizedCenter = [\n center.lng != null ? center.lng : center[0],\n center.lat != null ? center.lat : center[1]\n ];\n var zoom = gmapModel.get('zoom');\n if (center && zoom) {\n var gmapCenter = gmap.getCenter();\n var gmapZoom = gmap.getZoom();\n var centerOrZoomChanged = gmapModel.centerOrZoomChanged([gmapCenter.lng(), gmapCenter.lat()], gmapZoom);\n if (centerOrZoomChanged) {\n var 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') === 'gmap') {\n seriesModel.coordinateSystem = gmapCoordSys;\n }\n });\n};\n\nvar 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 var 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 var 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 var projection = map.__overlayProjection;\n if (!projection) {\n return new google.maps.Point(-Infinity, -Infinity);\n }\n\n return projection.fromContainerPixelToLatLng(pixel);\n}\n\nexport default GMapCoordSys;\n","import * as echarts from 'echarts';\n\nfunction v2Equal(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1];\n}\n\nexport default echarts.extendComponentModel({\n type: 'gmap',\n\n setGoogleMap: function(gmap) {\n this.__gmap = gmap;\n },\n\n getGoogleMap: function() {\n // __gmap is set when creating GMapCoordSys\n return this.__gmap;\n },\n\n setEChartsLayer: function(layer) {\n this.__echartsLayer = layer;\n },\n\n getEChartsLayer: function() {\n return this.__echartsLayer;\n },\n\n setCenterAndZoom: function(center, zoom) {\n this.option.center = center;\n this.option.zoom = zoom;\n },\n\n centerOrZoomChanged: function(center, zoom) {\n var 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 echartsLayerZIndex: 2000,\n renderOnMoving: true\n }\n});\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n","/* global google */\n\nimport * as echarts from 'echarts';\nimport debounce from 'lodash.debounce';\n\nexport default echarts.extendComponentView({\n type: 'gmap',\n\n render: function(gmapModel, ecModel, api) {\n var rendering = true;\n\n var gmap = gmapModel.getGoogleMap();\n var viewportRoot = api.getZr().painter.getViewportRoot();\n var coordSys = gmapModel.coordinateSystem;\n var offsetEl = gmap.getDiv();\n var renderOnMoving = gmapModel.get('renderOnMoving');\n var oldWidth = offsetEl.clientWidth;\n var oldHeight = offsetEl.clientHeight;\n\n var renderHandler = function() {\n if (rendering) {\n return;\n }\n\n // need resize?\n var width = offsetEl.clientWidth;\n var height = offsetEl.clientHeight;\n if (width !== oldWidth || height !== oldHeight) {\n return resizeHandler.call(this);\n }\n\n var 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: 'gmapRoam',\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 var resizeHandler = function() {\n echarts.getInstanceByDom(api.getDom()).resize();\n };\n\n this._oldRenderHandler && this._oldRenderHandler.remove();\n\n if (!renderOnMoving) {\n renderHandler = debounce(renderHandler, 100);\n resizeHandler = debounce(resizeHandler, 100);\n }\n\n this._oldRenderHandler = google.maps.event.addListener(gmap, 'gmaprender', renderHandler);\n\n rendering = false;\n },\n\n dispose: function(ecModel, api) {\n this._oldRenderHandler && this._oldRenderHandler.remove();\n this._oldRenderHandler = null;\n\n var component = ecModel.getComponent('gmap');\n if (!component) {\n return;\n }\n\n var 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 var 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","/**\n * Google Map component extension\n */\n\nimport { version, name } from '../package.json';\n\nimport * as echarts from 'echarts';\nimport GMapCoordSys from './GMapCoordSys';\n\nimport './GMapModel';\nimport './GMapView';\n\necharts.registerCoordinateSystem('gmap', GMapCoordSys);\n\n// Action\necharts.registerAction(\n {\n type: 'gmapRoam',\n event: 'gmapRoam',\n update: 'updateLayout'\n },\n function(payload, ecModel) {\n ecModel.eachComponent('gmap', function(gmapModel) {\n var gmap = gmapModel.getGoogleMap();\n var center = gmap.getCenter();\n gmapModel.setCenterAndZoom([center.lng(), center.lat()], gmap.getZoom());\n });\n }\n);\n\nexport { version, name };\n"],"names":["graphic","matrix","zrUtil","echarts.extendComponentModel","global","echarts.extendComponentView","echarts.getInstanceByDom","debounce","echarts.registerCoordinateSystem","echarts.registerAction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;AAGA;EACA,SAAS,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE;EACjC,EAAE,IAAI,CAAC,KAAK,GAAG,I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AO,CAAC,aAAa,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE;EACtD,MAAM,IAAI,IAAI,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC;EAC1C,MAAM,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;EACpC,MAAM,SAAS,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;EAC/E,KAAK,CAAC,CAAC;EACP,GAAG;EACH,CAAC;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"echarts-extension-gmap.js","sources":["../src/GMapCoordSys.js","../src/GMapModel.js","../src/GMapView.js","../src/index.js"],"sourcesContent":["/* global google */\n\nimport { util as zrUtil, graphic, matrix } from 'echarts';\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\nvar GMapCoordSysProto = GMapCoordSys.prototype;\n\n// exclude private and unsupported options\nvar excludedOptions = [\n 'echartsLayerZIndex',\n 'renderOnMoving'\n];\n\nGMapCoordSysProto.dimensions = ['lng', 'lat'];\n\nGMapCoordSysProto.setZoom = function(zoom) {\n this._zoom = zoom;\n};\n\nGMapCoordSysProto.setCenter = function(center) {\n var 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 var latlng = new google.maps.LatLng(data[1], data[0]);\n var px = latLngToPixel(latlng, this._gmap);\n var mapOffset = this._mapOffset;\n return [px.x - mapOffset[0], px.y - mapOffset[1]];\n};\n\nGMapCoordSysProto.pointToData = function(pt) {\n var mapOffset = this._mapOffset;\n var 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 var 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(data) {\n var rect = this.getViewRect();\n return {\n coordSys: {\n // The name exposed to user is always 'cartesian2d' but not 'grid'.\n type: 'gmap',\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\nfunction dataToCoordSize(dataSize, dataItem) {\n dataItem = dataItem || [0, 0];\n return zrUtil.map(\n [0, 1],\n function(dimIdx) {\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n var p1 = [];\n var 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// For deciding which dimensions to use when creating list data\nGMapCoordSys.dimensions = GMapCoordSysProto.dimensions;\n\nGMapCoordSys.create = function(ecModel, api) {\n var gmapCoordSys;\n var root = api.getDom();\n\n ecModel.eachComponent('gmap', function(gmapModel) {\n var painter = api.getZr().painter;\n var viewportRoot = painter.getViewportRoot();\n if (typeof google === 'undefined'\n || typeof google.maps === 'undefined'\n || typeof google.maps.Map === 'undefined') {\n throw new Error('It seems that Google Map API has not been loaded completely yet.');\n }\n Overlay = Overlay || createOverlayCtor();\n if (gmapCoordSys) {\n throw new Error('Only one google map component can exist');\n }\n var gmap = gmapModel.getGoogleMap();\n if (!gmap) {\n // Not support IE8\n var gmapRoot = root.querySelector('.ec-extension-google-map');\n if (gmapRoot) {\n // Reset viewport left and top, which will be changed\n // in moving handler in GMapView\n viewportRoot.style.left = '0px';\n viewportRoot.style.top = '0px';\n viewportRoot.style.width = '100%';\n viewportRoot.style.height = '100%';\n root.removeChild(gmapRoot);\n }\n gmapRoot = document.createElement('div');\n gmapRoot.className = 'ec-extension-google-map';\n gmapRoot.style.cssText = 'position:absolute;top:0;left:0;right:0;bottom:0;';\n root.appendChild(gmapRoot);\n\n var options = zrUtil.clone(gmapModel.get());\n var echartsLayerZIndex = options.echartsLayerZIndex;\n // delete excluded options\n zrUtil.each(excludedOptions, function(key) {\n delete options[key];\n });\n var 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 var layer = gmapModel.getEChartsLayer();\n layer && layer.setMap(null);\n\n var 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 var center = gmapModel.get('center');\n var normalizedCenter = [\n center.lng != null ? center.lng : center[0],\n center.lat != null ? center.lat : center[1]\n ];\n var zoom = gmapModel.get('zoom');\n if (center && zoom) {\n var gmapCenter = gmap.getCenter();\n var gmapZoom = gmap.getZoom();\n var centerOrZoomChanged = gmapModel.centerOrZoomChanged([gmapCenter.lng(), gmapCenter.lat()], gmapZoom);\n if (centerOrZoomChanged) {\n var 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') === 'gmap') {\n seriesModel.coordinateSystem = gmapCoordSys;\n }\n });\n};\n\nvar 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 var 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 var 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 var projection = map.__overlayProjection;\n if (!projection) {\n return new google.maps.Point(-Infinity, -Infinity);\n }\n\n return projection.fromContainerPixelToLatLng(pixel);\n}\n\nexport default GMapCoordSys;\n","import * as echarts from 'echarts';\n\nfunction v2Equal(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1];\n}\n\nexport default echarts.extendComponentModel({\n type: 'gmap',\n\n setGoogleMap: function(gmap) {\n this.__gmap = gmap;\n },\n\n getGoogleMap: function() {\n // __gmap is set when creating GMapCoordSys\n return this.__gmap;\n },\n\n setEChartsLayer: function(layer) {\n this.__echartsLayer = layer;\n },\n\n getEChartsLayer: function() {\n return this.__echartsLayer;\n },\n\n setCenterAndZoom: function(center, zoom) {\n this.option.center = center;\n this.option.zoom = zoom;\n },\n\n centerOrZoomChanged: function(center, zoom) {\n var 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","/* global google */\n\nimport * as echarts from 'echarts';\n\nexport default echarts.extendComponentView({\n type: 'gmap',\n\n render: function(gmapModel, ecModel, api) {\n var rendering = true;\n\n var gmap = gmapModel.getGoogleMap();\n var viewportRoot = api.getZr().painter.getViewportRoot();\n var coordSys = gmapModel.coordinateSystem;\n var offsetEl = gmap.getDiv();\n var renderOnMoving = gmapModel.get('renderOnMoving');\n var oldWidth = offsetEl.clientWidth;\n var oldHeight = offsetEl.clientHeight;\n\n gmap.setOptions({\n gestureHandling: gmapModel.get('roam') ? 'auto' : 'none'\n });\n\n var renderHandler = function() {\n if (rendering) {\n return;\n }\n\n // need resize?\n var width = offsetEl.clientWidth;\n var height = offsetEl.clientHeight;\n if (width !== oldWidth || height !== oldHeight) {\n return resizeHandler.call(this);\n }\n\n var 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: 'gmapRoam',\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 var resizeHandler = function() {\n echarts.getInstanceByDom(api.getDom()).resize();\n };\n\n this._oldRenderHandler && this._oldRenderHandler.remove();\n\n if (!renderOnMoving) {\n renderHandler = echarts.throttle(renderHandler, 100, true)\n resizeHandler = echarts.throttle(resizeHandler, 100, true)\n }\n\n this._oldRenderHandler = google.maps.event.addListener(gmap, 'gmaprender', renderHandler);\n\n rendering = false;\n },\n\n dispose: function(ecModel, api) {\n this._oldRenderHandler && this._oldRenderHandler.remove();\n this._oldRenderHandler = null;\n\n var component = ecModel.getComponent('gmap');\n if (!component) {\n return;\n }\n\n var 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 var 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","/**\n * Google Map component extension\n */\n\nimport { version, name } from '../package.json';\n\nimport * as echarts from 'echarts';\nimport GMapCoordSys from './GMapCoordSys';\n\nimport './GMapModel';\nimport './GMapView';\n\necharts.registerCoordinateSystem('gmap', GMapCoordSys);\n\n// Action\necharts.registerAction(\n {\n type: 'gmapRoam',\n event: 'gmapRoam',\n update: 'updateLayout'\n },\n function(payload, ecModel) {\n ecModel.eachComponent('gmap', function(gmapModel) {\n var gmap = gmapModel.getGoogleMap();\n var center = gmap.getCenter();\n gmapModel.setCenterAndZoom([center.lng(), center.lat()], gmap.getZoom());\n });\n }\n);\n\nexport { version, name };\n"],"names":["graphic","matrix","zrUtil","echarts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;AAGA;EACA,SAAS,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE;EACjC,EAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;EACpB,EAAE,IAAI,CAAC,UAAU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EAAE,UAAU;EACpB,IAAI,KAAK,EAAE,UAAU;EACrB,IAAI,MAAM,EAAE,cAAc;EAC1B,GAAG;EACH,EAAE,SAAS,OAAO,EAAE,OAAO,EAAE;EAC7B,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE;EACtD,MAAM,IAAI,IAAI,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC;EAC1C,MAAM,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;EACpC,MAAM,SAAS,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;EAC/E,KAAK,CAAC,CAAC;EACP,GAAG;EACH,CAAC;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/echarts-extension-gmap.min.js b/dist/echarts-extension-gmap.min.js index 9734658..f7ab1bf 100644 --- a/dist/echarts-extension-gmap.min.js +++ b/dist/echarts-extension-gmap.min.js @@ -1,6 +1,6 @@ /*! * echarts-extension-gmap - * @version 1.3.1 + * @version 1.4.0 * @author plainheart * * MIT License @@ -26,4 +26,4 @@ * SOFTWARE. * */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("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";function n(e,t){this._gmap=e,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}var o,i=n.prototype,r=["echartsLayerZIndex","renderOnMoving"];function a(e,n){return n=n||[0,0],t.util.map([0,1],(function(t){var o=n[t],i=e[t]/2,r=[],a=[];return r[t]=o-i,a[t]=o+i,r[1-t]=a[1-t]=n[1-t],Math.abs(this.dataToPoint(r)[t]-this.dataToPoint(a)[t])}),this)}function s(e,t){var n=t.__overlayProjection;return n?n.fromLatLngToContainerPixel(e):new google.maps.Point(-Infinity,-Infinity)}i.dimensions=["lng","lat"],i.setZoom=function(e){this._zoom=e},i.setCenter=function(e){var t=new google.maps.LatLng(e[1],e[0]);this._center=s(t,this._gmap)},i.setMapOffset=function(e){this._mapOffset=e},i.setGoogleMap=function(e){this._gmap=e},i.getGoogleMap=function(){return this._gmap},i.dataToPoint=function(e){var t=s(new google.maps.LatLng(e[1],e[0]),this._gmap),n=this._mapOffset;return[t.x-n[0],t.y-n[1]]},i.pointToData=function(e){var t=this._mapOffset,n=function(e,t){var n=t.__overlayProjection;if(!n)return new google.maps.Point(-Infinity,-Infinity);return n.fromContainerPixelToLatLng(e)}(new google.maps.Point(e[0]+t[0],e[1]+t[1]),this._gmap);return[n.lng(),n.lat()]},i.getViewRect=function(){var e=this._api;return new t.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},i.getRoamTransform=function(){return t.matrix.create()},i.prepareCustoms=function(e){var n=this.getViewRect();return{coordSys:{type:"gmap",x:n.x,y:n.y,width:n.width,height:n.height},api:{coord:t.util.bind(this.dataToPoint,this),size:t.util.bind(a,this)}}},n.dimensions=i.dimensions,n.create=function(e,i){var a,s=i.getDom();e.eachComponent("gmap",(function(e){var f=i.getZr().painter,l=f.getViewportRoot();if("undefined"==typeof google||"undefined"==typeof google.maps||"undefined"==typeof google.maps.Map)throw new Error("It seems that Google Map API has not been loaded completely yet.");if(o=o||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}(),a)throw new Error("Only one google map component can exist");var p=e.getGoogleMap();if(!p){var u=s.querySelector(".ec-extension-google-map");u&&(l.style.left="0px",l.style.top="0px",l.style.width="100%",l.style.height="100%",s.removeChild(u)),(u=document.createElement("div")).className="ec-extension-google-map",u.style.cssText="position:absolute;top:0;left:0;right:0;bottom:0;",s.appendChild(u);var g=t.util.clone(e.get()),c=g.echartsLayerZIndex;t.util.each(r,(function(e){delete g[e]}));var d=g.center;t.util.isArray(d)&&(g.center={lng:d[0],lat:d[1]}),p=new google.maps.Map(u,g),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 n=new o(l,p);n.setZIndex(c),e.setEChartsLayer(n)})),f.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}var m=[null!=(d=e.get("center")).lng?d.lng:d[0],null!=d.lat?d.lat:d[1]],h=e.get("zoom");if(d&&h){var y=p.getCenter(),v=p.getZoom();if(e.centerOrZoomChanged([y.lng(),y.lat()],v)){var _=new google.maps.LatLng(m[1],m[0]);p.setOptions({center:_,zoom:h})}}(a=new n(p,i)).setMapOffset(e.__mapOffset||[0,0]),a.setZoom(h),a.setCenter(m),e.coordinateSystem=a})),e.eachSeries((function(e){"gmap"===e.get("coordinateSystem")&&(e.coordinateSystem=a)}))},t.extendComponentModel({type:"gmap",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 n,o,i=this.option;return n=e,o=i.center,!(n&&o&&n[0]===o[0]&&n[1]===o[1]&&t===i.zoom)},defaultOption:{center:{lat:39.90923,lng:116.397428},zoom:5,echartsLayerZIndex:2e3,renderOnMoving:!0}});var f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l=/^\s+|\s+$/g,p=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,g=/^0o[0-7]+$/i,c=parseInt,d="object"==typeof f&&f&&f.Object===Object&&f,m="object"==typeof self&&self&&self.Object===Object&&self,h=d||m||Function("return this")(),y=Object.prototype.toString,v=Math.max,_=Math.min,w=function(){return h.Date.now()};function x(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function C(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==y.call(e)}(e))return NaN;if(x(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=x(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(l,"");var n=u.test(e);return n||g.test(e)?c(e.slice(2),n?2:8):p.test(e)?NaN:+e}var M=function(e,t,n){var o,i,r,a,s,f,l=0,p=!1,u=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function c(t){var n=o,r=i;return o=i=undefined,l=t,a=e.apply(r,n)}function d(e){return l=e,s=setTimeout(h,t),p?c(e):a}function m(e){var n=e-f;return f===undefined||n>=t||n<0||u&&e-l>=r}function h(){var e=w();if(m(e))return y(e);s=setTimeout(h,function(e){var n=t-(e-f);return u?_(n,r-(e-l)):n}(e))}function y(e){return s=undefined,g&&o?c(e):(o=i=undefined,a)}function M(){var e=w(),n=m(e);if(o=arguments,i=this,f=e,n){if(s===undefined)return d(f);if(u)return s=setTimeout(h,t),c(f)}return s===undefined&&(s=setTimeout(h,t)),a}return t=C(t)||0,x(n)&&(p=!!n.leading,r=(u="maxWait"in n)?v(C(n.maxWait)||0,t):r,g="trailing"in n?!!n.trailing:g),M.cancel=function(){s!==undefined&&clearTimeout(s),l=0,o=f=i=s=undefined},M.flush=function(){return s===undefined?a:y(w())},M};t.extendComponentView({type:"gmap",render:function(e,n,o){var i=!0,r=e.getGoogleMap(),a=o.getZr().painter.getViewportRoot(),s=e.coordinateSystem,f=r.getDiv(),l=e.get("renderOnMoving"),p=f.clientWidth,u=f.clientHeight,g=function(){if(!i){var t=f.clientWidth,n=f.clientHeight;if(t!==p||n!==u)return c.call(this);var r=[-parseInt(f.style.left,10)||0,-parseInt(f.style.top,10)||0];a.style.left=r[0]+"px",a.style.top=r[1]+"px",s.setMapOffset(r),e.__mapOffset=r,o.dispatchAction({type:"gmapRoam",animation:{duration:0}})}},c=function(){t.getInstanceByDom(o.getDom()).resize()};this._oldRenderHandler&&this._oldRenderHandler.remove(),l||(g=M(g,100),c=M(c,100)),this._oldRenderHandler=google.maps.event.addListener(r,"gmaprender",g),i=!1},dispose:function(e,t){this._oldRenderHandler&&this._oldRenderHandler.remove(),this._oldRenderHandler=null;var n=e.getComponent("gmap");if(n){var o=n.getGoogleMap();if(o){delete o.__overlayProjection,google.maps.event.clearInstanceListeners(o);var i=o.getDiv();i.parentNode&&i.parentNode.removeChild(i)}n.setGoogleMap(null),n.setEChartsLayer(null),n.coordinateSystem&&(n.coordinateSystem.setGoogleMap(null),n.coordinateSystem=null)}}}),t.registerCoordinateSystem("gmap",n),t.registerAction({type:"gmapRoam",event:"gmapRoam",update:"updateLayout"},(function(e,t){t.eachComponent("gmap",(function(e){var t=e.getGoogleMap(),n=t.getCenter();e.setCenterAndZoom([n.lng(),n.lat()],t.getZoom())}))})),e.name="echarts-extension-gmap",e.version="1.3.1",Object.defineProperty(e,"__esModule",{value:!0})})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("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";function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}})),t["default"]=e,Object.freeze(t)}var n=o(t);function r(e,t){this._gmap=e,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}var i,a=r.prototype,s=["echartsLayerZIndex","renderOnMoving"];function g(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 p(e,t){var o=t.__overlayProjection;return o?o.fromLatLngToContainerPixel(e):new google.maps.Point(-Infinity,-Infinity)}a.dimensions=["lng","lat"],a.setZoom=function(e){this._zoom=e},a.setCenter=function(e){var t=new google.maps.LatLng(e[1],e[0]);this._center=p(t,this._gmap)},a.setMapOffset=function(e){this._mapOffset=e},a.setGoogleMap=function(e){this._gmap=e},a.getGoogleMap=function(){return this._gmap},a.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]]},a.pointToData=function(e){var t=this._mapOffset,o=function(e,t){var o=t.__overlayProjection;if(!o)return new google.maps.Point(-Infinity,-Infinity);return o.fromContainerPixelToLatLng(e)}(new google.maps.Point(e[0]+t[0],e[1]+t[1]),this._gmap);return[o.lng(),o.lat()]},a.getViewRect=function(){var e=this._api;return new t.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},a.getRoamTransform=function(){return t.matrix.create()},a.prepareCustoms=function(e){var o=this.getViewRect();return{coordSys:{type:"gmap",x:o.x,y:o.y,width:o.width,height:o.height},api:{coord:t.util.bind(this.dataToPoint,this),size:t.util.bind(g,this)}}},r.dimensions=a.dimensions,r.create=function(e,o){var n,a=o.getDom();e.eachComponent("gmap",(function(e){var g=o.getZr().painter,p=g.getViewportRoot();if("undefined"==typeof google||"undefined"==typeof google.maps||"undefined"==typeof google.maps.Map)throw new Error("It seems that Google Map API has not been loaded completely yet.");if(i=i||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 can exist");var l=e.getGoogleMap();if(!l){var c=a.querySelector(".ec-extension-google-map");c&&(p.style.left="0px",p.style.top="0px",p.style.width="100%",p.style.height="100%",a.removeChild(c)),(c=document.createElement("div")).className="ec-extension-google-map",c.style.cssText="position:absolute;top:0;left:0;right:0;bottom:0;",a.appendChild(c);var d=t.util.clone(e.get()),f=d.echartsLayerZIndex;t.util.each(s,(function(e){delete d[e]}));var m=d.center;t.util.isArray(m)&&(d.center={lng:m[0],lat:m[1]}),l=new google.maps.Map(c,d),e.setGoogleMap(l),e.__projectionChangeListener&&e.__projectionChangeListener.remove(),e.__projectionChangeListener=google.maps.event.addListener(l,"projection_changed",(function(){var t=e.getEChartsLayer();t&&t.setMap(null);var o=new i(p,l);o.setZIndex(f),e.setEChartsLayer(o)})),g.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}var u=[null!=(m=e.get("center")).lng?m.lng:m[0],null!=m.lat?m.lat:m[1]],h=e.get("zoom");if(m&&h){var y=l.getCenter(),v=l.getZoom();if(e.centerOrZoomChanged([y.lng(),y.lat()],v)){var _=new google.maps.LatLng(u[1],u[0]);l.setOptions({center:_,zoom:h})}}(n=new r(l,o)).setMapOffset(e.__mapOffset||[0,0]),n.setZoom(h),n.setCenter(u),e.coordinateSystem=n})),e.eachSeries((function(e){"gmap"===e.get("coordinateSystem")&&(e.coordinateSystem=n)}))},n.extendComponentModel({type:"gmap",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 o=e,n=r.center,!(o&&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}}),n.extendComponentView({type:"gmap",render:function(e,t,o){var r=!0,i=e.getGoogleMap(),a=o.getZr().painter.getViewportRoot(),s=e.coordinateSystem,g=i.getDiv(),p=e.get("renderOnMoving"),l=g.clientWidth,c=g.clientHeight;i.setOptions({gestureHandling:e.get("roam")?"auto":"none"});var d=function(){if(!r){var t=g.clientWidth,n=g.clientHeight;if(t!==l||n!==c)return f.call(this);var i=[-parseInt(g.style.left,10)||0,-parseInt(g.style.top,10)||0];a.style.left=i[0]+"px",a.style.top=i[1]+"px",s.setMapOffset(i),e.__mapOffset=i,o.dispatchAction({type:"gmapRoam",animation:{duration:0}})}},f=function(){n.getInstanceByDom(o.getDom()).resize()};this._oldRenderHandler&&this._oldRenderHandler.remove(),p||(d=n.throttle(d,100,!0),f=n.throttle(f,100,!0)),this._oldRenderHandler=google.maps.event.addListener(i,"gmaprender",d),r=!1},dispose:function(e,t){this._oldRenderHandler&&this._oldRenderHandler.remove(),this._oldRenderHandler=null;var o=e.getComponent("gmap");if(o){var n=o.getGoogleMap();if(n){delete n.__overlayProjection,google.maps.event.clearInstanceListeners(n);var r=n.getDiv();r.parentNode&&r.parentNode.removeChild(r)}o.setGoogleMap(null),o.setEChartsLayer(null),o.coordinateSystem&&(o.coordinateSystem.setGoogleMap(null),o.coordinateSystem=null)}}}),n.registerCoordinateSystem("gmap",r),n.registerAction({type:"gmapRoam",event:"gmapRoam",update:"updateLayout"},(function(e,t){t.eachComponent("gmap",(function(e){var t=e.getGoogleMap(),o=t.getCenter();e.setCenterAndZoom([o.lng(),o.lat()],t.getZoom())}))})),e.name="echarts-extension-gmap",e.version="1.4.0",Object.defineProperty(e,"__esModule",{value:!0})})); diff --git a/examples/index.html b/examples/index.html index 450f81f..26e88fb 100644 --- a/examples/index.html +++ b/examples/index.html @@ -13,7 +13,7 @@ - +