From 7b1f7ec431a2c606b621618506acf75308281547 Mon Sep 17 00:00:00 2001 From: plainheart Date: Sat, 26 Sep 2020 03:02:24 +0800 Subject: [PATCH] [dev] use rollup to bundle instead of webpack. --- build/build.js | 233 ++++ build/config.js | 54 + build/header.js | 37 + dist/echarts-extension-gmap.js | 1689 ++++++++++++---------------- dist/echarts-extension-gmap.js.map | 2 +- dist/echarts-extension-gmap.min.js | 30 +- package.json | 17 +- webpack.config.js | 27 - 8 files changed, 1108 insertions(+), 981 deletions(-) create mode 100644 build/build.js create mode 100644 build/config.js create mode 100644 build/header.js delete mode 100644 webpack.config.js diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..0c3d8fe --- /dev/null +++ b/build/build.js @@ -0,0 +1,233 @@ +const path = require('path'); +const fsExtra = require('fs-extra'); +const commander = require('commander'); +const rollup = require('rollup'); +const config = require('./config'); +const { name } = require('../package.json'); + +function run() { + const descIndent = ' '; + const egIndent = ' '; + + commander + .usage('[options]') + .description([ + `Build ${name} and generate result files in directory \`dist\`.`, + '', + ' For example:', + '', + egIndent + 'node build/build.js --release' + + '\n' + descIndent + '# Build all to `dist` folder.', + egIndent + 'node build/build.js' + + '\n' + descIndent + `# Only generate \`dist/${name}.js\`.`, + egIndent + 'node build/build.js --min' + + '\n' + descIndent + `# Only generate \`dist/${name}.min.js\`.`, + ].join('\n')) + .option( + '-w, --watch', [ + 'Watch modifications of files and auto-compile to dist file. For example,', + descIndent + `\`dist/${name}.js\`.` + ].join('\n')) + .option( + '--release', + 'Build all for release' + ) + .option( + '--min', + 'Whether to compress the output file' + ) + .parse(process.argv); + + const isWatch = !!commander.watch; + const isRelease = !!commander.release; + + const opt = { + min: commander.min, + addBundleVersion: isWatch + }; + + if (isRelease) { + fsExtra.emptyDirSync(path.resolve(__dirname, '../dist')); + } + + if (isWatch) { + watch(config(opt)); + } + else if (isRelease) { + const configs = [ + { min: false }, + { min: true } + ].map(function (conf) { + return config(conf); + }); + + build(configs).then(function () { + console.log( + color('fgGreen', 'dim')('\nBuild completely') + ); + }).catch(function (err) { + console.error(err); + }); + } + else { + build([config(opt)]).then(function () { + console.log( + color('fgGreen', 'dim')('\nBuild completely') + ); + }) + .catch(function (err) { + console.error(err); + }); + } +} + +function build(configs) { + return new Promise(function (resolve, reject) { + let index = 0; + + buildSingle(); + + function buildSingle() { + const config = configs[index++]; + + if (!config) { + resolve(); + return; + } + + console.log( + color('fgCyan', 'dim')('\nBundling '), + color('fgCyan')(config.input), + color('fgCyan', 'dim')('=>'), + color('fgCyan')(config.output.file), + color('fgCyan', 'dim')(' ...') + ); + + rollup.rollup(config).then(function (bundle) { + return bundle.write(config.output); + }) + .then(function () { + console.log( + color('fgGreen', 'dim')('\nCreated '), + color('fgGreen')(config.output.file), + color('fgGreen', 'dim')(' successfully.') + ); + buildSingle(); + }) + .catch(function (err) { + console.error(err) + reject(); + }); + } + }); +}; + +function watch(config) { + const watcher = rollup.watch(config); + + watcher.on('event', function (event) { + // event.code can be one of: + // START — the watcher is (re)starting + // BUNDLE_START — building an individual bundle + // BUNDLE_END — finished building a bundle + // END — finished building all bundles + // ERROR — encountered an error while bundling + // FATAL — encountered an unrecoverable error + if (event.code !== 'START' && event.code !== 'END') { + console.log( + color('fgBlue')('[' + getTimeString() + ']'), + color('dim')('build'), + event.code.replace(/_/g, ' ').toLowerCase() + ); + } + if (event.code === 'ERROR' || event.code === 'FATAL') { + printCodeError(event.error); + } + if (event.code === 'BUNDLE_END') { + printWatchResult(event); + } + }); +} + +function printWatchResult(event) { + console.log( + color('fgGreen', 'dim')('Created'), + color('fgGreen')(event.output.join(', ')), + color('fgGreen', 'dim')('in'), + color('fgGreen')(event.duration), + color('fgGreen', 'dim')('ms.') + ); +} + +function printCodeError(error) { + console.log('\n' + color()(error.code)); + if (error.code === 'PARSE_ERROR') { + console.log( + color()('line'), + color('fgCyan')(error.loc.line), + color()('column'), + color('fgCyan')(error.loc.column), + color()('in'), + color('fgCyan')(error.loc.file) + ); + } + if (error.frame) { + console.log('\n' + color('fgRed')(error.frame)); + } + console.log(color('dim')('\n' + error.stack)); +} + +function getTimeString() { + return (new Date()).toLocaleString(); +} + +const COLOR_RESET = '\x1b[0m'; +const COLOR_MAP = { + bright: '\x1b[1m', + dim: '\x1b[2m', + underscore: '\x1b[4m', + blink: '\x1b[5m', + reverse: '\x1b[7m', + hidden: '\x1b[8m', + + fgBlack: '\x1b[30m', + fgRed: '\x1b[31m', + fgGreen: '\x1b[32m', + fgYellow: '\x1b[33m', + fgBlue: '\x1b[34m', + fgMagenta: '\x1b[35m', + fgCyan: '\x1b[36m', + fgWhite: '\x1b[37m', + + bgBlack: '\x1b[40m', + bgRed: '\x1b[41m', + bgGreen: '\x1b[42m', + bgYellow: '\x1b[43m', + bgBlue: '\x1b[44m', + bgMagenta: '\x1b[45m', + bgCyan: '\x1b[46m', + bgWhite: '\x1b[47m' +}; + +/** + * Print colored text with `console.log`. + * + * Usage: + * let color = require('colorConsole'); + * color('fgCyan')('some text'); // cyan text. + * color('fgCyan', 'bright')('some text'); // bright cyan text. + * color('fgCyan', 'bgRed')('some text') // cyan text and red background. + */ +function color() { + const prefix = []; + for (let i = 0, len = arguments.length, color; i < len; i++) { + color = COLOR_MAP[arguments[i]]; + color && prefix.push(color); + } + + return function (text) { + return prefix.join('') + text + COLOR_RESET; + }; +}; + +run(); diff --git a/build/config.js b/build/config.js new file mode 100644 index 0000000..6fa11a7 --- /dev/null +++ b/build/config.js @@ -0,0 +1,54 @@ +const path = require('path'); +const json = require('@rollup/plugin-json'); +const commonjs = require('@rollup/plugin-commonjs'); +const { nodeResolve } = require('@rollup/plugin-node-resolve'); +const { terser } = require('rollup-plugin-terser'); +const { getLicense } = require('./header'); + +function getPlugins({ min, addBundleVersion }) { + const plugins = [ + nodeResolve(), + commonjs(), + json() + ]; + + addBundleVersion && plugins.push({ + outro: function () { + return 'exports.bundleVersion = \'' + (+new Date()) + '\';'; + } + }); + + min && plugins.push(terser({ + ie8: true + })); + + return plugins; +} + +module.exports = function (opt/*{ min, addBundleVersion }*/) { + const outputFileName = 'echarts-extension-gmap' + (opt.min ? '.min.js' : '.js'); + return { + plugins: getPlugins(opt), + input: path.resolve(__dirname, '../src/index.js'), + // deprecate by https://github.com/rollup/rollup/pull/2141 + // legacy: true, + external: ['echarts'], + output: { + name: 'echarts.gmap', + format: 'umd', + sourcemap: !opt.min, + banner: getLicense(), + // legacy: true, + file: path.resolve(__dirname, '../dist/', outputFileName), + globals: { + // For UMD `global.echarts` + echarts: 'echarts' + } + }, + watch: { + include: [ + path.resolve(__dirname, '../src/**') + ] + } + } +} diff --git a/build/header.js b/build/header.js new file mode 100644 index 0000000..e4278e2 --- /dev/null +++ b/build/header.js @@ -0,0 +1,37 @@ +const fs = require('fs'); +const path = require('path'); +const { name, version, author } = require('../package.json'); + +const COMMENT_END_REGEX = /\*\//g; + +function getLicense(raw) { + const license = fs.readFileSync( + path.resolve(__dirname, '../LICENSE'), + { encoding: 'utf-8' } + ); + const content = `${name} \n@version ${version}\n@author ${author}\n\n${license}`; + return raw ? content : wrapComment(content); +} + +function toComment(str) { + if (!str) { + return ''; + }; + return `/*! ${str.replace(COMMENT_END_REGEX, "* /")} */`; +} + +function wrapComment(str) { + if (!str.includes('\n')) { + return toComment(str); + } + return `/*!\n * ${str + .replace(/\*\//g, "* /") + .split("\n") + .join("\n * ")}\n */`; +}; + +module.exports = { + getLicense, + toComment, + wrapComment +} diff --git a/dist/echarts-extension-gmap.js b/dist/echarts-extension-gmap.js index b522899..824cd5a 100644 --- a/dist/echarts-extension-gmap.js +++ b/dist/echarts-extension-gmap.js @@ -1,1054 +1,849 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(require("echarts")); - else if(typeof define === 'function' && define.amd) - define("gmap", ["echarts"], factory); - else if(typeof exports === 'object') - exports["gmap"] = factory(require("echarts")); - else - root["echarts"] = root["echarts"] || {}, root["echarts"]["gmap"] = factory(root["echarts"]); -})(this, function(__WEBPACK_EXTERNAL_MODULE_echarts__) { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./src/index.js"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./node_modules/lodash.debounce/index.js": -/*!***********************************************!*\ - !*** ./node_modules/lodash.debounce/index.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global) {/** - * 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 +/*! + * echarts-extension-gmap + * @version 1.2.0 + * @author plainheart + * + * MIT License + * + * Copyright (c) 2020 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * */ - -/** 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 global == 'object' && global && global.Object === Object && global; - -/** 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 (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('echarts')) : + typeof define === 'function' && define.amd ? define(['exports', 'echarts'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.echarts = global.echarts || {}, global.echarts.gmap = {}), global.echarts)); +}(this, (function (exports, echarts) { 'use strict'; + + var name = "echarts-extension-gmap"; + var version = "1.2.0"; + + /* global google */ + + function GMapCoordSys(gmap, api) { + this._gmap = gmap; + this.dimensions = ['lng', 'lat']; + this._mapOffset = [0, 0]; + this._api = api; } - 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; - } + var GMapCoordSysProto = GMapCoordSys.prototype; - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - result = wait - timeSinceLastCall; + // exclude private and unsupported options + var excludedOptions = [ + 'echartsLayerZIndex', + 'renderOnMoving' + ]; - return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; - } + GMapCoordSysProto.dimensions = ['lng', 'lat']; - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; + GMapCoordSysProto.setZoom = function(zoom) { + this._zoom = zoom; + }; - // 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)); - } + GMapCoordSysProto.setCenter = function(center) { + var latlng = new google.maps.LatLng(center[1], center[0]); + this._center = latLngToPixel(latlng, this._gmap); + }; - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } + GMapCoordSysProto.setMapOffset = function(mapOffset) { + this._mapOffset = mapOffset; + }; - function trailingEdge(time) { - timerId = undefined; + GMapCoordSysProto.setGoogleMap = function(gmap) { + this._gmap = gmap; + }; - // 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; - } + GMapCoordSysProto.getGoogleMap = function() { + return this._gmap; + }; - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); + GMapCoordSysProto.dataToPoint = function(data) { + var latlng = new google.maps.LatLng(data[1], data[0]); + var px = latLngToPixel(latlng, this._gmap); + if (px) { + var mapOffset = this._mapOffset; + return [px.x - mapOffset[0], px.y - mapOffset[1]]; } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } + }; - function flush() { - return timerId === undefined ? result : trailingEdge(now()); - } + GMapCoordSysProto.pointToData = function(pt) { + var mapOffset = this._mapOffset; + var latlng = pixelToLatLng( + new google.maps.Point(pt[0] + mapOffset[0], pt[1] + mapOffset[1]), + this._gmap + ); + return [latlng.lng(), latlng.lat()]; + }; - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); + GMapCoordSysProto.getViewRect = function() { + var api = this._api; + return new echarts.graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight()); + }; - lastArgs = arguments; - lastThis = this; - lastCallTime = time; + GMapCoordSysProto.getRoamTransform = function() { + return echarts.matrix.create(); + }; - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); + GMapCoordSysProto.prepareCustoms = function(data) { + var rect = this.getViewRect(); + return { + coordSys: { + // The name exposed to user is always 'cartesian2d' but not 'grid'. + type: 'gmap', + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height + }, + api: { + coord: echarts.util.bind(this.dataToPoint, this), + size: echarts.util.bind(dataToCoordSize, this) } - } - 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); -} - -module.exports = debounce; - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "./node_modules/webpack/buildin/global.js": -/*!***********************************!*\ - !*** (webpack)/buildin/global.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || new Function("return this")(); -} catch (e) { - // This works if the window reference is available - if (typeof window === "object") g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - -/***/ }), - -/***/ "./package.json": -/*!**********************!*\ - !*** ./package.json ***! - \**********************/ -/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, bugs, homepage, devDependencies, dependencies, default */ -/***/ (function(module) { - -module.exports = JSON.parse("{\"name\":\"echarts-extension-gmap\",\"version\":\"1.2.0\",\"description\":\"An Google Map(https://www.google.com/maps) extension for Apache ECharts (incubating) (https://github.com/apache/incubator-echarts)\",\"main\":\"dist/echarts-extension-gmap.min.js\",\"scripts\":{\"build\":\"webpack --env=production --optimize-minimize --progress --colors\",\"dev\":\"webpack --env=development\",\"watch\":\"webpack --env=development --watch\",\"test\":\"echo \\\"Error: no test specified\\\" && exit 1\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/plainheart/echarts-extension-gmap.git\"},\"keywords\":[\"echarts\",\"google-maps\",\"google\",\"echarts-extention\",\"data-visualization\",\"map\",\"echarts-gmap\",\"echarts-google-map\",\"echarts4\",\"echarts5\",\"gmap\"],\"author\":\"plainheart\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/plainheart/echarts-extension-gmap/issues\"},\"homepage\":\"https://github.com/plainheart/echarts-extension-gmap#readme\",\"devDependencies\":{\"webpack\":\"^4.29.5\",\"webpack-cli\":\"^3.2.3\"},\"dependencies\":{\"lodash.debounce\":\"^4.0.8\"}}"); - -/***/ }), - -/***/ "./src/GMapCoordSys.js": -/*!*****************************!*\ - !*** ./src/GMapCoordSys.js ***! - \*****************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var echarts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! echarts */ "echarts"); -/* harmony import */ var echarts__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(echarts__WEBPACK_IMPORTED_MODULE_0__); -/* global google */ - - - -function GMapCoordSys(gmap, api) { - this._gmap = gmap; - this.dimensions = ['lng', 'lat']; - this._mapOffset = [0, 0]; - this._api = api; -} - -var GMapCoordSysProto = GMapCoordSys.prototype; - -// exclude private and unsupported options -var excludedOptions = [ - 'echartsLayerZIndex', - 'renderOnMoving' -]; + }; + }; -GMapCoordSysProto.dimensions = ['lng', 'lat']; + function dataToCoordSize(dataSize, dataItem) { + dataItem = dataItem || [0, 0]; + return echarts.util.map( + [0, 1], + function(dimIdx) { + var val = dataItem[dimIdx]; + var halfSize = dataSize[dimIdx] / 2; + var p1 = []; + var p2 = []; + p1[dimIdx] = val - halfSize; + p2[dimIdx] = val + halfSize; + p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx]; + return Math.abs( + this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx] + ); + }, + this + ); + } -GMapCoordSysProto.setZoom = function(zoom) { - this._zoom = zoom; -}; + // For deciding which dimensions to use when creating list data + GMapCoordSys.dimensions = GMapCoordSysProto.dimensions; -GMapCoordSysProto.setCenter = function(center) { - var latlng = new google.maps.LatLng(center[1], center[0]); - this._center = latLngToPixel(latlng, this._gmap); -}; + GMapCoordSys.create = function(ecModel, api) { + var gmapCoordSys; + var root = api.getDom(); -GMapCoordSysProto.setMapOffset = function(mapOffset) { - this._mapOffset = mapOffset; -}; + ecModel.eachComponent('gmap', function(gmapModel) { + var painter = api.getZr().painter; + var viewportRoot = painter.getViewportRoot(); + if (typeof google === 'undefined' + || typeof google.maps === 'undefined' + || typeof google.maps.Map === 'undefined') { + throw new Error('It seems that Google Map API has not been loaded completely yet.'); + } + Overlay = Overlay || createOverlayCtor(); + if (gmapCoordSys) { + throw new Error('Only one google map component can exist'); + } + var gmap = gmapModel.getGoogleMap(); + if (!gmap) { + // Not support IE8 + var gmapRoot = root.querySelector('.ec-extension-google-map'); + if (gmapRoot) { + // Reset viewport left and top, which will be changed + // in moving handler in GMapView + viewportRoot.style.left = '0px'; + viewportRoot.style.top = '0px'; + viewportRoot.style.width = '100%'; + viewportRoot.style.height = '100%'; + root.removeChild(gmapRoot); + } + gmapRoot = document.createElement('div'); + gmapRoot.style.cssText = 'width:100%;height:100%'; + // Not support IE8 + gmapRoot.classList.add('ec-extension-google-map'); + root.appendChild(gmapRoot); + + var options = echarts.util.clone(gmapModel.get()); + var echartsLayerZIndex = options.echartsLayerZIndex; + // delete excluded options + echarts.util.each(excludedOptions, function(key) { + delete options[key]; + }); + var center = options.center; + // normalize center + if (echarts.util.isArray(center)) { + options.center = { + lng: center[0], + lat: center[1] + }; + } -GMapCoordSysProto.setGoogleMap = function(gmap) { - this._gmap = gmap; -}; + gmap = new google.maps.Map(gmapRoot, options); + gmapModel.setGoogleMap(gmap); -GMapCoordSysProto.getGoogleMap = function() { - return this._gmap; -}; + gmapModel.__projectionChangeListener && gmapModel.__projectionChangeListener.remove(); + gmapModel.__projectionChangeListener = google.maps.event.addListener(gmap, 'projection_changed', + function() { + var layer = gmapModel.getEChartsLayer(); + layer && layer.setMap(null); -GMapCoordSysProto.dataToPoint = function(data) { - var latlng = new google.maps.LatLng(data[1], data[0]); - var px = latLngToPixel(latlng, this._gmap); - if (px) { - var mapOffset = this._mapOffset; - return [px.x - mapOffset[0], px.y - mapOffset[1]]; - } -}; + var overlay = new Overlay(viewportRoot, gmap); + overlay.setZIndex(echartsLayerZIndex); + gmapModel.setEChartsLayer(overlay); + } + ); -GMapCoordSysProto.pointToData = function(pt) { - var mapOffset = this._mapOffset; - var latlng = pixelToLatLng( - new google.maps.Point(pt[0] + mapOffset[0], pt[1] + mapOffset[1]), - this._gmap - ); - return [latlng.lng(), latlng.lat()]; -}; - -GMapCoordSysProto.getViewRect = function() { - var api = this._api; - return new echarts__WEBPACK_IMPORTED_MODULE_0__["graphic"].BoundingRect(0, 0, api.getWidth(), api.getHeight()); -}; - -GMapCoordSysProto.getRoamTransform = function() { - return echarts__WEBPACK_IMPORTED_MODULE_0__["matrix"].create(); -}; - -GMapCoordSysProto.prepareCustoms = function(data) { - var rect = this.getViewRect(); - return { - coordSys: { - // The name exposed to user is always 'cartesian2d' but not 'grid'. - type: 'gmap', - x: rect.x, - y: rect.y, - width: rect.width, - height: rect.height - }, - api: { - coord: echarts__WEBPACK_IMPORTED_MODULE_0__["util"].bind(this.dataToPoint, this), - size: echarts__WEBPACK_IMPORTED_MODULE_0__["util"].bind(dataToCoordSize, this) - } - }; -}; - -function dataToCoordSize(dataSize, dataItem) { - dataItem = dataItem || [0, 0]; - return echarts__WEBPACK_IMPORTED_MODULE_0__["util"].map( - [0, 1], - function(dimIdx) { - var val = dataItem[dimIdx]; - var halfSize = dataSize[dimIdx] / 2; - var p1 = []; - var p2 = []; - p1[dimIdx] = val - halfSize; - p2[dimIdx] = val + halfSize; - p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx]; - return Math.abs( - this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx] - ); - }, - this - ); -} - -// For deciding which dimensions to use when creating list data -GMapCoordSys.dimensions = GMapCoordSysProto.dimensions; - -GMapCoordSys.create = function(ecModel, api) { - var gmapCoordSys; - var root = api.getDom(); - - ecModel.eachComponent('gmap', function(gmapModel) { - var painter = api.getZr().painter; - var viewportRoot = painter.getViewportRoot(); - if (typeof google === 'undefined' - || typeof google.maps === 'undefined' - || typeof google.maps.Map === 'undefined') { - throw new Error('It seems that Google Map API has not been loaded completely yet.'); - } - Overlay = Overlay || createOverlayCtor(); - if (gmapCoordSys) { - throw new Error('Only one google map component can exist'); - } - var gmap = gmapModel.getGoogleMap(); - if (!gmap) { - // Not support IE8 - var gmapRoot = root.querySelector('.ec-extension-google-map'); - if (gmapRoot) { - // Reset viewport left and top, which will be changed - // in moving handler in GMapView - viewportRoot.style.left = '0px'; - viewportRoot.style.top = '0px'; - viewportRoot.style.width = '100%'; - viewportRoot.style.height = '100%'; - root.removeChild(gmapRoot); - } - gmapRoot = document.createElement('div'); - gmapRoot.style.cssText = 'width:100%;height:100%'; - // Not support IE8 - gmapRoot.classList.add('ec-extension-google-map'); - root.appendChild(gmapRoot); - - var options = echarts__WEBPACK_IMPORTED_MODULE_0__["util"].clone(gmapModel.get()); - var echartsLayerZIndex = options.echartsLayerZIndex; - // delete excluded options - echarts__WEBPACK_IMPORTED_MODULE_0__["util"].each(excludedOptions, function(key) { - delete options[key]; - }); - var center = options.center; - // normalize center - if (echarts__WEBPACK_IMPORTED_MODULE_0__["util"].isArray(center)) { - options.center = { - lng: center[0], - lat: center[1] + // Override + painter.getViewportRootOffset = function() { + return { offsetLeft: 0, offsetTop: 0 }; }; } - gmap = new google.maps.Map(gmapRoot, options); - gmapModel.setGoogleMap(gmap); - - gmapModel.__projectionChangeListener && gmapModel.__projectionChangeListener.remove(); - gmapModel.__projectionChangeListener = google.maps.event.addListener(gmap, 'projection_changed', - function() { - var layer = gmapModel.getEChartsLayer(); - layer && layer.setMap(null); - - var overlay = new Overlay(viewportRoot, gmap); - overlay.setZIndex(echartsLayerZIndex); - gmapModel.setEChartsLayer(overlay); + var center = gmapModel.get('center'); + var normalizedCenter = [ + center.lng != null ? center.lng : center[0], + center.lat != null ? center.lat : center[1] + ]; + var zoom = gmapModel.get('zoom'); + if (center && zoom) { + var gmapCenter = gmap.getCenter(); + var gmapZoom = gmap.getZoom(); + var centerOrZoomChanged = gmapModel.centerOrZoomChanged([gmapCenter.lng(), gmapCenter.lat()], gmapZoom); + if (centerOrZoomChanged) { + var pt = new google.maps.LatLng(normalizedCenter[1], normalizedCenter[0]); + gmap.setOptions({ + center: pt, + zoom: zoom + }); } - ); - - // Override - painter.getViewportRootOffset = function() { - return { offsetLeft: 0, offsetTop: 0 }; - }; - } - - var center = gmapModel.get('center'); - var normalizedCenter = [ - center.lng != null ? center.lng : center[0], - center.lat != null ? center.lat : center[1] - ]; - var zoom = gmapModel.get('zoom'); - if (center && zoom) { - var gmapCenter = gmap.getCenter(); - var gmapZoom = gmap.getZoom(); - var centerOrZoomChanged = gmapModel.centerOrZoomChanged([gmapCenter.lng(), gmapCenter.lat()], gmapZoom); - if (centerOrZoomChanged) { - var pt = new google.maps.LatLng(normalizedCenter[1], normalizedCenter[0]); - gmap.setOptions({ - center: pt, - zoom: zoom - }); } - } - gmapCoordSys = new GMapCoordSys(gmap, api); - gmapCoordSys.setMapOffset(gmapModel.__mapOffset || [0, 0]); - gmapCoordSys.setZoom(zoom); - gmapCoordSys.setCenter(normalizedCenter); + gmapCoordSys = new GMapCoordSys(gmap, api); + gmapCoordSys.setMapOffset(gmapModel.__mapOffset || [0, 0]); + gmapCoordSys.setZoom(zoom); + gmapCoordSys.setCenter(normalizedCenter); - gmapModel.coordinateSystem = gmapCoordSys; - }); - - ecModel.eachSeries(function(seriesModel) { - if (seriesModel.get('coordinateSystem') === 'gmap') { - seriesModel.coordinateSystem = gmapCoordSys; - } - }); -}; + gmapModel.coordinateSystem = gmapCoordSys; + }); -var Overlay; + ecModel.eachSeries(function(seriesModel) { + if (seriesModel.get('coordinateSystem') === 'gmap') { + seriesModel.coordinateSystem = gmapCoordSys; + } + }); + }; -function createOverlayCtor() { - function Overlay(root, gmap) { - this._root = root; - this.setMap(gmap); - } + var Overlay; - Overlay.prototype = new google.maps.OverlayView(); + function createOverlayCtor() { + function Overlay(root, gmap) { + this._root = root; + this.setMap(gmap); + } - Overlay.prototype.onAdd = function() { - var gmap = this.getMap(); - gmap.__overlayProjection = this.getProjection(); - gmap.getDiv().querySelector('.gm-style > div').appendChild(this._root); - }; + Overlay.prototype = new google.maps.OverlayView(); - /** - * @override - */ - Overlay.prototype.draw = function() { - google.maps.event.trigger(this.getMap(), 'gmaprender'); - }; + Overlay.prototype.onAdd = function() { + var gmap = this.getMap(); + gmap.__overlayProjection = this.getProjection(); + gmap.getDiv().querySelector('.gm-style > div').appendChild(this._root); + }; - Overlay.prototype.onRemove = function() { - this._root.parentNode.removeChild(this._root); - this._root = null; - }; + /** + * @override + */ + Overlay.prototype.draw = function() { + google.maps.event.trigger(this.getMap(), 'gmaprender'); + }; - Overlay.prototype.setZIndex = function(zIndex) { - this._root.style.zIndex = zIndex; - }; + Overlay.prototype.onRemove = function() { + this._root.parentNode.removeChild(this._root); + this._root = null; + }; - Overlay.prototype.getZIndex = function() { - return this._root.style.zIndex; - }; + Overlay.prototype.setZIndex = function(zIndex) { + this._root.style.zIndex = zIndex; + }; - return Overlay; -} + Overlay.prototype.getZIndex = function() { + return this._root.style.zIndex; + }; -function latLngToPixel(latLng, map) { - var projection = map.__overlayProjection; - if (!projection) { - return; + return Overlay; } - return projection.fromLatLngToContainerPixel(latLng); -} + function latLngToPixel(latLng, map) { + var projection = map.__overlayProjection; + if (!projection) { + return; + } -function pixelToLatLng(pixel, map) { - var projection = map.__overlayProjection; - if (!projection) { - return; + return projection.fromLatLngToContainerPixel(latLng); } - return projection.fromContainerPixelToLatLng(pixel); -} - -/* harmony default export */ __webpack_exports__["default"] = (GMapCoordSys); - - -/***/ }), - -/***/ "./src/GMapModel.js": -/*!**************************!*\ - !*** ./src/GMapModel.js ***! - \**************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + function pixelToLatLng(pixel, map) { + var projection = map.__overlayProjection; + if (!projection) { + return; + } -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var echarts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! echarts */ "echarts"); -/* harmony import */ var echarts__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(echarts__WEBPACK_IMPORTED_MODULE_0__); + return projection.fromContainerPixelToLatLng(pixel); + } + function v2Equal(a, b) { + return a && b && a[0] === b[0] && a[1] === b[1]; + } -function v2Equal(a, b) { - return a && b && a[0] === b[0] && a[1] === b[1]; -} + echarts.extendComponentModel({ + type: 'gmap', -/* harmony default export */ __webpack_exports__["default"] = (echarts__WEBPACK_IMPORTED_MODULE_0__["extendComponentModel"]({ - type: 'gmap', + setGoogleMap: function(gmap) { + this.__gmap = gmap; + }, - setGoogleMap: function(gmap) { - this.__gmap = gmap; - }, + getGoogleMap: function() { + // __gmap is set when creating GMapCoordSys + return this.__gmap; + }, - getGoogleMap: function() { - // __gmap is set when creating GMapCoordSys - return this.__gmap; - }, + setEChartsLayer: function(layer) { + this.__echartsLayer = layer; + }, - setEChartsLayer: function(layer) { - this.__echartsLayer = layer; - }, + getEChartsLayer: function() { + return this.__echartsLayer; + }, - getEChartsLayer: function() { - return this.__echartsLayer; - }, + setCenterAndZoom: function(center, zoom) { + this.option.center = center; + this.option.zoom = zoom; + }, - setCenterAndZoom: function(center, zoom) { - this.option.center = center; - this.option.zoom = zoom; - }, + centerOrZoomChanged: function(center, zoom) { + var option = this.option; + return !(v2Equal(center, option.center) && zoom === option.zoom); + }, - centerOrZoomChanged: function(center, zoom) { - var option = this.option; - return !(v2Equal(center, option.center) && zoom === option.zoom); - }, + defaultOption: { + center: { lat: 39.90923, lng: 116.397428 }, + zoom: 5, - defaultOption: { - center: { lat: 39.90923, lng: 116.397428 }, - zoom: 5, + // extension options + echartsLayerZIndex: 2000, + renderOnMoving: true + } + }); - // extension options - 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; -/***/ "./src/GMapView.js": -/*!*************************!*\ - !*** ./src/GMapView.js ***! - \*************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var echarts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! echarts */ "echarts"); -/* harmony import */ var echarts__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(echarts__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.debounce */ "./node_modules/lodash.debounce/index.js"); -/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_1__); -/* global google */ + 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; -/* harmony default export */ __webpack_exports__["default"] = (echarts__WEBPACK_IMPORTED_MODULE_0__["extendComponentView"]({ - type: 'gmap', + // 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)); + } - render: function(gmapModel, ecModel, api) { - var rendering = true; + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } - var gmap = gmapModel.getGoogleMap(); - var viewportRoot = api.getZr().painter.getViewportRoot(); - var coordSys = gmapModel.coordinateSystem; - var offsetEl = gmap.getDiv(); - var renderOnMoving = gmapModel.get('renderOnMoving'); - var oldWidth = offsetEl.clientWidth; - var oldHeight = offsetEl.clientHeight; + function trailingEdge(time) { + timerId = undefined; - var renderHandler = function() { - if (rendering) { - return; + // 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; + } - // need resize? - var width = offsetEl.clientWidth; - var height = offsetEl.clientHeight; - if (width !== oldWidth || height !== oldHeight) { - return resizeHandler.call(this); + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); } - - var mapOffset = [ - -parseInt(offsetEl.style.left, 10) || 0, - -parseInt(offsetEl.style.top, 10) || 0 - ]; - viewportRoot.style.left = mapOffset[0] + 'px'; - viewportRoot.style.top = mapOffset[1] + 'px'; - - coordSys.setMapOffset(mapOffset); - gmapModel.__mapOffset = mapOffset; - - api.dispatchAction({ - type: 'gmapRoam', - animation: { - // in ECharts 5.x, - // we can set animation duration as 0 - // to ensure no delay when moving or zooming - duration: 0 - } - }); - }; - - var resizeHandler = function() { - echarts__WEBPACK_IMPORTED_MODULE_0__["getInstanceByDom"](api.getDom()).resize(); - }; - - this._oldRenderHandler && this._oldRenderHandler.remove(); - - if (!renderOnMoving) { - renderHandler = lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default()(renderHandler, 100); - resizeHandler = lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default()(resizeHandler, 100); + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; } - this._oldRenderHandler = google.maps.event.addListener(gmap, 'gmaprender', renderHandler); + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } - rendering = false; - }, + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); - dispose: function(ecModel, api) { - this._oldRenderHandler && this._oldRenderHandler.remove(); - this._oldRenderHandler = null; + lastArgs = arguments; + lastThis = this; + lastCallTime = time; - var component = ecModel.getComponent('gmap'); - var gmapInstance = component.getGoogleMap(); + 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; + } - // remove injected projection - delete gmapInstance.__overlayProjection; + /** + * 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'); + } - // clear all listeners of map instance - google.maps.event.clearInstanceListeners(gmapInstance); + /** + * 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'; + } - // remove DOM of map instance - var mapDiv = gmapInstance.getDiv(); - mapDiv.parentNode.removeChild(mapDiv); + /** + * 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); + } - component.setGoogleMap(null); - component.setEChartsLayer(null); - component.coordinateSystem.setGoogleMap(null); - component.coordinateSystem = null; + /** + * 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 */ -/***/ "./src/index.js": -/*!**********************!*\ - !*** ./src/index.js ***! - \**********************/ -/*! exports provided: version, name */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + echarts.extendComponentView({ + type: 'gmap', -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../package.json */ "./package.json"); -var _package_json__WEBPACK_IMPORTED_MODULE_0___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../package.json */ "./package.json", 1); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "version", function() { return _package_json__WEBPACK_IMPORTED_MODULE_0__["version"]; }); + render: function(gmapModel, ecModel, api) { + var rendering = true; -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "name", function() { return _package_json__WEBPACK_IMPORTED_MODULE_0__["name"]; }); + var gmap = gmapModel.getGoogleMap(); + var viewportRoot = api.getZr().painter.getViewportRoot(); + var coordSys = gmapModel.coordinateSystem; + var offsetEl = gmap.getDiv(); + var renderOnMoving = gmapModel.get('renderOnMoving'); + var oldWidth = offsetEl.clientWidth; + var oldHeight = offsetEl.clientHeight; + + var renderHandler = function() { + if (rendering) { + return; + } -/* harmony import */ var echarts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! echarts */ "echarts"); -/* harmony import */ var echarts__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(echarts__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _GMapCoordSys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./GMapCoordSys */ "./src/GMapCoordSys.js"); -/* harmony import */ var _GMapModel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./GMapModel */ "./src/GMapModel.js"); -/* harmony import */ var _GMapView__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./GMapView */ "./src/GMapView.js"); -/** - * Google Map component extension - */ + // need resize? + var width = offsetEl.clientWidth; + var height = offsetEl.clientHeight; + if (width !== oldWidth || height !== oldHeight) { + return resizeHandler.call(this); + } + var mapOffset = [ + -parseInt(offsetEl.style.left, 10) || 0, + -parseInt(offsetEl.style.top, 10) || 0 + ]; + viewportRoot.style.left = mapOffset[0] + 'px'; + viewportRoot.style.top = mapOffset[1] + 'px'; + + coordSys.setMapOffset(mapOffset); + gmapModel.__mapOffset = mapOffset; + + api.dispatchAction({ + type: 'gmapRoam', + animation: { + // in ECharts 5.x, + // we can set animation duration as 0 + // to ensure no delay when moving or zooming + duration: 0 + } + }); + }; + var resizeHandler = function() { + echarts.getInstanceByDom(api.getDom()).resize(); + }; + this._oldRenderHandler && this._oldRenderHandler.remove(); + if (!renderOnMoving) { + renderHandler = lodash_debounce(renderHandler, 100); + resizeHandler = lodash_debounce(resizeHandler, 100); + } + this._oldRenderHandler = google.maps.event.addListener(gmap, 'gmaprender', renderHandler); + rendering = false; + }, + dispose: function(ecModel, api) { + this._oldRenderHandler && this._oldRenderHandler.remove(); + this._oldRenderHandler = null; + var component = ecModel.getComponent('gmap'); + var gmapInstance = component.getGoogleMap(); -echarts__WEBPACK_IMPORTED_MODULE_1__["registerCoordinateSystem"]('gmap', _GMapCoordSys__WEBPACK_IMPORTED_MODULE_2__["default"]); + // remove injected projection + delete gmapInstance.__overlayProjection; -// Action -echarts__WEBPACK_IMPORTED_MODULE_1__["registerAction"]( - { - type: 'gmapRoam', - event: 'gmapRoam', - update: 'updateLayout' - }, - function(payload, ecModel) { - ecModel.eachComponent('gmap', function(gmapModel) { - var gmap = gmapModel.getGoogleMap(); - var center = gmap.getCenter(); - gmapModel.setCenterAndZoom([center.lng(), center.lat()], gmap.getZoom()); - }); - } -); + // clear all listeners of map instance + google.maps.event.clearInstanceListeners(gmapInstance); + // remove DOM of map instance + var mapDiv = gmapInstance.getDiv(); + mapDiv.parentNode.removeChild(mapDiv); + component.setGoogleMap(null); + component.setEChartsLayer(null); + component.coordinateSystem.setGoogleMap(null); + component.coordinateSystem = null; + } + }); + /** + * Google Map component extension + */ -/***/ }), + echarts.registerCoordinateSystem('gmap', GMapCoordSys); -/***/ "echarts": -/*!**************************!*\ - !*** external "echarts" ***! - \**************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + // Action + echarts.registerAction( + { + type: 'gmapRoam', + event: 'gmapRoam', + update: 'updateLayout' + }, + function(payload, ecModel) { + ecModel.eachComponent('gmap', function(gmapModel) { + var gmap = gmapModel.getGoogleMap(); + var center = gmap.getCenter(); + gmapModel.setCenterAndZoom([center.lng(), center.lat()], gmap.getZoom()); + }); + } + ); -module.exports = __WEBPACK_EXTERNAL_MODULE_echarts__; + exports.name = name; + exports.version = version; -/***/ }) + Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }); -}); -//# sourceMappingURL=echarts-extension-gmap.js.map \ No newline at end of file +}))); +//# sourceMappingURL=echarts-extension-gmap.js.map diff --git a/dist/echarts-extension-gmap.js.map b/dist/echarts-extension-gmap.js.map index 72e5521..7c4c87a 100644 --- a/dist/echarts-extension-gmap.js.map +++ b/dist/echarts-extension-gmap.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://echarts.gmap/webpack/universalModuleDefinition","webpack://echarts.gmap/webpack/bootstrap","webpack://echarts.gmap/./node_modules/lodash.debounce/index.js","webpack://echarts.gmap/(webpack)/buildin/global.js","webpack://echarts.gmap/./src/GMapCoordSys.js","webpack://echarts.gmap/./src/GMapModel.js","webpack://echarts.gmap/./src/GMapView.js","webpack://echarts.gmap/./src/index.js","webpack://echarts.gmap/external \"echarts\""],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,WAAW,OAAO,YAAY;AAC9B,WAAW,QAAQ;AACnB;AACA,WAAW,OAAO;AAClB;AACA,WAAW,QAAQ;AACnB;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,8CAA8C,kBAAkB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACxXA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;ACnBA;AAAA;AAAA;AAAA;;AAE0D;;AAE1D;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,+CAAO;AACpB;;AAEA;AACA,SAAS,8CAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,aAAa,4CAAM;AACnB,YAAY,4CAAM;AAClB;AACA;AACA;;AAEA;AACA;AACA,SAAS,4CAAM;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;;AAEA,oBAAoB,4CAAM;AAC1B;AACA;AACA,MAAM,4CAAM;AACZ;AACA,OAAO;AACP;AACA;AACA,UAAU,4CAAM;AAChB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEe,2EAAY,EAAC;;;;;;;;;;;;;AChR5B;AAAA;AAAA;AAAmC;;AAEnC;AACA;AACA;;AAEe,2HAA4B;AAC3C;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;AACA,aAAa,iCAAiC;AAC9C;;AAEA;AACA;AACA;AACA;AACA,CAAC,CAAC,EAAC;;;;;;;;;;;;;AC5CH;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEmC;AACI;;AAExB,0HAA2B;AAC1C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,MAAM,wDAAwB;AAC9B;;AAEA;;AAEA;AACA,sBAAsB,sDAAQ;AAC9B,sBAAsB,sDAAQ;AAC9B;;AAEA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,EAAC;;;;;;;;;;;;;AC1FH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;;AAEgD;;AAEb;AACO;;AAErB;AACD;;AAEpB,gEAAgC,SAAS,qDAAY;;AAErD;AACA,sDAAsB;AACtB;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEyB;;;;;;;;;;;;AC9BzB,qD","file":"echarts-extension-gmap.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"echarts\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"gmap\", [\"echarts\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"gmap\"] = factory(require(\"echarts\"));\n\telse\n\t\troot[\"echarts\"] = root[\"echarts\"] || {}, root[\"echarts\"][\"gmap\"] = factory(root[\"echarts\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_echarts__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.js\");\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","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/* 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 if (px) {\n var mapOffset = this._mapOffset;\n return [px.x - mapOffset[0], px.y - mapOffset[1]];\n }\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.style.cssText = 'width:100%;height:100%';\n // Not support IE8\n gmapRoot.classList.add('ec-extension-google-map');\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;\n }\n\n return projection.fromLatLngToContainerPixel(latLng);\n}\n\nfunction pixelToLatLng(pixel, map) {\n var projection = map.__overlayProjection;\n if (!projection) {\n return;\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","/* 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 var gmapInstance = component.getGoogleMap();\n\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.removeChild(mapDiv);\n\n component.setGoogleMap(null);\n component.setEChartsLayer(null);\n component.coordinateSystem.setGoogleMap(null);\n component.coordinateSystem = null;\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","module.exports = __WEBPACK_EXTERNAL_MODULE_echarts__;"],"sourceRoot":""} \ No newline at end of file +{"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 if (px) {\n var mapOffset = this._mapOffset;\n return [px.x - mapOffset[0], px.y - mapOffset[1]];\n }\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.style.cssText = 'width:100%;height:100%';\n // Not support IE8\n gmapRoot.classList.add('ec-extension-google-map');\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;\n }\n\n return projection.fromLatLngToContainerPixel(latLng);\n}\n\nfunction pixelToLatLng(pixel, map) {\n var projection = map.__overlayProjection;\n if (!projection) {\n return;\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 var gmapInstance = component.getGoogleMap();\n\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.removeChild(mapDiv);\n\n component.setGoogleMap(null);\n component.setEChartsLayer(null);\n component.coordinateSystem.setGoogleMap(null);\n component.coordinateSystem = null;\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,IAAI,CAAC;EACpB,EAAE,IAAI,CAAC,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;EACnC,EAAE,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAC3B,EAAE,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;EAClB,CAAC;AACD;EACA,IAAI,iBAAiB,GAAG,YAAY,CAAC,SAAS,CAAC;AAC/C;EACA;EACA,IAAI,eAAe,GAAG;EACtB,EAAE,oBAAoB;EACtB,EAAE,gBAAgB;EAClB,CAAC,CAAC;AACF;EACA,iBAAiB,CAAC,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC9C;EACA,iBAAiB,CAAC,OAAO,GAAG,SAAS,IAAI,EAAE;EAC3C,EAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;EACpB,CAAC,CAAC;AACF;EACA,iBAAiB,CAAC,SAAS,GAAG,SAAS,MAAM,EAAE;EAC/C,EAAE,IAAI,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;EAC5D,EAAE,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;EACnD,CAAC,CAAC;AACF;EACA,iBAAiB,CAAC,YAAY,GAAG,SAAS,SAAS,EAAE;EACrD,EAAE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;EAC9B,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AAE;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 5b97594..bd06ff6 100644 --- a/dist/echarts-extension-gmap.min.js +++ b/dist/echarts-extension-gmap.min.js @@ -1 +1,29 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("echarts")):"function"==typeof define&&define.amd?define("gmap",["echarts"],t):"object"==typeof exports?exports.gmap=t(require("echarts")):(e.echarts=e.echarts||{},e.echarts.gmap=t(e.echarts))}(this,(function(e){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(t,n){t.exports=e},function(e){e.exports=JSON.parse('{"a":"echarts-extension-gmap","b":"1.2.0"}')},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,u=s||c||Function("return this")(),p=Object.prototype.toString,l=Math.max,f=Math.min,g=function(){return u.Date.now()};function d(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==p.call(e)}(e))return NaN;if(d(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=d(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=r.test(e);return s||i.test(e)?a(e.slice(2),s?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var o,r,i,a,s,c,u=0,p=!1,h=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=o,i=r;return o=r=void 0,u=t,a=e.apply(i,n)}function _(e){return u=e,s=setTimeout(b,t),p?v(e):a}function x(e){var n=e-c;return void 0===c||n>=t||n<0||h&&e-u>=i}function b(){var e=g();if(x(e))return w(e);s=setTimeout(b,function(e){var n=t-(e-c);return h?f(n,i-(e-u)):n}(e))}function w(e){return s=void 0,y&&o?v(e):(o=r=void 0,a)}function O(){var e=g(),n=x(e);if(o=arguments,r=this,c=e,n){if(void 0===s)return _(c);if(h)return s=setTimeout(b,t),v(c)}return void 0===s&&(s=setTimeout(b,t)),a}return t=m(t)||0,d(n)&&(p=!!n.leading,i=(h="maxWait"in n)?l(m(n.maxWait)||0,t):i,y="trailing"in n?!!n.trailing:y),O.cancel=function(){void 0!==s&&clearTimeout(s),u=0,o=c=r=s=void 0},O.flush=function(){return void 0===s?a:w(g())},O}}).call(this,n(3))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t),n.d(t,"version",(function(){return o.b})),n.d(t,"name",(function(){return o.a}));var o=n(1),r=n(0);function i(e,t){this._gmap=e,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}var a,s=i.prototype,c=["echartsLayerZIndex","renderOnMoving"];function u(e,t){return t=t||[0,0],r.util.map([0,1],(function(n){var o=t[n],r=e[n]/2,i=[],a=[];return i[n]=o-r,a[n]=o+r,i[1-n]=a[1-n]=t[1-n],Math.abs(this.dataToPoint(i)[n]-this.dataToPoint(a)[n])}),this)}function p(e,t){var n=t.__overlayProjection;if(n)return n.fromLatLngToContainerPixel(e)}s.dimensions=["lng","lat"],s.setZoom=function(e){this._zoom=e},s.setCenter=function(e){var t=new google.maps.LatLng(e[1],e[0]);this._center=p(t,this._gmap)},s.setMapOffset=function(e){this._mapOffset=e},s.setGoogleMap=function(e){this._gmap=e},s.getGoogleMap=function(){return this._gmap},s.dataToPoint=function(e){var t=p(new google.maps.LatLng(e[1],e[0]),this._gmap);if(t){var n=this._mapOffset;return[t.x-n[0],t.y-n[1]]}},s.pointToData=function(e){var t=this._mapOffset,n=function(e,t){var n=t.__overlayProjection;if(!n)return;return n.fromContainerPixelToLatLng(e)}(new google.maps.Point(e[0]+t[0],e[1]+t[1]),this._gmap);return[n.lng(),n.lat()]},s.getViewRect=function(){var e=this._api;return new r.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},s.getRoamTransform=function(){return r.matrix.create()},s.prepareCustoms=function(e){var t=this.getViewRect();return{coordSys:{type:"gmap",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:r.util.bind(this.dataToPoint,this),size:r.util.bind(u,this)}}},i.dimensions=s.dimensions,i.create=function(e,t){var n,o=t.getDom();e.eachComponent("gmap",(function(e){var s=t.getZr().painter,u=s.getViewportRoot();if("undefined"==typeof google||void 0===google.maps||void 0===google.maps.Map)throw new Error("It seems that Google Map API has not been loaded completely yet.");if(a=a||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 p=e.getGoogleMap();if(!p){var l=o.querySelector(".ec-extension-google-map");l&&(u.style.left="0px",u.style.top="0px",u.style.width="100%",u.style.height="100%",o.removeChild(l)),(l=document.createElement("div")).style.cssText="width:100%;height:100%",l.classList.add("ec-extension-google-map"),o.appendChild(l);var f=r.util.clone(e.get()),g=f.echartsLayerZIndex;r.util.each(c,(function(e){delete f[e]}));var d=f.center;r.util.isArray(d)&&(f.center={lng:d[0],lat:d[1]}),p=new google.maps.Map(l,f),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 a(u,p);n.setZIndex(g),e.setEChartsLayer(n)})),s.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})}}(n=new i(p,t)).setMapOffset(e.__mapOffset||[0,0]),n.setZoom(h),n.setCenter(m),e.coordinateSystem=n})),e.eachSeries((function(e){"gmap"===e.get("coordinateSystem")&&(e.coordinateSystem=n)}))};var l=i;r.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,r=this.option;return n=e,o=r.center,!(n&&o&&n[0]===o[0]&&n[1]===o[1]&&t===r.zoom)},defaultOption:{center:{lat:39.90923,lng:116.397428},zoom:5,echartsLayerZIndex:2e3,renderOnMoving:!0}});var f=n(2),g=n.n(f);r.extendComponentView({type:"gmap",render:function(e,t,n){var o=!0,i=e.getGoogleMap(),a=n.getZr().painter.getViewportRoot(),s=e.coordinateSystem,c=i.getDiv(),u=e.get("renderOnMoving"),p=c.clientWidth,l=c.clientHeight,f=function(){if(!o){var t=c.clientWidth,r=c.clientHeight;if(t!==p||r!==l)return d.call(this);var i=[-parseInt(c.style.left,10)||0,-parseInt(c.style.top,10)||0];a.style.left=i[0]+"px",a.style.top=i[1]+"px",s.setMapOffset(i),e.__mapOffset=i,n.dispatchAction({type:"gmapRoam",animation:{duration:0}})}},d=function(){r.getInstanceByDom(n.getDom()).resize()};this._oldRenderHandler&&this._oldRenderHandler.remove(),u||(f=g()(f,100),d=g()(d,100)),this._oldRenderHandler=google.maps.event.addListener(i,"gmaprender",f),o=!1},dispose:function(e,t){this._oldRenderHandler&&this._oldRenderHandler.remove(),this._oldRenderHandler=null;var n=e.getComponent("gmap"),o=n.getGoogleMap();delete o.__overlayProjection,google.maps.event.clearInstanceListeners(o);var r=o.getDiv();r.parentNode.removeChild(r),n.setGoogleMap(null),n.setEChartsLayer(null),n.coordinateSystem.setGoogleMap(null),n.coordinateSystem=null}});r.registerCoordinateSystem("gmap",l),r.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())}))}))}])})); \ No newline at end of file +/*! + * echarts-extension-gmap + * @version 1.2.0 + * @author plainheart + * + * MIT License + * + * Copyright (c) 2020 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * 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,r=n.prototype,i=["echartsLayerZIndex","renderOnMoving"];function a(e,n){return n=n||[0,0],t.util.map([0,1],(function(t){var o=n[t],r=e[t]/2,i=[],a=[];return i[t]=o-r,a[t]=o+r,i[1-t]=a[1-t]=n[1-t],Math.abs(this.dataToPoint(i)[t]-this.dataToPoint(a)[t])}),this)}function s(e,t){var n=t.__overlayProjection;if(n)return n.fromLatLngToContainerPixel(e)}r.dimensions=["lng","lat"],r.setZoom=function(e){this._zoom=e},r.setCenter=function(e){var t=new google.maps.LatLng(e[1],e[0]);this._center=s(t,this._gmap)},r.setMapOffset=function(e){this._mapOffset=e},r.setGoogleMap=function(e){this._gmap=e},r.getGoogleMap=function(){return this._gmap},r.dataToPoint=function(e){var t=s(new google.maps.LatLng(e[1],e[0]),this._gmap);if(t){var n=this._mapOffset;return[t.x-n[0],t.y-n[1]]}},r.pointToData=function(e){var t=this._mapOffset,n=function(e,t){var n=t.__overlayProjection;if(!n)return;return n.fromContainerPixelToLatLng(e)}(new google.maps.Point(e[0]+t[0],e[1]+t[1]),this._gmap);return[n.lng(),n.lat()]},r.getViewRect=function(){var e=this._api;return new t.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},r.getRoamTransform=function(){return t.matrix.create()},r.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=r.dimensions,n.create=function(e,r){var a,s=r.getDom();e.eachComponent("gmap",(function(e){var f=r.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")).style.cssText="width:100%;height:100%",u.classList.add("ec-extension-google-map"),s.appendChild(u);var c=t.util.clone(e.get()),g=c.echartsLayerZIndex;t.util.each(i,(function(e){delete c[e]}));var d=c.center;t.util.isArray(d)&&(c.center={lng:d[0],lat:d[1]}),p=new google.maps.Map(u,c),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(g),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,r)).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,r=this.option;return n=e,o=r.center,!(n&&o&&n[0]===o[0]&&n[1]===o[1]&&t===r.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,c=/^0o[0-7]+$/i,g=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,x=function(){return h.Date.now()};function w(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(w(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=w(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(l,"");var n=u.test(e);return n||c.test(e)?g(e.slice(2),n?2:8):p.test(e)?NaN:+e}var L=function(e,t,n){var o,r,i,a,s,f,l=0,p=!1,u=!1,c=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var n=o,i=r;return o=r=undefined,l=t,a=e.apply(i,n)}function d(e){return l=e,s=setTimeout(h,t),p?g(e):a}function m(e){var n=e-f;return f===undefined||n>=t||n<0||u&&e-l>=i}function h(){var e=x();if(m(e))return y(e);s=setTimeout(h,function(e){var n=t-(e-f);return u?_(n,i-(e-l)):n}(e))}function y(e){return s=undefined,c&&o?g(e):(o=r=undefined,a)}function L(){var e=x(),n=m(e);if(o=arguments,r=this,f=e,n){if(s===undefined)return d(f);if(u)return s=setTimeout(h,t),g(f)}return s===undefined&&(s=setTimeout(h,t)),a}return t=C(t)||0,w(n)&&(p=!!n.leading,i=(u="maxWait"in n)?v(C(n.maxWait)||0,t):i,c="trailing"in n?!!n.trailing:c),L.cancel=function(){s!==undefined&&clearTimeout(s),l=0,o=f=r=s=undefined},L.flush=function(){return s===undefined?a:y(x())},L};t.extendComponentView({type:"gmap",render:function(e,n,o){var r=!0,i=e.getGoogleMap(),a=o.getZr().painter.getViewportRoot(),s=e.coordinateSystem,f=i.getDiv(),l=e.get("renderOnMoving"),p=f.clientWidth,u=f.clientHeight,c=function(){if(!r){var t=f.clientWidth,n=f.clientHeight;if(t!==p||n!==u)return g.call(this);var i=[-parseInt(f.style.left,10)||0,-parseInt(f.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}})}},g=function(){t.getInstanceByDom(o.getDom()).resize()};this._oldRenderHandler&&this._oldRenderHandler.remove(),l||(c=L(c,100),g=L(g,100)),this._oldRenderHandler=google.maps.event.addListener(i,"gmaprender",c),r=!1},dispose:function(e,t){this._oldRenderHandler&&this._oldRenderHandler.remove(),this._oldRenderHandler=null;var n=e.getComponent("gmap"),o=n.getGoogleMap();delete o.__overlayProjection,google.maps.event.clearInstanceListeners(o);var r=o.getDiv();r.parentNode.removeChild(r),n.setGoogleMap(null),n.setEChartsLayer(null),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.2.0",Object.defineProperty(e,"__esModule",{value:!0})})); diff --git a/package.json b/package.json index cb81628..6a74c20 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,11 @@ "description": "An Google Map(https://www.google.com/maps) extension for Apache ECharts (incubating) (https://github.com/apache/incubator-echarts)", "main": "dist/echarts-extension-gmap.min.js", "scripts": { - "build": "webpack --env=production --optimize-minimize --progress --colors", - "dev": "webpack --env=development", - "watch": "webpack --env=development --watch", + "dev": "node build/build.js", + "watch": "node build/build.js -w", + "build": "node build/build.js --min", + "release": "node build/build.js --release", + "help": "node build/build.js --help", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { @@ -33,8 +35,13 @@ }, "homepage": "https://github.com/plainheart/echarts-extension-gmap#readme", "devDependencies": { - "webpack": "^4.29.5", - "webpack-cli": "^3.2.3" + "@rollup/plugin-commonjs": "^15.1.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^9.0.0", + "commander": "^6.1.0", + "fs-extra": "^9.0.1", + "rollup": "^2.28.2", + "rollup-plugin-terser": "^7.0.2" }, "dependencies": { "lodash.debounce": "^4.0.8" diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index d2c4589..0000000 --- a/webpack.config.js +++ /dev/null @@ -1,27 +0,0 @@ -const path = require('path'); -const webpack = require('webpack'); - -const ENTRY_NAME = 'gmap'; - -module.exports = function (env, argv) { - const isProd = env === 'production'; - return { - mode: isProd ? 'production' : 'development', - entry: { - [ENTRY_NAME]: './src/index.js' - }, - output: { - libraryTarget: 'umd', - library: ['echarts', ENTRY_NAME], - umdNamedDefine: true, - globalObject: 'this', - path: path.resolve(__dirname, './dist'), - pathinfo: !isProd, - filename: 'echarts-extension-' + (isProd ? '[name].min.js' : '[name].js') - }, - devtool: isProd ? false : 'source-map', - externals: { - echarts: 'echarts' - } - } -}